Skip to content

Commit

Permalink
Merge pull request #1356 from ishankhare07/fix-clusterrole-cross-vclu…
Browse files Browse the repository at this point in the history
…ster-coredns

create clusterrole and pod permissions when coredns plugin enabled
  • Loading branch information
FabianKramm authored Nov 16, 2023
2 parents 1f8d1bc + 3542ff2 commit 5ec0550
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 4 deletions.
3 changes: 2 additions & 1 deletion charts/eks/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ Whether to create a cluster role or not
.Values.sync.priorityclasses.enabled
.Values.sync.volumesnapshots.enabled
.Values.proxy.metricsServer.nodes.enabled
.Values.multiNamespaceMode.enabled -}}
.Values.multiNamespaceMode.enabled
.Values.coredns.plugin.enabled -}}
{{- true -}}
{{- end -}}
{{- end -}}
Expand Down
5 changes: 5 additions & 0 deletions charts/eks/templates/rbac/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ rules:
resources: [ "pods", "nodes/metrics", "nodes/stats"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if .Values.coredns.plugin.enabled }}
- apiGroups: [""]
resources: [ "pods"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if and (or .Values.sync.nodes.enabled .Values.rbac.clusterRole.create) (or (not .Values.isolation.enabled) (and .Values.isolation.nodeProxyPermission.enabled .Values.isolation.enabled)) }}
- apiGroups: [""]
resources: ["nodes/proxy"]
Expand Down
3 changes: 2 additions & 1 deletion charts/k0s/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ Whether to create a cluster role or not
.Values.sync.priorityclasses.enabled
.Values.sync.volumesnapshots.enabled
.Values.proxy.metricsServer.nodes.enabled
.Values.multiNamespaceMode.enabled -}}
.Values.multiNamespaceMode.enabled
.Values.coredns.plugin.enabled -}}
{{- true -}}
{{- end -}}
{{- end -}}
Expand Down
5 changes: 5 additions & 0 deletions charts/k0s/templates/rbac/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ rules:
resources: [ "pods", "nodes/metrics", "nodes/stats"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if .Values.coredns.plugin.enabled }}
- apiGroups: [""]
resources: [ "pods"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if and (or .Values.sync.nodes.enabled .Values.rbac.clusterRole.create) (or (not .Values.isolation.enabled) (and .Values.isolation.nodeProxyPermission.enabled .Values.isolation.enabled)) }}
- apiGroups: [""]
resources: ["nodes/proxy"]
Expand Down
3 changes: 2 additions & 1 deletion charts/k3s/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ Whether to create a cluster role or not
.Values.sync.priorityclasses.enabled
.Values.sync.volumesnapshots.enabled
.Values.proxy.metricsServer.nodes.enabled
.Values.multiNamespaceMode.enabled -}}
.Values.multiNamespaceMode.enabled
.Values.coredns.plugin.enabled -}}
{{- true -}}
{{- end -}}
{{- end -}}
Expand Down
5 changes: 5 additions & 0 deletions charts/k3s/templates/rbac/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ rules:
resources: [ "pods", "nodes/metrics", "nodes/stats"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if .Values.coredns.plugin.enabled }}
- apiGroups: [""]
resources: [ "pods"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if and (or .Values.sync.nodes.enabled .Values.rbac.clusterRole.create) (or (not .Values.isolation.enabled) (and .Values.isolation.nodeProxyPermission.enabled .Values.isolation.enabled)) }}
- apiGroups: [""]
resources: ["nodes/proxy"]
Expand Down
3 changes: 2 additions & 1 deletion charts/k8s/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ Whether to create a cluster role or not
.Values.sync.priorityclasses.enabled
.Values.sync.volumesnapshots.enabled
.Values.proxy.metricsServer.nodes.enabled
.Values.multiNamespaceMode.enabled -}}
.Values.multiNamespaceMode.enabled
.Values.coredns.plugin.enabled -}}
{{- true -}}
{{- end -}}
{{- end -}}
Expand Down
5 changes: 5 additions & 0 deletions charts/k8s/templates/rbac/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ rules:
resources: [ "pods", "nodes/metrics", "nodes/stats"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if .Values.coredns.plugin.enabled }}
- apiGroups: [""]
resources: [ "pods"]
verbs: ["get", "watch", "list"]
{{- end }}
{{- if and (or .Values.sync.nodes.enabled .Values.rbac.clusterRole.create) (or (not .Values.isolation.enabled) (and .Values.isolation.nodeProxyPermission.enabled .Values.isolation.enabled)) }}
- apiGroups: [""]
resources: ["nodes/proxy"]
Expand Down

0 comments on commit 5ec0550

Please sign in to comment.