Skip to content

Commit

Permalink
feat(helm): Allow provisioner to be namespaced (#16091)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Brady <[email protected]>
  • Loading branch information
rbrady authored and salvacorts committed Feb 12, 2025
1 parent c427a0c commit 40458f9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
11 changes: 11 additions & 0 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3075,6 +3075,7 @@ null
"enabled": true,
"env": [],
"extraVolumeMounts": [],
"hookType": "post-install",
"image": {
"digest": null,
"pullPolicy": "IfNotPresent",
Expand Down Expand Up @@ -3263,6 +3264,7 @@ null
"enabled": true,
"env": [],
"extraVolumeMounts": [],
"hookType": "post-install",
"image": {
"digest": null,
"pullPolicy": "IfNotPresent",
Expand Down Expand Up @@ -3337,6 +3339,15 @@ true
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>enterprise.provisioner.hookType</td>
<td>string</td>
<td>Hook type(s) to customize when the job runs. defaults to post-install</td>
<td><pre lang="json">
"post-install"
</pre>
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
{{- with .Values.enterprise.provisioner.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
"helm.sh/hook": post-install
"helm.sh/hook": {{ .Values.enterprise.provisioner.hookType | default "post-install" | quote }}
"helm.sh/hook-weight": "15"
spec:
backoffLimit: 6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ if and (and .Values.enterprise.provisioner.enabled .Values.enterprise.enabled) (not .Values.rbac.namespaced)}}
{{ if and .Values.enterprise.provisioner.enabled .Values.enterprise.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: {{ if not .Values.rbac.namespaced }}Cluster{{ end }}Role
metadata:
name: {{ template "enterprise-logs.provisionerFullname" . }}
namespace: {{ $.Release.Namespace }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if and (and .Values.enterprise.provisioner.enabled .Values.enterprise.enabled) (not .Values.rbac.namespaced)}}
{{ if and .Values.enterprise.provisioner.enabled .Values.enterprise.enabled}}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: {{ if not .Values.rbac.namespaced }}Cluster{{ else }}Role{{ end }}Binding
metadata:
name: {{ template "enterprise-logs.provisionerFullname" . }}
namespace: {{ $.Release.Namespace }}
Expand All @@ -17,7 +17,7 @@ metadata:
"helm.sh/hook": post-install
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
kind: {{ if not .Values.rbac.namespaced }}Cluster{{ end }}Role
name: {{ template "enterprise-logs.provisionerFullname" . }}
subjects:
- kind: ServiceAccount
Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ enterprise:
enabled: true
# -- Name of the secret to store provisioned tokens in
provisionedSecretPrefix: null
# -- Hook type(s) to customize when the job runs. defaults to post-install
hookType: "post-install"
# -- Additional tenants to be created. Each tenant will get a read and write policy
# and associated token. Tenant must have a name and a namespace for the secret containting
# the token to be created in. For example
Expand Down

0 comments on commit 40458f9

Please sign in to comment.