使用 helm 将 nodeSelector 提供给 nginx ingress
Provide nodeSelector to nginx ingress using helm
我花了一些时间研究如何将参数传递给 helm 以便正确配置 nodeSelector
。
不同的尝试导致了不同的错误,例如:
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.nodeSelector.kubernetes): invalid type for io.k8s.api.core.v1.PodSpec.nodeSelector: got "map", expected "string"
coalesce.go:196: warning: cannot overwrite table with non table for nodeSelector (map[])
参考:https://docs.microsoft.com/en-us/azure/aks/ingress-static-ip
在上面的link中,我们可以看到应该如何使用:
helm install nginx-ingress stable/nginx-ingress \
--namespace $NAMESPACE \
--set controller.replicaCount=1 \
--set controller.nodeSelector."kubernetes\.io/hostname"=$LOADBALANCER_NODE \
--set controller.service.loadBalancerIP="$LOADBALANCER_IP" \
--set controller.extraArgs.default-ssl-certificate="$NAMESPACE/$LOADBALANCER_NODE-ssl"
一般来说,查看 helm 帮助是一个很好的来源:https://helm.sh/docs/intro/using_helm/#the-format-and-limitations-of---set
在这里你可以找到所有的nginx参数:https://github.com/helm/charts/tree/master/stable/nginx-ingress
我花了一些时间研究如何将参数传递给 helm 以便正确配置 nodeSelector
。
不同的尝试导致了不同的错误,例如:
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.nodeSelector.kubernetes): invalid type for io.k8s.api.core.v1.PodSpec.nodeSelector: got "map", expected "string"
coalesce.go:196: warning: cannot overwrite table with non table for nodeSelector (map[])
参考:https://docs.microsoft.com/en-us/azure/aks/ingress-static-ip
在上面的link中,我们可以看到应该如何使用:
helm install nginx-ingress stable/nginx-ingress \
--namespace $NAMESPACE \
--set controller.replicaCount=1 \
--set controller.nodeSelector."kubernetes\.io/hostname"=$LOADBALANCER_NODE \
--set controller.service.loadBalancerIP="$LOADBALANCER_IP" \
--set controller.extraArgs.default-ssl-certificate="$NAMESPACE/$LOADBALANCER_NODE-ssl"
一般来说,查看 helm 帮助是一个很好的来源:https://helm.sh/docs/intro/using_helm/#the-format-and-limitations-of---set
在这里你可以找到所有的nginx参数:https://github.com/helm/charts/tree/master/stable/nginx-ingress