---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: coturn-dns
spec:
  replicas: 1
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 1
  selector:
    matchLabels:
      app: coturn-dns
  template:
    metadata:
      labels:
        app: coturn-dns
    spec:
      imagePullSecrets:
        - name: gcr-json-key
      containers:
        - name: coturn-dns
          image: gcr.io/tough-craft-276813/coturn-dns:{{ .Values.coturn_dns_image_tag }}
          imagePullPolicy: Always
          env:
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                name: aws-user-coturn-dns
                key: username
          - name: AWS_SECRET_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                name: aws-user-coturn-dns
                key: password
          - name: PYTHONUNBUFFERED
            value: "1"
          - name: HOSTED_ZONE
            value: "Z00156242SK162FEXDPVF"
          - name: COTURN_DOMAIN_NAME
            value: coturn.{{ .Values.domain }}
          resources:
            requests:
              memory: 128Mi
            limits:
              memory: 128Mi
