Skip to content

fix: set pod anti affinity for docker-registry deployment and statefulset #1592

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

Closed
wants to merge 2 commits into from

Conversation

supershal
Copy link

What type of PR is this?

Sets pod anti affinity for docker-registry pods and deployments
exposes nodeAffinity configuration for docker-registry.

What this PR does/ why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:
Directly setting soft pod anti affinity on the stateful set to always distribute the pods on different nodes.
This is done directly in templates so that we can use helper template functions in matching labels.

I tested using single and multi CP node kind clusters.

Does this PR introduce a user-facing change?:


Checklist

  • If a chart is changed, the chart version is correctly incremented.
  • The commit message explains the changes and why are needed.
  • The code builds and passes lint/style checks locally.
  • The relevant subset of integration tests pass locally.
  • The core changes are covered by tests.
  • The documentation is updated where needed.

@supershal supershal requested review from a team as code owners June 26, 2025 00:21
@supershal supershal requested a review from dkoshkin June 26, 2025 00:21
@supershal supershal self-assigned this Jun 26, 2025
@@ -94,7 +94,7 @@ their default values.
| `proxy.secretRef` | The ref for an external secret containing the proxyUsername and proxyPassword keys | `""` |
| `namespace` | specify a namespace to install the chart to - defaults to `.Release.Namespace` | `{{ .Release.Namespace }}` |
| `nodeSelector` | node labels for pod assignment | `{}` |
| `affinity` | affinity settings | `{}` |
| `nodeAffinity` | node affinity settings | `{}` |
Copy link
Author

Choose a reason for hiding this comment

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

tolerations and nodeAffinity overrides will be set in CAREN's values.yaml.

{{- end }}
podAntiAffinity:
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't think we can get away without this change and just leave it to the client to set the affinity values directly? This chart already exposes .Values.podLabels that can be used to select.

Making this change deviates us further from the upstream chart and removes existing ability to set podAffinity

Copy link
Author

Choose a reason for hiding this comment

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

The main chart does not use .Values.podLabels. but this patch does.

Can you explain how we apply this patched chart in CAREN?

@supershal
Copy link
Author

As we discussed, we will instead use use matching cluster uuid in the labels and provide that value to the affinity using values.podLabels . closing this PR.

@supershal supershal closed this Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants