Skip to content

Commit

Permalink
Only add cluster role permissions for enabled sources
Browse files Browse the repository at this point in the history
  • Loading branch information
haines committed Nov 3, 2021
1 parent ab7a965 commit fdcc0d4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions charts/external-dns/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: external-dns
description: ExternalDNS synchronizes exposed Kubernetes Services and Ingresses with DNS providers.
type: application
version: 1.4.1
version: 1.5.0
appVersion: 0.10.1
keywords:
- kubernetes
Expand All @@ -18,4 +18,4 @@ maintainers:
annotations:
artifacthub.io/changes: |
- kind: changed
description: "Update image to v0.10.1"
description: "Cluster role permissions are now only added for enabled sources"
29 changes: 23 additions & 6 deletions charts/external-dns/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ metadata:
labels:
{{- include "external-dns.labels" . | nindent 4 }}
rules:
- apiGroups: [""]
resources: ["services","endpoints","pods"]
verbs: ["get","watch","list"]
{{- if has "ingress" .Values.sources }}
- apiGroups: ["extensions","networking.k8s.io"]
resources: ["ingresses"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list","watch"]
{{- end }}
{{- if has "istio-gateway" .Values.sources }}
- apiGroups: ["networking.istio.io"]
resources: ["gateways"]
Expand All @@ -25,4 +21,25 @@ rules:
resources: ["virtualservices"]
verbs: ["get","watch","list"]
{{- end }}
{{- if has "node" .Values.sources }}
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list","watch"]
{{- end }}
{{- if has "pod" .Values.sources }}
- apiGroups: [""]
resources: ["pods"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list","watch"]
{{- end }}
{{- if has "service" .Values.sources }}
- apiGroups: [""]
resources: ["services","endpoints","pods"]
verbs: ["get","watch","list"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list","watch"]
{{- end }}
{{- end }}

0 comments on commit fdcc0d4

Please sign in to comment.