externaldns.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: external-dns
  5. ---
  6. apiVersion: rbac.authorization.k8s.io/v1
  7. kind: ClusterRole
  8. metadata:
  9. name: external-dns
  10. rules:
  11. - apiGroups: [""]
  12. resources: ["services"]
  13. verbs: ["get","watch","list"]
  14. - apiGroups: [""]
  15. resources: ["pods"]
  16. verbs: ["get","watch","list"]
  17. - apiGroups: ["extensions","networking.k8s.io"]
  18. resources: ["ingresses"]
  19. verbs: ["get","watch","list"]
  20. - apiGroups: [""]
  21. resources: ["nodes"]
  22. verbs: ["list"]
  23. - apiGroups: [""]
  24. resources: ["endpoints"]
  25. verbs: ["get","watch","list"]
  26. ---
  27. apiVersion: rbac.authorization.k8s.io/v1
  28. kind: ClusterRoleBinding
  29. metadata:
  30. name: external-dns-viewer
  31. roleRef:
  32. apiGroup: rbac.authorization.k8s.io
  33. kind: ClusterRole
  34. name: external-dns
  35. subjects:
  36. - kind: ServiceAccount
  37. name: external-dns
  38. namespace: default
  39. ---
  40. apiVersion: apps/v1
  41. kind: Deployment
  42. metadata:
  43. name: external-dns
  44. spec:
  45. strategy:
  46. type: Recreate
  47. selector:
  48. matchLabels:
  49. app: external-dns
  50. template:
  51. metadata:
  52. labels:
  53. app: external-dns
  54. spec:
  55. serviceAccountName: external-dns
  56. affinity:
  57. nodeAffinity:
  58. preferredDuringSchedulingIgnoredDuringExecution:
  59. - weight: 1
  60. preference:
  61. matchExpressions:
  62. - key: arch
  63. operator: In
  64. values:
  65. - x86
  66. containers:
  67. - name: external-dns
  68. image: registry.k8s.io/external-dns/external-dns:v0.13.5
  69. args:
  70. - --source=service # ingress is also possible
  71. - --domain-filter=dodges.it
  72. - --exclude-target-net=192.168.2.0/24
  73. - --exclude-target-net=2a02:168:47b1:0:47a1:a412:1000:0/112
  74. - --provider=ovh
  75. - --txt-owner-id=k8s-qdii
  76. env:
  77. - name: OVH_APPLICATION_KEY
  78. value: "1b0c23517e7a8cdb"
  79. - name: OVH_APPLICATION_SECRET
  80. value: "16f15776a66a1c873efa4a1e7700c45c"
  81. - name: OVH_CONSUMER_KEY
  82. value: "47ad719c2a809db55717fb1722a082c3"