我正在通过helm3部署一个nginx入口控制器。我使用以下值。yaml(它明确地说要使用端口81),但是在我部署它之后,控制器仍然说它在端口80上侦听。我不知道我做错了什么。
$ helm upgrade --install --namespace=default -f values.devops.yaml nic-default stable/nginx-ingress
$ kubectl get svc nic-default-nginx-ingress
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nic-default-nginx-ingress LoadBalancer 10.100.36.39 somedomain.com 80:30193/TCP,443:30265/TCP 7h53m
values.yaml
clusterName : dev
region : us-east-1
tag : v1.0.0
revisionHistoryLimit: 3
rbac:
create: true
defaultBackend:
enabled: false
serviceAccount:
create: false
name : "nginx-ingress-default"
controller:
kind : "Deployment"
name : "controller"
ingressClass : "nginx-default-internal"
replicaCount : 1
minAvailable : 1
minReadySeconds : 5
hostNetwork : false
extraArgs :
http: 81
image:
tag : "0.30.0"
pullPolicy: "IfNotPresent"
config:
keep-alive : "600"
upstream-keepalive-timeout : "600"
enable-underscores-in-headers: "true"
ssl-redirect : "false"
force-ssl-redirect : "false"
use-forwarded-headers : "true" # https://github.com/kubernetes/ingress-nginx/issues/1957#issuecomment-462826897
nodeSelector:
namespace: default
publishService:
enabled: true
containerPort:
http: 81
service:
type : "LoadBalancer"
enableHttp : true
enableHttps: false
ports:
http: 81
targetPorts:
http: 81
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal : 0.0.0.0/0
service.beta.kubernetes.io/aws-load-balancer-backend-protocol : http
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout : "500"
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol : "*"
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: "Cluster=dev,Type=k8s,Namespace=default"
我刚刚尝试安装nginx入口控制器在一个新的星期集群使用下面的命令和它的负载平衡服务得到端口81:
helm upgrade --install --namespace=default nic-default stable/nginx-ingress --set 'controller.service.ports.http=81'
kubectl get svc | grep controller
nic-default-nginx-ingress-controller LoadBalancer 10.100.9.106 81:31023/TCP,443:31864/TCP 27m
不知道你那边有什么问题
注意这个图表是不推荐的。请使用https://github.com/kubernetes/ingress-nginx/tree/master/charts/ingress-nginx。