<p>I am trying to patch <strong>istio-ingressgateway</strong> service with ACM by the following</p>
<pre><code>
kubectl -n istio-system patch service istio-ingressgateway -p &quot;$(cat&lt;&lt;EOF
metadata:
  name: istio-ingressgateway
  namespace: istio-system
annotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: &quot;arn:aws:acm:xx-xxxx-1:123456789:certificate/xxxx-xxx-xxxxxxxxxxx&quot;
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: &quot;tcp&quot;
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: &quot;443&quot;
service.beta.kubernetes.io/aws-load-balancer-internal: &quot;true&quot;
service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: &quot;*&quot;
spec:
  type: LoadBalancer
  externalTrafficPolicy: Cluster
  selector:
    app: istio-ingressgateway
    istio: ingressgateway
EOF
)&quot;

</code></pre>
<p>but it is returning <strong>not patched</strong>. Whats wrong here?</p>

Akash Verma
<p>The problem is the indentation try to put your patch on a yaml file:</p>
<p><strong>ingress_patch.yaml</strong></p>
<pre class="lang-yaml prettyprint-override"><code>metadata:
  name: istio-ingressgateway
  namespace: istio-system
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: &quot;arn:aws:acm:xx-xxxx-1:123456789:certificate/xxxx-xxx-xxxxxxxxxxx&quot;
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: &quot;tcp&quot;
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: &quot;443&quot;
    service.beta.kubernetes.io/aws-load-balancer-internal: &quot;true&quot;
    service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: &quot;*&quot;
spec:
  type: LoadBalancer
  externalTrafficPolicy: Cluster
  selector:
    app: istio-ingressgateway
    istio: ingressgateway
</code></pre>
<p>Then apply it as follows:</p>
<pre><code>kubectl -n istio-system patch service istio-ingressgateway -p &quot;$(cat ./ingress_patch.yaml)&quot;
</code></pre>
