diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md index 8b29950054a66..66be7a37e267a 100644 --- a/docs/sources/setup/install/helm/reference.md +++ b/docs/sources/setup/install/helm/reference.md @@ -3075,6 +3075,7 @@ null "enabled": true, "env": [], "extraVolumeMounts": [], + "hookType": "post-install", "image": { "digest": null, "pullPolicy": "IfNotPresent", @@ -3263,6 +3264,7 @@ null "enabled": true, "env": [], "extraVolumeMounts": [], + "hookType": "post-install", "image": { "digest": null, "pullPolicy": "IfNotPresent", diff --git a/production/helm/loki/README.md b/production/helm/loki/README.md index 50524cea02a9f..dd134fb121e07 100644 --- a/production/helm/loki/README.md +++ b/production/helm/loki/README.md @@ -15,7 +15,7 @@ Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, | Repository | Name | Version | |------------|------|---------| | https://charts.min.io/ | minio(minio) | 5.4.0 | -| https://grafana.github.io/helm-charts | grafana-agent-operator(grafana-agent-operator) | 0.5.0 | +| https://grafana.github.io/helm-charts | grafana-agent-operator(grafana-agent-operator) | 0.5.1 | | https://grafana.github.io/helm-charts | rollout_operator(rollout-operator) | 0.23.0 | Find more information in the Loki Helm Chart [documentation](https://grafana.com/docs/loki/next/installation/helm). diff --git a/production/helm/loki/templates/provisioner/job-provisioner.yaml b/production/helm/loki/templates/provisioner/job-provisioner.yaml index 5a6bc063715f4..2609f21d038a5 100644 --- a/production/helm/loki/templates/provisioner/job-provisioner.yaml +++ b/production/helm/loki/templates/provisioner/job-provisioner.yaml @@ -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 diff --git a/production/helm/loki/templates/provisioner/role-provisioner.yaml b/production/helm/loki/templates/provisioner/role-provisioner.yaml index 1335b0f315a5f..4c8121fbacbbe 100644 --- a/production/helm/loki/templates/provisioner/role-provisioner.yaml +++ b/production/helm/loki/templates/provisioner/role-provisioner.yaml @@ -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 }} diff --git a/production/helm/loki/templates/provisioner/rolebinding-provisioner.yaml b/production/helm/loki/templates/provisioner/rolebinding-provisioner.yaml index d87874dc93077..5cd4560ae5c4b 100644 --- a/production/helm/loki/templates/provisioner/rolebinding-provisioner.yaml +++ b/production/helm/loki/templates/provisioner/rolebinding-provisioner.yaml @@ -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 }} @@ -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 diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index b2972178bad85..d9d0e0eda0c4a 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -575,6 +575,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