apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: default
  name: micro-network-dns
  labels:
    micro: runtime
    name: micro-network-dns
spec:
  replicas: 1
  selector:
    matchLabels:
      name: micro-network-dns
      micro: runtime
  template:
    metadata:
      labels:
        name: micro-network-dns
        micro: runtime
    spec:
      containers:
      - name: micro-network-dns
        env:
        - name: MICRO_LOG_LEVEL
          value: "debug"
        - name: MICRO_BROKER
          value: "nats"
        - name: MICRO_BROKER_ADDRESS
          value: "nats-cluster"
        - name: MICRO_REGISTRY
          value: "etcd"
        - name: MICRO_REGISTRY_ADDRESS
          value: "etcd-cluster-client"
        - name: MICRO_NETWORK_DNS_PROVIDER
          value: "cloudflare"
        - name: MICRO_NETWORK_DNS_API_TOKEN
          valueFrom:
            secretKeyRef:
              key: CF_API_TOKEN
              name: cloudflare-credentials
        - name: MICRO_NETWORK_DNS_ZONE_ID
          valueFrom:
            secretKeyRef:
              key: MICRO_MU_DNS_ZONE_ID
              name: cloudflare-credentials
        - name: MICRO_NETWORK_DNS_TOKEN
          valueFrom:
            secretKeyRef:
              key: DNS_SHARED_SECRET
              name: dns-shared-secret
        image: micro/micro
        imagePullPolicy: Always
        command:
        - /micro
        - network
        - dns
