如何通过--set在Helm中传递键/值

时间:2019-10-26 17:50:04

标签: kubernetes-helm

我想使用标志--set为值controller.service.labels设置NGINX Ingress Controller:有没有提示如何传递多重键/值参数来达到期望的结果? / p>

--- 
apiVersion: v1
kind: Service
metadata: 
  labels: 
    foo: bar   <<< my controller.service.labels passed via --set
    bizz: buzz <<<
    app: nginx-ingress
    chart: nginx-ingress-1.24.3
    component: controller
    heritage: Tiller
    release: ingress-controller
  name: ingress-controller-nginx-ingress-controller
spec: 
  clusterIP: ""
  ports: 
    - 
      name: http
      port: 80
      protocol: TCP
      targetPort: http
    - 
      name: https
      port: 443
      protocol: TCP
      targetPort: https
  selector: 
    app: nginx-ingress
    component: controller
    release: ingress-controller
  type: NodePort

1 个答案:

答案 0 :(得分:0)

找到了解决方案:)

--set controller.service.labels.foo="bar" \
--set controller.service.labels.bizz="buzz"

轻松自如!