Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Helm): Update Loki Helm chart for restricted environments #14440

Merged
48 changes: 47 additions & 1 deletion docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4628,7 +4628,10 @@ null
"serviceAnnotations": {},
"serviceLabels": {},
"terminationGracePeriodSeconds": 300,
"tolerations": []
"tolerations": [],
"updateStrategy": {
"type": "RollingUpdate"
}
}
</pre>
</td>
Expand Down Expand Up @@ -4912,6 +4915,26 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>indexGateway.updateStrategy</td>
<td>object</td>
<td>UpdateStrategy for the indexGateway StatefulSet.</td>
<td><pre lang="json">
{
"type": "RollingUpdate"
}
</pre>
</td>
</tr>
<tr>
<td>indexGateway.updateStrategy.type</td>
<td>string</td>
<td>One of 'OnDelete' or 'RollingUpdate'</td>
<td><pre lang="json">
"RollingUpdate"
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -5004,6 +5027,9 @@ null
"whenUnsatisfiable": "ScheduleAnyway"
}
],
"updateStrategy": {
"type": "RollingUpdate"
},
"zoneAwareReplication": {
"enabled": true,
"maxUnavailablePct": 33,
Expand Down Expand Up @@ -5414,6 +5440,26 @@ false
<td><pre lang="">
Defaults to allow skew no more than 1 node
</pre>
</td>
</tr>
<tr>
<td>ingester.updateStrategy</td>
<td>object</td>
<td>UpdateStrategy for the ingester StatefulSets.</td>
<td><pre lang="json">
{
"type": "RollingUpdate"
}
</pre>
</td>
</tr>
<tr>
<td>ingester.updateStrategy.type</td>
<td>string</td>
<td>One of 'OnDelete' or 'RollingUpdate'</td>
<td><pre lang="json">
"RollingUpdate"
</pre>
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Find more information in the Loki Helm Chart [documentation](https://grafana.com

## Contributing and releasing

If you made any changes to the [Chart.yaml](https://github.com/grafana/loki/blob/main/production/helm/loki/Chart.yaml) or [values.yaml](https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml) run `make helm-doc` from the root of the repository to update the documentation and commit the changed files.
If you made any changes to the [Chart.yaml](https://github.com/grafana/loki/blob/main/production/helm/loki/Chart.yaml) or [values.yaml](https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml) run `make helm-docs` from the root of the repository to update the documentation and commit the changed files.

#### Versioning

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ metadata:
{{- end }}
spec:
replicas: {{ .Values.indexGateway.replicas }}
{{- with .Values.indexGateway.updateStrategy }}
updateStrategy:
rollingUpdate:
partition: 0
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
serviceName: {{ include "loki.indexGatewayFullname" . }}-headless
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.indexGateway.persistence.enableStatefulSetAutoDeletePVC) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
{{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
name: ingester-zone-a
rollout-group: ingester
{{- with .Values.ingester.updateStrategy }}
updateStrategy:
type: OnDelete
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
template:
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
{{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
name: ingester-zone-b
rollout-group: ingester
{{- with .Values.ingester.updateStrategy }}
updateStrategy:
type: OnDelete
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
template:
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
{{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
name: ingester-zone-c
rollout-group: ingester
{{- with .Values.ingester.updateStrategy }}
updateStrategy:
type: OnDelete
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
template:
metadata:
annotations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ spec:
replicas: {{ .Values.ingester.replicas }}
{{- end }}
podManagementPolicy: Parallel
{{- with .Values.ingester.updateStrategy }}
updateStrategy:
rollingUpdate:
partition: 0
{{- tpl (. | toYaml) $ | nindent 4 }}
{{- end }}
serviceName: {{ include "loki.ingesterFullname" . }}-headless
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if and (and .Values.enterprise.tokengen.enabled .Values.enterprise.enabled) (not .Values.rbac.namespaced)}}
{{ if and .Values.enterprise.tokengen.enabled .Values.enterprise.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
kind: {{ if not .Values.rbac.namespaced }}Cluster{{ end }}Role
metadata:
DylanGuedes marked this conversation as resolved.
Show resolved Hide resolved
name: {{ template "enterprise-logs.tokengenFullname" . }}
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if and (and .Values.enterprise.tokengen.enabled .Values.enterprise.enabled) (not .Values.rbac.namespaced)}}
{{ if and .Values.enterprise.tokengen.enabled .Values.enterprise.enabled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: {{ if not .Values.rbac.namespaced }}Cluster{{ end }}RoleBinding
metadata:
DylanGuedes marked this conversation as resolved.
Show resolved Hide resolved
name: {{ template "enterprise-logs.tokengenFullname" . }}
labels:
Expand All @@ -16,7 +16,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.tokengenFullname" . }}
DylanGuedes marked this conversation as resolved.
Show resolved Hide resolved
subjects:
- kind: ServiceAccount
Expand Down
14 changes: 14 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1796,6 +1796,13 @@ ingester:
readinessProbe: {}
# -- liveness probe settings for ingester pods. If empty use `loki.livenessProbe`
livenessProbe: {}
# -- UpdateStrategy for the ingester StatefulSets.
updateStrategy:
# -- One of 'OnDelete' or 'RollingUpdate'
type: RollingUpdate
# -- Optional for updateStrategy.type=RollingUpdate. See [Partitioned rolling updates](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions) in the StatefulSet docs for details.
# rollingUpdate:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you specify a spec.updateStrategy.rollingUpdate block in values.yaml, you have to null it out if you want to set spec.updateStrategy.type=OnDelete. But I think partition: 0 is a no-op in any case.

# partition: 0
persistence:
# -- Enable creating PVCs which is required when using boltdb-shipper
enabled: false
Expand Down Expand Up @@ -2313,6 +2320,13 @@ indexGateway:
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
appProtocol:
grpc: ""
# -- UpdateStrategy for the indexGateway StatefulSet.
updateStrategy:
# -- One of 'OnDelete' or 'RollingUpdate'
type: RollingUpdate
# -- Optional for updateStrategy.type=RollingUpdate. See [Partitioned rolling updates](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions) in the StatefulSet docs for details.
# rollingUpdate:
# partition: 0
# -- Configuration for the compactor
compactor:
# -- Number of replicas for the compactor
Expand Down
Loading