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

Add the ability to override default registry and set imagePullSecrets #1281

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

burmanm
Copy link
Contributor

@burmanm burmanm commented Apr 12, 2024

… for medusa/reaper/stargate

What this PR does:
Adds two new env variables, DEFAULT_REGISTRY which overrides the default registry used to deploy external images and a IMAGE_PULL_SECRETS that allows to set certain imagePullSecrets always.

The Helm chart already had values for these, .image.registryOverride and .imagePullSecrets[]

Running the following command:

helm template charts/k8ssandra-operator --api-versions=cert-manager.io/v1 --set 'imagePullSecrets={a,b,c}' --set image.registryOverride=localhost:5001

Gives us the following deployment:

        - name: DEFAULT_REGISTRY
          value: "localhost:5001"
        - name: IMAGE_PULL_SECRETS
          value: "a,b,c"

Which issue(s) this PR fixes:
Fixes #1280

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

@burmanm burmanm requested a review from a team as a code owner April 12, 2024 15:59
# allows for usage of an internal registry without specifying serverImage,
# configBuilderImage, and busyboxImage on all CassandraDatacenter objects.
# -- Docker registry containing all k8ssandra-operator related images, such as reaper/medusa/stargate.
# Setting this allows for usage of an internal registry without specifying image on all K8ssandraCluster objects.
registryOverride:
Copy link
Contributor

Choose a reason for hiding this comment

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

[nitpick] I imagine it will be too late to address this since these are pre-existing values, but naming could have been better:

  • image.registry and image.registryOverride: based on names alone it would seem the latter overrides the former, but if I'm following correctly it's more like "registry for the operator image" vs. "registry for the images of the pods created by the operator".
  • image.registryOverride and imagePullSecrets are closely related, yet they live at different levels.

pkg/images/images.go Show resolved Hide resolved
pkg/stargate/deployments.go Show resolved Hide resolved
@burmanm burmanm force-pushed the add_registry_overrides branch from 97dc21e to 71b178f Compare April 15, 2024 06:45
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Contributor

@olim7t olim7t left a comment

Choose a reason for hiding this comment

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

👍 The default is now correctly applied.

@adejanovski adejanovski merged commit 7dbbce7 into k8ssandra:main Apr 15, 2024
58 of 60 checks passed
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.

Allow easy override of the registry and pull secrets
3 participants