apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: sidecarInjectorWebhook
    chart: sidecarInjectorWebhook
    heritage: Tiller
    istio: sidecar-injector
    release: istio
  name: istio-sidecar-injector
  namespace: istio-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sidecarInjectorWebhook
      chart: sidecarInjectorWebhook
      heritage: Tiller
      istio: sidecar-injector
      release: istio
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        app: sidecarInjectorWebhook
        chart: sidecarInjectorWebhook
        heritage: Tiller
        istio: sidecar-injector
        release: istio
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - preference:
              matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - amd64
            weight: 2
          - preference:
              matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - ppc64le
            weight: 2
          - preference:
              matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - s390x
            weight: 2
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - amd64
                - ppc64le
                - s390x
      containers:
      - args:
        - --caCertFile=/etc/istio/certs/root-cert.pem
        - --tlsCertFile=/etc/istio/certs/cert-chain.pem
        - --tlsKeyFile=/etc/istio/certs/key.pem
        - --injectConfig=/etc/istio/inject/config
        - --meshConfig=/etc/istio/config/mesh
        - --healthCheckInterval=2s
        - --healthCheckFile=/health
        image: docker.io/istio/sidecar_injector:1.1.6
        imagePullPolicy: IfNotPresent
        livenessProbe:
          exec:
            command:
            - /usr/local/bin/sidecar-injector
            - probe
            - --probe-path=/health
            - --interval=4s
          initialDelaySeconds: 4
          periodSeconds: 4
        name: sidecar-injector-webhook
        readinessProbe:
          exec:
            command:
            - /usr/local/bin/sidecar-injector
            - probe
            - --probe-path=/health
            - --interval=4s
          initialDelaySeconds: 4
          periodSeconds: 4
        resources:
          requests:
            cpu: 10m
        volumeMounts:
        - mountPath: /etc/istio/config
          name: config-volume
          readOnly: true
        - mountPath: /etc/istio/certs
          name: certs
          readOnly: true
        - mountPath: /etc/istio/inject
          name: inject-config
          readOnly: true
      serviceAccountName: istio-sidecar-injector-service-account
      volumes:
      - configMap:
          name: istio
        name: config-volume
      - name: certs
        secret:
          secretName: istio.istio-sidecar-injector-service-account
      - configMap:
          items:
          - key: config
            path: config
          name: istio-sidecar-injector
        name: inject-config
