Kubectl tls 补丁返回“未打补丁”
Kubectl tls patch returning “not patched”
我正在尝试通过以下方式使用 ACM 修补 istio-ingressgateway 服务
kubectl -n istio-system patch service istio-ingressgateway -p "$(cat<<EOF
metadata:
name: istio-ingressgateway
namespace: istio-system
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:xx-xxxx-1:123456789:certificate/xxxx-xxx-xxxxxxxxxxx"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
spec:
type: LoadBalancer
externalTrafficPolicy: Cluster
selector:
app: istio-ingressgateway
istio: ingressgateway
EOF
)"
但它正在返回 未修补。这里有什么问题吗?
问题是缩进尝试将补丁放在 yaml 文件中:
ingress_patch.yaml
metadata:
name: istio-ingressgateway
namespace: istio-system
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:xx-xxxx-1:123456789:certificate/xxxx-xxx-xxxxxxxxxxx"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
spec:
type: LoadBalancer
externalTrafficPolicy: Cluster
selector:
app: istio-ingressgateway
istio: ingressgateway
然后应用如下:
kubectl -n istio-system patch service istio-ingressgateway -p "$(cat ./ingress_patch.yaml)"
我将此作为社区 Wiki 答案发布,以提高知名度。
正如我在评论中提到的,有一个关于 Istio Ingress TLS key management use ACM 的相关 github 问题。
尽管@wolmi 说的是真的,但由于缩进错误,当您尝试结合使用 istio with ELB 和 ACM 时,还有更多问题需要解决。
下面 3 个答案对此进行了详细描述。
特别值得一看,下面有 3 条来自 github 问题的评论。
另外 there 是关于 discuss.istio.io
的帖子
我正在尝试通过以下方式使用 ACM 修补 istio-ingressgateway 服务
kubectl -n istio-system patch service istio-ingressgateway -p "$(cat<<EOF
metadata:
name: istio-ingressgateway
namespace: istio-system
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:xx-xxxx-1:123456789:certificate/xxxx-xxx-xxxxxxxxxxx"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
spec:
type: LoadBalancer
externalTrafficPolicy: Cluster
selector:
app: istio-ingressgateway
istio: ingressgateway
EOF
)"
但它正在返回 未修补。这里有什么问题吗?
问题是缩进尝试将补丁放在 yaml 文件中:
ingress_patch.yaml
metadata:
name: istio-ingressgateway
namespace: istio-system
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:xx-xxxx-1:123456789:certificate/xxxx-xxx-xxxxxxxxxxx"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "443"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"
spec:
type: LoadBalancer
externalTrafficPolicy: Cluster
selector:
app: istio-ingressgateway
istio: ingressgateway
然后应用如下:
kubectl -n istio-system patch service istio-ingressgateway -p "$(cat ./ingress_patch.yaml)"
我将此作为社区 Wiki 答案发布,以提高知名度。
正如我在评论中提到的,有一个关于 Istio Ingress TLS key management use ACM 的相关 github 问题。
尽管@wolmi 说的是真的,但由于缩进错误,当您尝试结合使用 istio with ELB 和 ACM 时,还有更多问题需要解决。
下面 3 个答案对此进行了详细描述。
特别值得一看,下面有 3 条来自 github 问题的评论。
另外 there 是关于 discuss.istio.io
的帖子