Skip to content

"One Ingress Controller for multiple namespaces"→ ingress1 & ingress2 #2

@jerzy-wachowiak

Description

@jerzy-wachowiak

https://github.com/vplauzon/aks/tree/master/ingress-multiple-ns

Article is very helpfull as the ad­di­ti­o­nal information to https://learn.microsoft.com/en-us/azure/aks/ingress-basic ! :-) but the field naming in k8s manifest and apiVersion changed in the last two years. This worked for me:

ingress1.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-hello-world-1
  namespace: hello1
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
        - path: /hello-world-one
          pathType: Prefix
          backend:
            service:
              name: aks-helloworld-one
              port:
                number: 80

ingress2.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-hello-world-2
  namespace: hello2
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
        - path: /hello-world-two
          pathType: Prefix
          backend:
            service:
              name: aks-helloworld-two
              port:
                number: 80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions