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 possibillity to use imagePullSecrets #62

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

rwaffen
Copy link
Sponsor Member

@rwaffen rwaffen commented Jul 4, 2023

Add imagePullSecrets to pull images from private registries.
Does not manage the secret itself. only use existing secrets.

First setup control plane, maybe with errors because coredns/kube-proxy cannot be deployed. Then create the secret. Images should then be pulled automatically.

---
k8s::server::resources::image_pull_secrets:
  - name: my-private-registry-secret

@rwaffen rwaffen requested a review from ananace July 4, 2023 14:26
@rwaffen
Copy link
Sponsor Member Author

rwaffen commented Jul 4, 2023

hmm do not understand how the tests work. simply adding imagePullSecrets to the content yaml of kube-proxy does not work. and keys with undef values shouldn't end up in the resource and be filtered. i only know it like this from other modules 🤔

@ananace
Copy link
Member

ananace commented Jul 4, 2023

The tests are verifying the Puppet-generated Kubernetes resources against the fixtures under spec/fixtures/files/resources/kube-proxy{,-older}.yaml, and your change would modify the generated result - it'd add an imagePullSecrets: null to the container definition.

Undefs aren't fully filtered, since they need to go through to work with the merge patch strategy

@rwaffen
Copy link
Sponsor Member Author

rwaffen commented Jul 5, 2023

🤦 oh. i found this yaml yesterday, but i thought (because of the error output) i have to write imagePullSecrets: nil but it's null. With null it works.

Copy link
Member

@ananace ananace left a comment

Choose a reason for hiding this comment

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

It feels like splatting/merging the value - after removing undef - into the pod hash might make the result a little nicer, but that's rather nitpicky of me and definitely not a requirement as long as Kubernetes is happy with getting a literal null instead of it not being defined or the empty array.

@rwaffen rwaffen added the enhancement New feature or request label Jul 5, 2023
@rwaffen rwaffen merged commit 692d63f into voxpupuli:master Jul 5, 2023
3 checks passed
@rwaffen rwaffen deleted the image_pull_secrets branch July 5, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants