kubernetes-bootstrapping/04-ingress-controller-nginx
2023-12-23 10:02:49 -07:00
..
README.md Fix apiVersion for ingress-controller-nginx examples 2023-12-23 10:02:49 -07:00
values.yaml resequence directories 2023-12-22 22:47:02 -07:00

04 | Ingress Controller = NGINX

https://kubernetes.github.io/ingress-nginx/ https://github.com/kubernetes/ingress-nginx

helm upgrade --install ingress-nginx ingress-nginx   --repo https://kubernetes.github.io/ingress-nginx   --namespace ingress-nginx --create-namespace -f values.yaml

Example usage:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-mandelmapper
spec:
  ingressClassName: nginx
  rules:
  - host: mandelmap.home.stevenpolley.net
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: mandelmapper
            port:
              number: 6161

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-myservicea
spec:
  ingressClassName: nginx
  rules:
  - host: myservicea.foo.org
    http:
      paths:
      - path: /
        backend:
          service:
            name: myservicea
            port:
              number: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-myserviceb
spec:
  ingressClassName: nginx
  rules:
  - host: myserviceb.foo.org
    http:
      paths:
      - path: /
        backend:
          service:
            name: myserviceb
            port:
              number: 8443
  tls:
    - hosts:
      - myserviceb.foo.org
      secretName: example-tls
---
# A secret must also be provided, likely by a cert-manager of some kind
apiVersion: v1
kind: Secret
metadata:
  name: example-tls
data:
  tls.crt: <base64 encoded cert>
  tls.key: <base64 encoded key>
type: kubernetes.io/tls