-
Notifications
You must be signed in to change notification settings - Fork 0
[don't merge/just review] operator: Add token storage for ingester + make sure PDBs are maxUnavail 1 #1
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
base: main
Are you sure you want to change the base?
[don't merge/just review] operator: Add token storage for ingester + make sure PDBs are maxUnavail 1 #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -103,6 +103,7 @@ func NewIngesterStatefulSet(opts Options) *appsv1.StatefulSet { | |||||
| fmt.Sprintf("-config.file=%s", path.Join(config.LokiConfigMountDir, config.LokiConfigFileName)), | ||||||
| fmt.Sprintf("-runtime-config.file=%s", path.Join(config.LokiConfigMountDir, config.LokiRuntimeConfigFileName)), | ||||||
| "-config.expand-env=true", | ||||||
| fmt.Sprintf("-ingester.tokens-file-path=%s", ingesterTokensFilePath), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (optional: This is less a comment for the purpose of adding this option for a test and more for when we later add it to the operator permanently) We had moved "all" of the configuration to the config file at one point and, for now, I think I would move this option to the configuration file as well. Having everything in the configuration file has its own set of advantages/disadvantages, which I have recently been thinking about again with some new insight, but I would like to make it a conscious decision. For testing the impact of the option on running the ingesters it's fine where it is though 👍 |
||||||
| }, | ||||||
| ReadinessProbe: lokiReadinessProbe(), | ||||||
| LivenessProbe: lokiLivenessProbe(), | ||||||
|
|
@@ -290,16 +291,7 @@ func configureIngesterGRPCServicePKI(sts *appsv1.StatefulSet, opts Options) erro | |||||
| // Ingester pods. | ||||||
| func newIngesterPodDisruptionBudget(opts Options) *policyv1.PodDisruptionBudget { | ||||||
| l := ComponentLabels(LabelIngesterComponent, opts.Name) | ||||||
| rf := DefaultLokiStackSpec(opts.Stack.Size).Replication.Factor | ||||||
| if opts.Stack.Replication != nil && opts.Stack.Replication.Factor != 0 { | ||||||
| rf = opts.Stack.Replication.Factor | ||||||
| } | ||||||
|
|
||||||
| pdbMinAvailable := rf | ||||||
| if pdbMinAvailable >= opts.Stack.Template.Ingester.Replicas { | ||||||
| pdbMinAvailable = max(1, opts.Stack.Template.Ingester.Replicas-1) | ||||||
| } | ||||||
| minAvailable := intstr.FromInt32(pdbMinAvailable) | ||||||
| maxUnavailable := intstr.FromInt32(1) | ||||||
|
|
||||||
| return &policyv1.PodDisruptionBudget{ | ||||||
| TypeMeta: metav1.TypeMeta{ | ||||||
|
|
@@ -315,7 +307,7 @@ func newIngesterPodDisruptionBudget(opts Options) *policyv1.PodDisruptionBudget | |||||
| Selector: &metav1.LabelSelector{ | ||||||
| MatchLabels: l, | ||||||
| }, | ||||||
| MinAvailable: &minAvailable, | ||||||
| MaxUnavailable: &maxUnavailable, | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| }, | ||||||
| } | ||||||
| } | ||||||
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.
I think this can be "modernized" to this (
ptris already used in this file):