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

Use a service account for pull secrets #579

Merged
merged 10 commits into from
Jul 8, 2020

Conversation

carbonin
Copy link
Member

@carbonin carbonin commented Jul 8, 2020

This PR creates a default service account which will be used by any deployment not already using one we define (the orchestrator and, in some cases, httpd, already use a service account to escalate various privileges). Having done that, we can now associate the image pull secret to all the service accounts we create to ensure it is available to all deployments that are created by either the operator or orchestrator.

I think we may want this in Jansa, so I'll probably have to make a separate PR there as master has diverged rather significantly with the CreateOrUpdate changes.

carbonin added 10 commits July 8, 2020 11:45
Also updates the SA using controllerutil.CreateOrUpdate
This will ensure that we're enforcing our desired rbac on the
orchestrator even though it can't be changed through the CR
We know they apply to the orchestrator because we're in an orchestrator
specific function.
OpenShift creates a default pull secret with the service account
so before this change we were fighting with OpenShift by removing
their pull secret and replacing it with ours.

This commit checks to see if there are any other secrets in the SA
and appends ours to the list if it isn't already there.
Specifically add a service account to be used by all components
that don't require one for other reasons.
This way they will all have access to the pull secret if needed
…et name

The workers should be using the common service acount either way
so might as well also use it to get access to the pull secret
@miq-bot
Copy link
Member

miq-bot commented Jul 8, 2020

Checked commits carbonin/manageiq-pods@9a4f39a~...966f161 with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
0 files checked, 0 offenses detected
Everything looks fine. 🍰

@bdunne bdunne merged commit 1ebbeaf into ManageIQ:master Jul 8, 2020
carbonin added a commit to carbonin/manageiq-pods that referenced this pull request Jul 8, 2020
Use a service account for pull secrets
@carbonin carbonin deleted the use_sa_for_pull_secrets branch July 8, 2020 20:31
@simaishi
Copy link
Contributor

simaishi commented Jul 9, 2020

Backported to jansa via #580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants