How can I use custom client certificate for external service with istio?

后端 未结 2 995
无人及你
无人及你 2020-12-18 11:30

I need to setup mutual tls communication from kubernetes pod to external service. My system is running with istio system.

I found reference about this.

https

2条回答
  •  自闭症患者
    2020-12-18 11:39

    I found solution.

    1. create secret or config map
    kubectl create secret generic my-cert --from-file=cert1.crt --from-file=cert2.crt
    
    1. annotate pod or deployment with sidecar.istio.io/userVolumeMount, sidecar.istio.io/userVolume
    annotations:                                                                                       
      sidecar.istio.io/userVolumeMount: '[{"name":"my-cert", "mountPath":"/etc/my-cert", "readonly":true}]'
      sidecar.istio.io/userVolume: '[{"name":"my-cert", "secret":{"secretName":"my-cert"}}]'
    

    Documentation on these and other annotations: https://preliminary.istio.io/docs/reference/config/annotations/

    Done. It's mounted to envoy proxy pod.

提交回复
热议问题