Kubernetes path based ingress routing in networking.k8s.io/v1beta1

Wed, 28 July 2021

routing.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: my-lb-ip
    kubernetes.io/ingress.class: "gce"
    networking.gke.io/managed-certificates: "my-tls-name"
spec:
  rules:
    - host: www.example.com
      http:
        paths:
          - path: /api/
            backend:
              serviceName: example-api-nodeport
              servicePort: api-port
          - backend:
              serviceName: web-nodeport
              servicePort: web-port