CentOS搭建k8s集群(7)—安装nginx-ingress

服务器信息
master:192.168.201.1
node1:192.168.101.2
node2:192.168.101.3

1、查找nginx-ingress
helm search repo nginx-ingress
选择这个nginx/nginx-ingress

2、展示values.yaml文件,分析helm安装nginx ingress的命令行覆盖参数(很重要)
helm show values nginx/nginx-ingress

3、安装nginx-ingress
kubectl create namespace nginx-ingress
helm install gateway nginx/nginx-ingress \
--namespace nginx-ingress \
--set controller.hostNetwork=true \
--set controller.healthStatus=true \
--set controller.service.type=NodePort \
--set controller.service.httpPort.nodePort=30080 \
--set controller.service.httpsPort.nodePort=30443

使用NodePort网络访问方式,http端口为30080,https端口为30443

继续阅读CentOS搭建k8s集群(7)—安装nginx-ingress

CentOS清空iptables规则

1、查看iptables配置
iptables -L

2、清除默认链的规则
iptables -F

3、清除自定义链
iptables -X

4、保存当前规则
service iptables save
保存时如果报错
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
先安装服务
yum install iptables-services

5、重启服务
systemctl restart iptables