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

Keeping the Jenkins agent secret stable #2250

Closed
gaborbernat opened this issue Mar 29, 2023 · 6 comments
Closed

Keeping the Jenkins agent secret stable #2250

gaborbernat opened this issue Mar 29, 2023 · 6 comments
Labels

Comments

@gaborbernat
Copy link

gaborbernat commented Mar 29, 2023

Currently whenever I bootstrap the instance a new jenkins agent secret is generated. How can I make it deterministic? I think this is secrets/jenkins.slaves.JnlpSlaveAgentProtocol.secret that's generated on startup 🤔 Perhaps here https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java#L40

@gaborbernat
Copy link
Author

In the end went with manually provisioning the secrets master.key and jenkins.slaves.JnlpSlaveAgentProtocol.secret, which fixed my problem. The only downside is this needs to happen before starting the bootstrap, otherwise Jenkins would generate this key.

@brokenpip3
Copy link

brokenpip3 commented May 2, 2023

hey @gaborbernat do you mind share how you were able to create the secrets you mentioned before the jenkins start? I'm trying to investigate the options that we have about this issue: jenkinsci/kubernetes-operator#691 (comment) for the jenkins operator and understanding you experience would be great!

@gaborbernat
Copy link
Author

I used some start script to start the Jenkins instance, and done it there.

@brokenpip3
Copy link

brokenpip3 commented May 2, 2023

Thanks for getting back, can you please share at list the snippet? did you manually moved the files or manually create the secrets via groovy/api etc?
I'm asking so we can use the same approach in the operator project, I was not able to find any groovy example for the agent secret or the master key.
Thanks!

@gaborbernat
Copy link
Author

I first started the instance without having the keys. This generates them. Then copied these generated ones going ahead into the right place. Not much else to share 🤔

@brokenpip3
Copy link

Understood, so you moved the files, thanks :)

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

No branches or pull requests

2 participants