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

Create Jenkins credential with pod service account token. #38

Open
sanbornick opened this issue May 7, 2021 · 1 comment
Open

Create Jenkins credential with pod service account token. #38

sanbornick opened this issue May 7, 2021 · 1 comment

Comments

@sanbornick
Copy link

When creating a containerized master a common pattern would be to use the Kubernetes cloud plugin to create dynamic runners in this same cluster and namespace. It would be nice if the token of the service account the pod is running as became a secret text credential in Jenkins so that enabling the Kubernetes cloud plugin for creating runners could be automatic.

@sanbornick
Copy link
Author

sanbornick commented May 10, 2021

We initially missed how to do this with JCasC. Perhaps its worth putting in the examples

secrets.yaml: |
  credentials:
    system:
      domainCredentials:
      - credentials:
        - string:
            description: "Kubernetes service account this Jenkins is running as"
            id: "jenkins-k8s-service-account"
            scope: GLOBAL
            secret: ${readFile:/var/run/secrets/kubernetes.io/serviceaccount/token}

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

No branches or pull requests

1 participant