apiVersion: apps/v1
kind: Deployment
metadata:
  name: istio-cloud-map-operator
  labels:
    app: istio-cloud-map
spec:
  replicas: 1
  selector:
    matchLabels:
      app: istio-cloud-map
  template:
    metadata:
      labels:
        app: istio-cloud-map
    spec:
      serviceAccountName: istio-cloud-map-service-account
      containers:
      - name: istio-cloud-map-server
        image: gcr.io/tetratelabs/istio-cloud-map:v0.2
        imagePullPolicy: Always
        args:
        - serve
        env:
        - name: PUBLISH_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: AWS_REGION
          valueFrom:
            configMapKeyRef:
              key: aws-region
              name: aws-config
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              key: access-key-id
              name: aws-creds
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              key: secret-access-key
              name: aws-creds
