Skip to content

ingress for operator

Cesar Celis Hernandez edited this page Sep 11, 2023 · 1 revision

Objective:

To show a working ingress for Operator and one that can be leading to a failure if not well used.

Working One:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minio-operator
  namespace: minio-operator
spec:
  rules:
    - host: "minio.operator"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: console
                port:
                  number: 9090

Failing one:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minio-operator
  namespace: minio-operator
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
    - host: "minio.operator"
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: console
                port:
                  number: 9090
  • Above ingress will fail in kind due to:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
  • Our recommendation is to make sure to understand how rewrite target actually works: Rewrite Target prior using this notation.
Clone this wiki locally