charts icon indicating copy to clipboard operation
charts copied to clipboard

[stable/jenkins] RBAC deployment with Kubernetes plugin does not use the created service account

Open ReSearchITEng opened this issue 9 years ago • 8 comments

**Is this a BUG REPORT

Version of Helm and Kubernetes: helm 2.5.0; k8s: 1.7

Which chart: [stable/jenkins]

What happened: RBAC deployment with Kubernetes plugin does not use the helm chart created service account (SA).

What you expected to happen: be able to use the service account the helm chart created.

I did not find the way to specify to Kubernetes plugin which SA to use. Apparently by default it uses the "default" SA in the specific namespace. While this helm chart creates and gives perms to a different SA

More than this, I could not find a way to point the kubernetes-plugin to a specific k8s service-account. It seems that it's always looking to the default service account for that namespace:

Error connecting to [edited]: Failure executing: GET at: [edited]/api/v1/namespaces/jenkins/pods. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. User "system:serviceaccount:jenkins:default" cannot list pods in the namespace "jenkins".. 

while the helm chart creates a service account like: jenkins-jenkins

@carlosedp @lachie83 I see you checked #1092 maybe you can suggest any hints?

ReSearchITEng avatar Aug 08 '17 10:08 ReSearchITEng

@ReSearchITEng You can configure which service account the workers use by going go to "Manage Jenkings" -> "Configure System" -> "Cloud" -> "Images" -> "Advanced" -> "Service Account".

victortrac avatar Oct 09 '17 19:10 victortrac

As the service-account is created during helm install, it was expected that it will also configure the installation to use it. Maybe in future versions.

ReSearchITEng avatar Oct 12 '17 05:10 ReSearchITEng

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta. /lifecycle stale

fejta-bot avatar Jan 10 '18 06:01 fejta-bot

/lifecycle stale

On Wed, Jan 10, 2018 at 8:01 AM, fejta-bot [email protected] wrote:

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta. /lifecycle stale

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/charts/issues/1643#issuecomment-356508165, or mute the thread https://github.com/notifications/unsubscribe-auth/AG43Mw0HVftkDNqeCtRVE7WTMf6m6uzpks5tJFJBgaJpZM4OwhUz .

ReSearchITEng avatar Jan 11 '18 08:01 ReSearchITEng

Created and set Jenkins creds of type kubernetes Service Account

I tried setting Service Account from pod template,

But unfortunately it did not work, I still go same error. As you can see, its was not using "ci-jenkins" sa account, it was still using "default"

Then I specified service account in pod definition

After the change, It picked up proper service account (ci-jenkins), and helm was able to access required cluster resources.

I'm not sure why this happened.

Any advice ? I don't want to specify service account in pipeline definition.

daveamit avatar Jan 30 '18 06:01 daveamit

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten /remove-lifecycle stale

fejta-bot avatar Mar 01 '18 06:03 fejta-bot

There was such issue with an older version of k8s plugin. I am not aware of this in the last period. Alternatively, you create a namespace for jenkins (if you don't do it already), you can give the required perms to the default service account. This works and there is no need to specify it anywhere.

On Thu, Mar 1, 2018 at 8:59 AM, fejta-bot [email protected] wrote:

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta https://github.com/fejta. /lifecycle rotten /remove-lifecycle stale

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/charts/issues/1643#issuecomment-369495257, or mute the thread https://github.com/notifications/unsubscribe-auth/AG43M2hnzrmCEpcdwlhqr_q4NZ54LWC2ks5tZ5xogaJpZM4OwhUz .

ReSearchITEng avatar Mar 01 '18 08:03 ReSearchITEng

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close

fejta-bot avatar Mar 31 '18 08:03 fejta-bot