我正在使用helm创建一个带有自定义ingressgateway配置的YML。请参见下面的脚本:
#!/usr/bin/env bash
helm template $ISTIO_DIR/install/kubernetes/helm/istio \
--name istio \
--namespace istio-system \
--set gateways.istio-ingressgateway.type=NodePort \
--set gateways.istio-ingressgateway.enabled=true \
--set gateways.istio-ingressgateway.replicaCount=1 \
--set gateways.istio-ingressgateway.ports.targetPort=80 \
--set gateways.istio-ingressgateway.ports.name=http2 \
--set gateways.istio-ingressgateway.ports.nodePort=30000 \
\
--set gateways.istio-ingressgateway.ports.targetPort=443 \
--set gateways.istio-ingressgateway.ports.name=https \
--set gateways.istio-ingressgateway.ports.nodePort=30443 \
\
--set gateways.istio-ingressgateway.ports.targetPort=31400 \
--set gateways.istio-ingressgateway.ports.name=tcp \
--set gateways.istio-ingressgateway.ports.nodePort=31400 \
\
--set gateways.istio-ingressgateway.ports.targetPort=15011 \
--set gateways.istio-ingressgateway.ports.name=tcp-pilot-grpc-tls \
--set gateways.istio-ingressgateway.ports.nodePort=32460 \
\
--set gateways.istio-ingressgateway.ports.targetPort=8060 \
--set gateways.istio-ingressgateway.ports.name=tcp-citadel-grpc-tls \
--set gateways.istio-ingressgateway.ports.nodePort=32027 \
\
--set gateways.istio-ingressgateway.ports.targetPort=15030 \
--set gateways.istio-ingressgateway.ports.name=http2-prometheus \
--set gateways.istio-ingressgateway.ports.nodePort=31926 \
\
--set gateways.istio-ingressgateway.ports.targetPort=15031 \
--set gateways.istio-ingressgateway.ports.name=http2-grafana \
--set gateways.istio-ingressgateway.ports.nodePort=31336 \
> eraseme.yaml但我知道这个错误:
2018/10/22 12:04:54警告:港口的目的地是一张表。忽略非表值[mapnodePort:31380端口:80name:http2 mapname:https nodePort:31390端口:443 mapname:tcp nodePort:31400端口:31400 mapport:15011 table port:15011 name:tcp-pilot-grpc-tls mapname:tcp-citadel-grpc端口:8060目标端口:8060 mapname:tcp-dns-tls端口:853个目标端口:853 mapname:http2-prometheus端口:15030 ports :15030 mapname:p2-grafana端口:15031塔吉特端口:15031]/10/22:04:54:目的地端口警告。忽略非表值[mapname:http2 2 nodePort:31380端口:80目标端口:80 mapname:https nodePort:31390端口:443 mapname:tcp nodePort:31400端口:31400 mapname:tcp-实验性-grpc-tls端口:15011":istio/charts/gateways/templates/service.yaml:32:32::在: range上执行"istio/charts/gateways/templates/service.yaml“不能在http2-grafana上迭代
我该怎么做才能正确?
发布于 2018-10-23 02:43:26
问题是用于指定数组变量的Helm语法。你这样做:
--set gateways.istio-ingressgateway.ports[0].targetPort=80 \
--set gateways.istio-ingressgateway.ports[0].name=http2 \
--set gateways.istio-ingressgateway.ports[0].nodePort=30000 \
\
--set gateways.istio-ingressgateway.ports[1].targetPort=443 \
--set gateways.istio-ingressgateway.ports[1].name=https \
--set gateways.istio-ingressgateway.ports[1].nodePort=30443 \等等,指定数组成员的索引。
发布于 2019-03-29 18:33:14
我遇到了类似的问题,与其在命令行中添加长参数,不如将其添加到yaml文件中。
helm template $ISTIO_DIR/install/kubernetes/helm/istio \
--name istio \
--namespace istio-system > istio-default.yaml然后,您可以编辑istio-default.yaml以添加您想要的额外端口,例如
# istio-default.yaml (tips: search 31380 to locate this segment)
-
name: http2
nodePort: 31380
port: 80
targetPort: 80
# below is customized port for flask app for example
-
name: http-flask
nodePort: 31500
port: 5000
targetPort: 5000现在可以在系统中创建/应用配置。
$ kubectl create -f istio-default.yaml
$ kubectl get svc istio-ingressgateway -n istio-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
istio-ingressgateway LoadBalancer 10.111.192.149 <pending> 80:31380/TCP,5000:31500/TCP,443:31390/TCP,31400:31400/TCP,15029:32630/TCP,15030:31878/TCP,15031:30152/TCP,15032:32060/TCP,15443:31852/TCP,15020:32235/TCP 8m26s这也是在istio安装之后添加/删除端口的好方法。
有关istio安装的更多信息,请参见选项1:通过Helm模板使用helm安装
https://stackoverflow.com/questions/52936284
复制相似问题