This is related to using kubernetes slaves via the Jenkins Cloud configuration. We use kubeconfig files to authenticate with the API server and we regenerate them daily using a cron job. We successfully update the credentials using groovy code, but the kubernetes-plugin doesn't detect the change and continues to use the old file until it eventually expires. It is behaving like it cached the credential somewhere. Our manual workaround is to go to Manage Jenkins -> Configure System and set the credential to 'none', save, return to Configure system and set it again. If we don't set it to none and just click save or use groovy to do a Jenkins save(), it doesn't reload the credential. This confirms that the credential is correct, but the kubernetes plugin needed some coercion to reload the credential. We would expect the credential change to be detected or the kubernetes plugin should read the file fresh each time it is used.