“Kubernetes ingress基础”的版本间的差异
跳到导航
跳到搜索
小 (导入1个版本) |
|||
第3行: | 第3行: | ||
ngress是Kubernetes集群对外暴露服务的一种推荐方法,Ingress封装了nginx,背后还是nginx在发挥作用,Ingress的作用是不断检测pod的IP变化,然后将变化更新到nginx的配置中。从而当集群中有pod重启时,可以做到不用重启nginx | ngress是Kubernetes集群对外暴露服务的一种推荐方法,Ingress封装了nginx,背后还是nginx在发挥作用,Ingress的作用是不断检测pod的IP变化,然后将变化更新到nginx的配置中。从而当集群中有pod重启时,可以做到不用重启nginx | ||
+ | |||
+ | ==with Helm== | ||
+ | |||
+ | [https://www.cnblogs.com/syushin/p/15271304.html 使用Helm3.6 安装 Ingress-nginx ] | ||
+ | |||
==install== | ==install== | ||
===部署Ingress 控制器=== | ===部署Ingress 控制器=== |
2022年7月2日 (六) 06:02的版本
Nginx ingress 使用ConfigMap来管理Nginx配置,nginx是大家熟知的代理和负载均衡软件,比起Traefik来说功能更加强大.
ngress是Kubernetes集群对外暴露服务的一种推荐方法,Ingress封装了nginx,背后还是nginx在发挥作用,Ingress的作用是不断检测pod的IP变化,然后将变化更新到nginx的配置中。从而当集群中有pod重启时,可以做到不用重启nginx
with Helm
install
部署Ingress 控制器
#FQ吧 少年 wget -c https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml kubectl apply -f mandatory.yaml namespace/ingress-nginx configured configmap/nginx-configuration unchanged configmap/tcp-services created configmap/udp-services created serviceaccount/nginx-ingress-serviceaccount unchanged clusterrole.rbac.authorization.k8s.io/nginx-ingress-clusterrole configured role.rbac.authorization.k8s.io/nginx-ingress-role unchanged rolebinding.rbac.authorization.k8s.io/nginx-ingress-role-nisa-binding unchanged clusterrolebinding.rbac.authorization.k8s.io/nginx-ingress-clusterrole-nisa-binding unchanged deployment.apps/nginx-ingress-controller configured Verify installation To check if the ingress controller pods have started, kubectl get pods --all-namespaces -l app.kubernetes.io/name=ingress-nginx --watch NAMESPACE NAME READY STATUS RESTARTS AGE ingress-nginx nginx-ingress-controller-86449c74bb-rthhw 0/1 ImagePullBackOff 0 2m5s kubectl get pods -n ingress-nginx -o wide --watch #也是查看 Once the operator pods are running, you can cancel the above command by typing Ctrl+C. 可见上面还不是runing 过一阵才好 kubectl get pods -n ingress-nginx NAME READY STATUS RESTARTS AGE nginx-ingress-controller-86449c74bb-rthhw 1/1 Running 0 19h
部署svc
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml service/ingress-nginx created [root@master ingress]# kubectl get svc -n ingress-nginx NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE ingress-nginx LoadBalancer 10.99.141.156 <pending> 80:31279/TCP,443:30847/TCP 2m43s
trouble
kubectl get ing #ADDRESS 为空 NAME HOSTS ADDRESS PORTS AGE simple * 80 4s
see also
K8S 部署 ingress-nginx (一) 原理及搭建
解决kubernetes中ingress-nginx配置问题
Kubernetes - nginx-ingress 配置跳坑指南