Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: annotation group ServerSnippet contains risky annotation based on ingress configuration #3774

Open
liuxin638507 opened this issue Jan 24, 2025 · 0 comments

Comments

@liuxin638507
Copy link

liuxin638507 commented Jan 24, 2025

How to modify the rancher-cluster.yml configuration file to resolve this error
annotation group ServerSnippet contains risky annotation based on ingress configuration

rke version
rke:1.7.1 --> rke:1.7.2

cat rancher-cluster.yml

......
ingress:
  provider: nginx
  options:
    use-forwarded-headers: "true"
    allow-snippet-annotations: "true" 
......

test.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/server-snippet: client_header_buffer_size 2m;
  name: test-ingress
  namespace: om
spec:
  rules:
  - host:
    http:
      paths:
      - backend:
          service:
            name: test
            port:
              number: 80
        path: /test/
        pathType: ImplementationSpecific

kubectl apply -f test.yaml

{"spec":{"rules":[{"host":null,"http":{"paths":[{"backend":{"service":{"name":"test","port":{"number":80}}},"path":"/test/","pathType":"ImplementationSpecific"}]}}]}}
to:
Resource: "networking.k8s.io/v1, Resource=ingresses", GroupVersionKind: "networking.k8s.io/v1, Kind=Ingress"
Name: "test-ingress", Namespace: "om"
for: "test-ingress.yaml": error when patching "test-ingress.yaml": admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: annotation group ServerSnippet contains risky annotation based on ingress configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant