apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: istio-mixer
    istio: mixer
  name: istio-policy
  namespace: istio-system
spec:
  selector:
    matchLabels:
      istio: mixer
      istio-mixer-type: policy
  strategy:
    rollingUpdate:
      maxSurge: 100%
      maxUnavailable: 25%
  template:
    metadata:
      annotations:
        sidecar.istio.io/inject: "false"
      labels:
        app: policy
        istio: mixer
        istio-mixer-type: policy
    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:
        - --monitoringPort=15014
        - --address
        - unix:///sock/mixer.socket
        - --log_output_level=default:info
        - --configStoreURL=mcps://istio-galley.istio-system.svc:9901
        - --configDefaultNamespace=istio-system
        - --useAdapterCRDs=false
        - --useTemplateCRDs=false
        - --trace_zipkin_url=http://zipkin.istio-system:9411/api/v1/spans
        env:
        - name: GODEBUG
          value: gctrace=1
        - name: GOMAXPROCS
          value: "6"
        image: gcr.io/istio-release/mixer:release-1.3-latest-daily
        imagePullPolicy: IfNotPresent
        livenessProbe:
          httpGet:
            path: /version
            port: 15014
          initialDelaySeconds: 5
          periodSeconds: 5
        name: mixer
        ports:
        - containerPort: 15014
        - containerPort: 42422
        resources:
          requests:
            cpu: 10m
        volumeMounts:
        - mountPath: /etc/certs
          name: istio-certs
          readOnly: true
        - mountPath: /sock
          name: uds-socket
      - args:
        - proxy
        - --domain
        - $(POD_NAMESPACE).svc.cluster.local
        - --serviceCluster
        - istio-policy
        - --templateFile
        - /etc/istio/proxy/envoy_policy.yaml.tmpl
        - --controlPlaneAuthPolicy
        - MUTUAL_TLS
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: INSTANCE_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.podIP
        - name: SDS_ENABLED
          value: "true"
        image: gcr.io/istio-release/proxyv2:release-1.3-latest-daily
        imagePullPolicy: IfNotPresent
        name: istio-proxy
        ports:
        - containerPort: 9091
        - containerPort: 15004
        - containerPort: 15090
          name: http-envoy-prom
          protocol: TCP
        resources:
          limits:
            cpu: 2000m
            memory: 1024Mi
          requests:
            cpu: 100m
            memory: 128Mi
        volumeMounts:
        - mountPath: /etc/certs
          name: istio-certs
          readOnly: true
        - mountPath: /var/run/sds
          name: sds-uds-path
          readOnly: true
        - mountPath: /var/run/secrets/tokens
          name: istio-token
        - mountPath: /sock
          name: uds-socket
        - mountPath: /var/run/secrets/istio.io/policy/adapter
          name: policy-adapter-secret
          readOnly: true
      serviceAccountName: istio-mixer-service-account
      volumes:
      - name: istio-certs
        secret:
          optional: true
          secretName: istio.istio-mixer-service-account
      - hostPath:
          path: /var/run/sds
        name: sds-uds-path
      - name: istio-token
        projected:
          sources:
          - serviceAccountToken:
              audience: istio-ca
              expirationSeconds: 43200
              path: istio-token
      - name: uds-socket
      - name: policy-adapter-secret
        secret:
          optional: true
          secretName: policy-adapter-secret
