首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Istio helm配置-ingressgateway端口配置不起作用(或者说是合理的)

Istio helm配置-ingressgateway端口配置不起作用(或者说是合理的)
EN

Stack Overflow用户
提问于 2018-10-22 19:12:52
回答 2查看 971关注 0票数 0

我正在使用helm创建一个带有自定义ingressgateway配置的YML。请参见下面的脚本:

代码语言:javascript
复制
#!/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上迭代

我该怎么做才能正确?

EN

回答 2

Stack Overflow用户

发布于 2018-10-23 02:43:26

问题是用于指定数组变量的Helm语法。你这样做:

代码语言:javascript
复制
--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 \

等等,指定数组成员的索引。

票数 2
EN

Stack Overflow用户

发布于 2019-03-29 18:33:14

我遇到了类似的问题,与其在命令行中添加长参数,不如将其添加到yaml文件中。

代码语言:javascript
复制
helm template $ISTIO_DIR/install/kubernetes/helm/istio \
    --name istio \
    --namespace istio-system > istio-default.yaml

然后,您可以编辑istio-default.yaml以添加您想要的额外端口,例如

代码语言:javascript
复制
# 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

现在可以在系统中创建/应用配置。

代码语言:javascript
复制
$ 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安装

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52936284

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档