Skip to content

Commit

Permalink
feat: replace external-dns chart with app-template - add rbac
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Jan 3, 2024
1 parent 28af2e2 commit bcc13c3
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: external-dns-bind
name: &app external-dns-bind
spec:
interval: 30m
chart:
Expand Down Expand Up @@ -87,6 +87,9 @@ spec:
runAsUser: 568
runAsGroup: 568
runAsNonRoot: true
serviceAccount:
create: true
name: *app
service:
main:
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ kind: Kustomization
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml
- ./rbac.yaml
31 changes: 31 additions & 0 deletions kubernetes/main/apps/network/external-dns/app/bind/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-dns-bind
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["services", "endpoints"]
verbs: ["get", "watch", "list"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: external-dns-bind
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns-bind
subjects:
- kind: ServiceAccount
name: external-dns-bind
namespace: network
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: external-dns-cloudflare
name: &app external-dns-cloudflare
spec:
interval: 30m
chart:
Expand Down Expand Up @@ -84,6 +84,9 @@ spec:
runAsUser: 568
runAsGroup: 568
runAsNonRoot: true
serviceAccount:
create: true
name: *app
service:
main:
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ kind: Kustomization
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml
- ./rbac.yaml
34 changes: 34 additions & 0 deletions kubernetes/main/apps/network/external-dns/app/cloudflare/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-dns-cloudflare
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "watch", "list"]
- apiGroups: ["externaldns.k8s.io"]
resources: ["dnsendpoints"]
verbs: ["get","watch","list"]
- apiGroups: ["externaldns.k8s.io"]
resources: ["dnsendpoints/status"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: external-dns-cloudflare
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns-cloudflare
subjects:
- kind: ServiceAccount
name: external-dns-cloudflare
namespace: network
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: external-dns-bind
name: &app external-dns-bind
spec:
interval: 30m
chart:
Expand Down Expand Up @@ -87,6 +87,9 @@ spec:
runAsUser: 568
runAsGroup: 568
runAsNonRoot: true
serviceAccount:
create: true
name: *app
service:
main:
ports:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ kind: Kustomization
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml
- ./rbac.yaml
31 changes: 31 additions & 0 deletions kubernetes/storage/apps/network/external-dns/app/bind/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: external-dns-bind
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list", "watch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "watch", "list"]
- apiGroups: [""]
resources: ["services", "endpoints"]
verbs: ["get", "watch", "list"]
- apiGroups: ["extensions", "networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: external-dns-bind
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: external-dns-bind
subjects:
- kind: ServiceAccount
name: external-dns-bind
namespace: network

0 comments on commit bcc13c3

Please sign in to comment.