Abstract
Notes related to recent version upgrades.
Upgrade Notes#
To 5.0.0#
controller.image,controller.tag, andcontroller.tagLabelhave been removed. If you want to overwrite the image you now need to configure any or all of:controller.image.registrycontroller.image.repositorycontroller.image.tagcontroller.image.tagLabel
controller.imagePullPolicyhas been removed. If you want to overwrite the pull policy you now need to configurecontroller.image.pullPolicy.controller.sidecars.configAutoReload.imagehas been removed. If you want to overwrite the configAutoReload image you now need to configure any or all of:controller.sidecars.configAutoReload.image.registrycontroller.sidecars.configAutoReload.image.repositorycontroller.sidecars.configAutoReload.image.tag
controller.sidecars.otherhas been renamed tocontroller.sidecars.additionalSidecarContainers.agent.imageandagent.taghave been removed. If you want to overwrite the agent image you now need to configure any or all of:agent.image.repositoryagent.image.tagThe registry can still be overwritten by
agent.jnlpregistry
agent.additionalContainers[*].imagehas been renamed toagent.additionalContainers[*].image.repositoryagent.additionalContainers[*].taghas been renamed toagent.additionalContainers[*].image.tagadditionalAgents.*.imagehas been renamed toadditionalAgents.*.image.repositoryadditionalAgents.*.taghas been renamed toadditionalAgents.*.image.tagadditionalClouds.*.additionalAgents.*.imagehas been renamed toadditionalClouds.*.additionalAgents.*.image.repositoryadditionalClouds.*.additionalAgents.*.taghas been renamed toadditionalClouds.*.additionalAgents.*.image.taghelmtest.bats.imagehas been split up to:helmtest.bats.image.registryhelmtest.bats.image.repositoryhelmtest.bats.image.tag
controller.adminUsernameandcontroller.adminPasswordhave been renamed tocontroller.admin.usernameandcontroller.admin.passwordrespectivelycontroller.adminSecrethas been renamed tocontroller.admin.createSecretbackup.*was unmaintained and has thus been removed. See the following page for alternatives: Kubernetes Backup and Migrations.
To 4.0.0#
Removes automatic remotingSecurity setting when using a container tag older than 2.326 (introduced in 3.11.7). If you’re using a version older than 2.326, you should explicitly set .controller.legacyRemotingSecurityEnabled to true.
To 3.0.0#
Check
securityRealmandauthorizationStrategyand adjust it. Otherwise, your configured users and permissions will be overridden.You need to use helm version 3 as the
Chart.yamlusesapiVersion: v2.All XML configuration options have been removed. In case those are still in use you need to migrate to configuration as code. Upgrade guide to 2.0.0 contains pointers how to do that.
Jenkins is now using a
StatefulSetinstead of aDeploymentterminology has been adjusted that’s also reflected in values.yaml The following values from
values.yamlhave been renamed:master=>controllermaster.useSecurity=>controller.adminSecretmaster.slaveListenerPort=>controller.agentListenerPortmaster.slaveHostPort=>controller.agentListenerHostPortmaster.slaveKubernetesNamespace=>agent.namespacemaster.slaveDefaultsProviderTemplate=>agent.defaultsProviderTemplatemaster.slaveJenkinsUrl=>agent.jenkinsUrlmaster.slaveJenkinsTunnel=>agent.jenkinsTunnelmaster.slaveConnectTimeout=>agent.kubernetesConnectTimeoutmaster.slaveReadTimeout=>agent.kubernetesReadTimeoutmaster.slaveListenerServiceAnnotations=>controller.agentListenerServiceAnnotationsmaster.slaveListenerServiceType=>controller.agentListenerServiceTypemaster.slaveListenerLoadBalancerIP=>controller.agentListenerLoadBalancerIPagent.slaveConnectTimeout=>agent.connectTimeout
Removed values:
master.imageTag: usecontroller.imageandcontroller.taginsteadslave.imageTag: useagent.imageandagent.taginstead
To 2.0.0#
Configuration as Code is now default + container does not run as root anymore.
Configuration as Code new default#
Configuration is done via Jenkins Configuration as Code Plugin by default. That means that changes in values which result in a configuration change are always applied. In contrast, the XML configuration was only applied during the first start and never altered.
- exclamation:
- exclamation:
- exclamation:
Attention:
This also means if you manually altered configuration then this will most likely be reset to what was configured by default.
It also applies to securityRealm and authorizationStrategy as they are also configured using configuration as code.
- exclamation:
- exclamation:
- exclamation:
Image does not run as root anymore#
It’s not recommended to run containers in Kubernetes as root.
❗Attention: If you had not configured a different user before then you need to ensure that your image supports the user and group ID configured and also manually change permissions of all files so that Jenkins is still able to use them.
Summary of updated values#
As version 2.0.0 only updates default values and nothing else it’s still possible to migrate to this version and opt out of some or all new defaults. All you have to do is ensure the old values are set in your installation.
Here we show which values have changed and the previous default values:
controller:
runAsUser: 1000 # was unset before
fsGroup: 1000 # was unset before
JCasC:
enabled: true # was false
defaultConfig: true # was false
sidecars:
configAutoReload:
enabled: true # was false
Migration steps#
Migration instructions heavily depend on your current setup. So think of the list below more as a general guideline of what should be done.
Ensure that the Jenkins image you are using contains a user with ID 1000 and a group with the same ID. That’s the case for
jenkins/jenkins:ltsimage, which the chart uses by defaultMake a backup of your existing installation especially the persistent volume
Ensure that you have the configuration as code plugin installed
Export your current settings via the plugin:
Manage Jenkins->Configuration as Code->Download Configurationprepare your values file for the update e.g. add additional configuration as code setting that you need. The export taken from above might be a good starting point for this. In addition, the demos from the plugin itself are quite useful.
Test drive those setting on a separate installation
Put Jenkins to Quiet Down mode so that it does not accept new jobs
<JENKINS_URL>/quietDownChange permissions of all files and folders to the new user and group ID:
kubectl exec -it <jenkins_pod> -c jenkins /bin/bash chown -R 1000:1000 /var/jenkins_home
Update Jenkins
To 1.0.0#
Breaking changes:
Values have been renamed to follow helm recommended naming conventions so that all variables start with a lowercase letter and words are separated with camelCase
All resources are now using helm recommended standard labels
As a result of the label changes also the selectors of the deployment have been updated. Those are immutable so trying an updated will cause an error like:
Error: Deployment.apps "jenkins" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/component":"jenkins-controller", "app.kubernetes.io/instance":"jenkins"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
In order to upgrade, uninstall the Jenkins Deployment before upgrading: