-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
feat(Helm): Update Loki Helm chart for restricted environments #14440
Conversation
Changed the behavior so that if `.Values.rbac.namespaced` is enabled, it creates a Role instead of a ClusterRole for tokengen.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR ❤️
Asked a few questions below, my only concern with the current approach is that it makes it difficult to configure other attributes (that not the type) and that we're making a small change to the indexGateway strategy and I'm not sure if that is a breaking change or not.
production/helm/loki/templates/index-gateway/statefulset-index-gateway.yaml
Outdated
Show resolved
Hide resolved
updateStrategy: | ||
type: OnDelete | ||
type: {{ .Values.ingester.updateStrategy }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto: could you please make the whole updateStrategy
configurable otherwise users won't be able to set the rollingUpdate
updateStrategy: | ||
type: OnDelete | ||
type: {{ .Values.ingester.updateStrategy }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
updateStrategy: | ||
type: OnDelete | ||
type: {{ .Values.ingester.updateStrategy }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -18,8 +18,7 @@ spec: | |||
{{- end }} | |||
podManagementPolicy: Parallel | |||
updateStrategy: | |||
rollingUpdate: | |||
partition: 0 | |||
type: {{ .Values.ingester.updateStrategy }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
production/helm/loki/templates/tokengen/clusterrolebinding-tokengen.yaml
Show resolved
Hide resolved
production/helm/loki/templates/tokengen/clusterrolebinding-tokengen.yaml
Show resolved
Hide resolved
production/helm/loki/values.yaml
Outdated
@@ -2313,6 +2315,8 @@ indexGateway: | |||
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https" | |||
appProtocol: | |||
grpc: "" | |||
# -- UpdateStrategy for the StatefulSet. One of 'OnDelete' or 'RollingUpdate'. | |||
updateStrategy: RollingUpdate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto: after making the changes to make the updateStrategy configurable, in case setting partition: 0
is different than the default, can you add it to this values.yaml, to not make a breaking change?
This comment has been minimized.
This comment has been minimized.
production/helm/loki/templates/tokengen/clusterrolebinding-tokengen.yaml
Show resolved
Hide resolved
# -- 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: |
There was a problem hiding this comment.
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.
Kubernetes Manifest Diff SummaryScenario: default-single-binary-values (Added: 0, Modified: 4, Removed: 0)
Summary:
Added FilesNo added files Modified Filesloki/templates/index-gateway/statefulset-index-gateway.yaml*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/index-gateway/statefulset-index-gateway.yaml 2024-10-10 10:24:09.264117944 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/index-gateway/statefulset-index-gateway.yaml 2024-10-10 10:24:12.160095354 +0000
***************
*** 14,21 ****
spec:
replicas: 2
updateStrategy:
! rollingUpdate:
! partition: 0
serviceName: loki-test-chart-name-index-gateway-headless
revisionHistoryLimit: 10
selector:
--- 14,20 ----
spec:
replicas: 2
updateStrategy:
! type: RollingUpdate
serviceName: loki-test-chart-name-index-gateway-headless
revisionHistoryLimit: 10
selector: loki/templates/ingester/statefulset-ingester-zone-c.yaml*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/ingester/statefulset-ingester-zone-c.yaml 2024-10-10 10:24:09.264117944 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/ingester/statefulset-ingester-zone-c.yaml 2024-10-10 10:24:12.160095354 +0000
***************
*** 30,36 ****
name: ingester-zone-c
rollout-group: ingester
updateStrategy:
! type: OnDelete
template:
metadata:
annotations:
--- 30,36 ----
name: ingester-zone-c
rollout-group: ingester
updateStrategy:
! type: RollingUpdate
template:
metadata:
annotations: loki/templates/ingester/statefulset-ingester-zone-b.yaml*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/ingester/statefulset-ingester-zone-b.yaml 2024-10-10 10:24:09.264117944 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/ingester/statefulset-ingester-zone-b.yaml 2024-10-10 10:24:12.160095354 +0000
***************
*** 30,36 ****
name: ingester-zone-b
rollout-group: ingester
updateStrategy:
! type: OnDelete
template:
metadata:
annotations:
--- 30,36 ----
name: ingester-zone-b
rollout-group: ingester
updateStrategy:
! type: RollingUpdate
template:
metadata:
annotations: loki/templates/ingester/statefulset-ingester-zone-a.yaml*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/ingester/statefulset-ingester-zone-a.yaml 2024-10-10 10:24:09.264117944 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/ingester/statefulset-ingester-zone-a.yaml 2024-10-10 10:24:12.160095354 +0000
***************
*** 30,36 ****
name: ingester-zone-a
rollout-group: ingester
updateStrategy:
! type: OnDelete
template:
metadata:
annotations:
--- 30,36 ----
name: ingester-zone-a
rollout-group: ingester
updateStrategy:
! type: RollingUpdate
template:
metadata:
annotations: Removed FilesNo removed files Scenario: default-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: ingress-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: legacy-monitoring-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files Scenario: simple-scalable-aws-kube-irsa-values (Added: 0, Modified: 0, Removed: 0)
Summary:
Added FilesNo added files Modified FilesNo modified files Removed FilesNo removed files |
**Statefulsets for ingester and index-gateway** The change here is to make the `spec.updateStrategy.type` configurable, and to default to `RollingUpdate`. **Enterprise tokengen** For this change, if `enterprise` and `tokengen` are enabled, and `rbac.namespaced` is true, the chart will render a `Role` and `RoleBinding`. If `rbac.namespaced` is false, it will render a `ClusterRole` and `ClusterRoleBinding`.
What this PR does / why we need it:
We are attempting to deploy this chart, with Enterprise enabled and in distributed mode, to a restricted k8s environment. The two main restrictions driving this PR are:
With this in mind, I am proposing the following changes:
Statefulsets for ingester and index-gateway
The change here is to make the
spec.updateStrategy.type
configurable, and to default toRollingUpdate
.Enterprise tokengen
For this change, if
enterprise
andtokengen
are enabled, andrbac.namespaced
is true, the chart will render aRole
andRoleBinding
. Ifrbac.namespaced
is false, it will render aClusterRole
andClusterRoleBinding
.Which issue(s) this PR fixes:
n/a
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR