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

Missing ValidatingWebhookConfiguration #292

Closed
IvanJosipovic opened this issue Sep 27, 2024 · 1 comment
Closed

Missing ValidatingWebhookConfiguration #292

IvanJosipovic opened this issue Sep 27, 2024 · 1 comment

Comments

@IvanJosipovic
Copy link

IvanJosipovic commented Sep 27, 2024

Hello,

I noticed that this operator does not deploy the ValidatingWebhookConfiguration which is part of the open-source nginx ingress. This webhook validates the Ingress objects for many conditions.

Is this by design?

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  annotations:
    meta.helm.sh/release-name: ingress-nginx
    meta.helm.sh/release-namespace: ingress
  generation: 2
  labels:
    app.kubernetes.io/component: admission-webhook
    app.kubernetes.io/instance: ingress-nginx
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx
    app.kubernetes.io/version: 1.10.4
    helm.sh/chart: ingress-nginx-4.10.4
  name: ingress-nginx-admission
webhooks:
- admissionReviewVersions:
  - v1
  clientConfig:
    caBundle: >
      -----BEGIN CERTIFICATE-----
      ...
      -----END CERTIFICATE-----
    service:
      name: ingress-nginx-controller-admission
      namespace: ingress
      path: /networking/v1/ingresses
      port: 443
  failurePolicy: Fail
  matchPolicy: Equivalent
  name: validate.nginx.ingress.kubernetes.io
  namespaceSelector: {}
  objectSelector: {}
  rules:
  - apiGroups:
    - networking.k8s.io
    apiVersions:
    - v1
    operations:
    - CREATE
    - UPDATE
    resources:
    - ingresses
    scope: '*'
  sideEffects: None
  timeoutSeconds: 10

Without this webhook, we can commit invalid Ingress objects such as:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: one
  namespace: default
spec:
  rules:
  - host: testapp.test.loc
    http:
      paths:
      - backend:
          service:
            name: app
            port:
              number: 8080
        path: /
        pathType: ImplementationSpecific
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: two
  namespace: default
spec:
  rules:
  - host: testapp.test.loc
    http:
      paths:
      - backend:
          service:
            name: app
            port:
              number: 8080
        path: /
        pathType: ImplementationSpecific

With the webhook, we receive the following error:
Ingress/default/one dry-run failed (BadRequest): admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: host "testapp.test.loc" and path "/" is already defined in ingress default-radius-app1/ingress

@IvanJosipovic
Copy link
Author

IvanJosipovic commented Oct 2, 2024

It was by design, #151, then I would consider this a bug.

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