K8S的Nginx-Ingress-Controller
helm repo add bitnami https://charts.bitnami.com/bitnami
helm search repo bitnami | grep nginx-ingress-controller
bitnami/nginx-ingress-controller 9.3.31 1.6.4 NGINX Ingress Controller is an Ingress controll...
helm install nginx-ingress-controller bitnami/nginx-ingress-controller
# 部署成功后会生成一个Ingress的配置示例,参考下面的‘Ingress.yaml’内容
# 或者拉到本地进行所需要的调整
# helm pull bitnami/nginx-ingress-controller在Ingress中调用Nginx Ingress Controller
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example
namespace: default
spec:
ingressClassName: nginx
rules:
- host: www.example.com
http:
paths:
- backend:
service:
name: example-service
port:
number: 80
path: /
pathType: Prefix
# This section is only required if TLS is to be enabled for the Ingress
tls:
- hosts:
- www.example.com
secretName: example-tls
If TLS is enabled for the Ingress, a Secret containing the certificate and key must also be provided:
apiVersion: v1
kind: Secret
metadata:
name: example-tls
namespace: default
data:
tls.crt: <base64 encoded cert>
tls.key: <base64 encoded key>
type: kubernetes.io/tls最后更新于