Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[k8s-image-swapper]: chart clusterrole out of sync with 1.1.0 app version #48

Closed
KhrisRichardson-BO opened this issue Oct 28, 2021 · 4 comments

Comments

@KhrisRichardson-BO
Copy link
Contributor

I believe 1.1.0 introduced the mutation of service accounts with image pull secrets, but the clusterrole in the chart doesn't yet reflect the new rules required.

Would it be possible to add a flag to toggle the service account mutation behavior?

Thanks

@estahn
Copy link
Owner

estahn commented Oct 28, 2021

Hi @KhrisRichardson-BO, I assume you're referring to support for imagePullSecrets via service accounts. Can you describe the issue and what rules you're referring to? If something is missing we can certainly add it.

You're probably already aware, but just to be sure, the flag secretReader.enabled needs to be set to true.

@KhrisRichardson-BO
Copy link
Contributor Author

This is the type of error we are seeing, with secretReader.enabled set to false by design.

7:00PM ERR github.com/estahn/k8s-image-swapper@v1.1.0/pkg/secrets/kubernetes.go:75 > error fetching referenced service account, continue without service account imagePullSecrets error="serviceaccounts \"management-us-east-1-cert-manager-us-east-1-cainjector\" is forbidden: User \"system:serviceaccount:k8s-image-swapper:k8s-image-swapper\" cannot get resource \"serviceaccounts\" in API group \"\" in the namespace \"cert-manager\""

There are no rules related to service accounts in the clusterrole. It may be possible that I need to file an additional issue in the k8s-image-swapper repository if that logic should only be applicable when secretReader is enabled.

@estahn
Copy link
Owner

estahn commented Nov 1, 2021

@KhrisRichardson-BO I see, that makes sense. I wonder if we should have a serviceAccountReader 🤔

I don't think you need to adjust anything in k8s-image-swapper itself. It's purely a permission issue of the clusterrole.

@estahn
Copy link
Owner

estahn commented Nov 1, 2021

@estahn estahn closed this as completed Nov 1, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants