################################
# Istio-CA cluster-wide
################################
# Service account CA
apiVersion: v1
kind: ServiceAccount
metadata:
  name: istio-ca-service-account
  namespace: {ISTIO_NAMESPACE}
---
# Istio CA watching all namespaces
apiVersion: v1
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: istio-ca
  namespace: {ISTIO_NAMESPACE}
spec:
  replicas: 1
  template:
    metadata:
      labels:
        istio: istio-ca
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      serviceAccountName: istio-ca-service-account
      containers:
      - name: istio-ca
        image: {CA_HUB}/istio-ca:{CA_TAG}
        imagePullPolicy: IfNotPresent
        command: ["/usr/local/bin/istio_ca"]
        args:
          - --istio-ca-storage-namespace={ISTIO_NAMESPACE}
          - --grpc-port=8060
          - --grpc-hostname=istio-ca
          - --self-signed-ca=true
---
