2023-12-23 02:54:51 +00:00
|
|
|
# 08-Ingress-Nginx-Controller
|
|
|
|
|
2023-12-23 05:24:31 +00:00
|
|
|
[https://kubernetes.github.io/ingress-nginx/](https://kubernetes.github.io/ingress-nginx/)
|
|
|
|
[https://github.com/kubernetes/ingress-nginx](https://github.com/kubernetes/ingress-nginx)
|
|
|
|
|
2023-12-23 02:54:51 +00:00
|
|
|
```bash
|
|
|
|
helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace -f values.yaml
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
|
|
|
name: ingress-myservicea
|
|
|
|
spec:
|
|
|
|
ingressClassName: nginx
|
|
|
|
rules:
|
|
|
|
- host: myservicea.foo.org
|
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- path: /
|
|
|
|
backend:
|
|
|
|
serviceName: myservicea
|
|
|
|
servicePort: 8080
|
|
|
|
---
|
|
|
|
apiVersion: networking.k8s.io/v1beta1
|
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
|
|
|
name: ingress-myserviceb
|
|
|
|
spec:
|
|
|
|
ingressClassName: nginx
|
|
|
|
rules:
|
|
|
|
- host: myserviceb.foo.org
|
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- path: /
|
|
|
|
backend:
|
|
|
|
serviceName: myserviceb
|
|
|
|
servicePort: 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
|
|
|
|
```
|