本文介绍了Kubectl tls修补程序返回“未修补"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试通过以下方式使用ACM修补 istio-ingressgateway 服务

I am trying to patch istio-ingressgateway service with ACM by the following


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
)"

,但返回的是未修补.怎么了?

but it is returning not patched. Whats wrong here?

推荐答案

问题是缩进尝试将修补程序放在yaml文件上:

The problem is the indentation try to put your patch on a yaml file:

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

然后按如下所示应用它:

Then apply it as follows:

kubectl -n istio-system patch service istio-ingressgateway -p "$(cat ./ingress_patch.yaml)"

这篇关于Kubectl tls修补程序返回“未修补"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 18:38