#
# Copyright (c) 2019 LG Electronics Inc.
# SPDX-License-Identifier: Apache-2.0
#

# apiVersion: v1
# kind: ServiceAccount
# metadata:
#   name: external-dns
# ---
# apiVersion: rbac.authorization.k8s.io/v1
# kind: ClusterRole
# metadata:
#   name: external-dns
# rules:
# - apiGroups: [""]
#   resources: ["services"]
#   verbs: ["get","watch","list"]
# - apiGroups: [""]
#   resources: ["pods"]
#   verbs: ["get","watch","list"]
# - apiGroups: ["extensions"] 
#   resources: ["ingresses"] 
#   verbs: ["get","watch","list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: external-dns-viewer
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: external-dns
subjects:
- kind: ServiceAccount
  name: external-dns
  namespace: default
# ---
# apiVersion: extensions/v1beta1
# kind: Deployment
# metadata:
#   name: external-dns
# spec:
#   strategy:
#     type: Recreate
#   template:
#     metadata:
#       labels:
#         app: external-dns
#     spec:
#       serviceAccountName: external-dns
#       containers:
#       - name: external-dns
#         image: registry.opensource.zalan.do/teapot/external-dns:v0.5.2
#         args:
#         - --source=service
#         - --source=ingress
#         - --domain-filter=datagravity.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
#         - --provider=aws
#         - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
#         - --aws-zone-type=public # only look at public hosted zones (valid values are public, private or no value for both)
#         - --registry=txt
#         - --txt-owner-id=my-identifier