Skip to content

Commit 8c8556d

Browse files
committed
moved JCasC configuration to the top
Signed-off-by: Torsten Walter <[email protected]>
1 parent 82c4409 commit 8c8556d

File tree

1 file changed

+49
-48
lines changed

1 file changed

+49
-48
lines changed

charts/jenkins/README.md

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,55 @@ $ helm inspect values jenkinsci/jenkins
7070

7171
For a summary of all configurable options, see [VALUES_SUMMARY.md](./VALUES_SUMMARY.md)
7272

73+
### Configuration as Code
74+
75+
Jenkins Configuration as Code is now a standard component in the Jenkins project.
76+
Add a key under configScripts for each configuration area, where each corresponds to a plugin or section of the UI.
77+
The keys (prior to `|` character) are just labels, and can be any value.
78+
They are only used to give the section a meaningful name.
79+
The only restriction is they must conform to RFC 1123 definition of a DNS label, so they may only contain lowercase letters, numbers, and hyphens.
80+
Each key will become the name of a configuration yaml file on the master in /var/jenkins_home/casc_configs (by default) and will be processed by the Configuration as Code Plugin during Jenkins startup.
81+
The lines after each `|` become the content of the configuration yaml file.
82+
The first line after this is a JCasC root element, e.g. jenkins, credentials, etc.
83+
Best reference is the Documentation link here: `https://<jenkins_url>/configuration-as-code`.
84+
The example below creates ldap settings:
85+
86+
```yaml
87+
configScripts:
88+
ldap-settings: |
89+
jenkins:
90+
securityRealm:
91+
ldap:
92+
configurations:
93+
- server: ldap.acme.com
94+
rootDN: dc=acme,dc=uk
95+
managerPasswordSecret: ${LDAP_PASSWORD}
96+
groupMembershipStrategy:
97+
fromUserRecord:
98+
attributeName: "memberOf"
99+
```
100+
101+
Further JCasC examples can be found [here](https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos).
102+
103+
#### Config as Code With or Without Auto-Reload
104+
105+
Config as Code changes (to `master.JCasC.configScripts`) can either force a new pod to be created and only be applied at next startup, or can be auto-reloaded on-the-fly.
106+
If you set `master.sidecars.autoConfigReload.enabled` to `true`, a second, auxiliary container will be installed into the Jenkins master pod, known as a "sidecar".
107+
This watches for changes to configScripts, copies the content onto the Jenkins file-system and issues a POST to `http://<jenkins_url>/reload-configuration-as-code` with a pre-shared key.
108+
You can monitor this sidecar's logs using command `kubectl logs <master_pod> -c jenkins-sc-config -f`.
109+
If you want to enable auto-reload then you also need to configure rbac as the container which triggers the reload needs to watch the config maps:
110+
111+
```yaml
112+
master:
113+
JCasC:
114+
enabled: true
115+
sidecars:
116+
configAutoReload:
117+
enabled: true
118+
rbac:
119+
create: true
120+
```
121+
73122
### Allow Limited HTML Markup in User-Submitted Text
74123
Some third-party systems (e.g. GitHub) use HTML-formatted data in their payload sent to a Jenkins webhook (e.g. URL of a pull-request being built).
75124
To display such data as processed HTML instead of raw text set `master.enableRawHtmlMarkupFormatter` to true.
@@ -161,54 +210,6 @@ It is possible to define which storage class to use, by setting `persistence.sto
161210
If set to a dash (`-`), dynamic provisioning is disabled.
162211
If the storage class is set to null or left undefined (`""`), the default provisioner is used (gp2 on AWS, standard on GKE, AWS & OpenStack).
163212

164-
### Configuration as Code
165-
166-
Jenkins Configuration as Code is now a standard component in the Jenkins project.
167-
Add a key under configScripts for each configuration area, where each corresponds to a plugin or section of the UI.
168-
The keys (prior to `|` character) are just labels, and can be any value.
169-
They are only used to give the section a meaningful name.
170-
The only restriction is they must conform to RFC 1123 definition of a DNS label, so they may only contain lowercase letters, numbers, and hyphens.
171-
Each key will become the name of a configuration yaml file on the master in /var/jenkins_home/casc_configs (by default) and will be processed by the Configuration as Code Plugin during Jenkins startup.
172-
The lines after each `|` become the content of the configuration yaml file.
173-
The first line after this is a JCasC root element, e.g. jenkins, credentials, etc.
174-
Best reference is the Documentation link here: `https://<jenkins_url>/configuration-as-code`.
175-
The example below creates ldap settings:
176-
177-
```yaml
178-
configScripts:
179-
ldap-settings: |
180-
jenkins:
181-
securityRealm:
182-
ldap:
183-
configurations:
184-
- server: ldap.acme.com
185-
rootDN: dc=acme,dc=uk
186-
managerPasswordSecret: ${LDAP_PASSWORD}
187-
groupMembershipStrategy:
188-
fromUserRecord:
189-
attributeName: "memberOf"
190-
```
191-
192-
Further JCasC examples can be found [here](https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos).
193-
194-
#### Config as Code With or Without Auto-Reload
195-
196-
Config as Code changes (to `master.JCasC.configScripts`) can either force a new pod to be created and only be applied at next startup, or can be auto-reloaded on-the-fly.
197-
If you set `master.sidecars.autoConfigReload.enabled` to `true`, a second, auxiliary container will be installed into the Jenkins master pod, known as a "sidecar".
198-
This watches for changes to configScripts, copies the content onto the Jenkins file-system and issues a POST to `http://<jenkins_url>/reload-configuration-as-code` with a pre-shared key.
199-
You can monitor this sidecar's logs using command `kubectl logs <master_pod> -c jenkins-sc-config -f`.
200-
If you want to enable auto-reload then you also need to configure rbac as the container which triggers the reload needs to watch the config maps:
201-
202-
```yaml
203-
master:
204-
JCasC:
205-
enabled: true
206-
sidecars:
207-
configAutoReload:
208-
enabled: true
209-
rbac:
210-
create: true
211-
```
212213

213214
### RBAC
214215

0 commit comments

Comments
 (0)