helm3安装ingress-nginx
kubernetes集群使用helm安装ingress-nginx —>生成ingress-nginx-controller
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
ll
./get_helm.sh
ln -s /usr/local/bin/helm /usr/bin/
helm version
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm repo list
helm install ingress-nginx ingress-nginx/ingress-nginx
kubectl get all
kubectl get svc ingress-nginx-controller -o yaml
kubectl get svc ingress-nginx-controller -o template={{.spec.type}}
kubectl patch svc ingress-nginx-controller -p ‘{“spec”:{“type”: “NodePort”}}’
kubectl get svc
参考链接0 https://github.com/kubernetes/ingress-nginx/tree/main/charts/ingress-nginx
参考链接1 https://helm.sh/docs/intro/install/
参考链接2 https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx
最终生成,需好好使用:
NAME: ingress-nginx
LAST DEPLOYED: Thu Oct 28 04:44:42 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
The ingress-nginx controller has been installed.
It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running ‘kubectl --namespace default get services -o wide -w my-ingress-nginx-controller’
An example Ingress that makes use of the controller:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
name: example
namespace: foo
spec:
ingressClassName: example-class
rules:
- host: www.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: exampleService
port: 80
# 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: foo
data:
tls.crt:
tls.key:
type: kubernetes.io/tls