Skip to content

Commit

Permalink
[jenkins] Document k8sCredentials and use tpl function (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Reinhard Nägele <[email protected]>
  • Loading branch information
unguiculus authored May 17, 2019
1 parent efc33c3 commit 338be55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: jenkins
description: The leading open source automation server
version: 1.0.2
version: 1.1.0
appVersion: 2.164.3
home: https://jenkins.io/
icon: https://wiki.jenkins-ci.org/download/attachments/2916393/logo.png
Expand Down
3 changes: 2 additions & 1 deletion charts/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Parameter | Description | Default
`casc.existingSecret` | An existing secret containing casc secrets. If specified, `casc.secrets` is ignored | `{}`
`referenceContent` | Reference content to be copied to `JENKINS_HOME` before startup | `[]`
`forcePluginUpdates` | Specifies whether to update plugins at restart if `referenceContent` contains a `plugins.txt` file | `false`

`k8sCredentials` | Credentials to be configured as Kubernetes secrets (see examples below). | `[]`

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

Expand Down Expand Up @@ -331,6 +331,7 @@ referenceContent:
The chart supports the [kubernetes-credentials-provider-plugin](https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/).
A list of credentials may be configured which are stored as Kubernetes secrets.
The plugin automatially makes these secrets available as credentials in Jenkins.
Note that the individual values are rendered using the `tpl` function.

```yaml
referenceContent:
Expand Down
8 changes: 8 additions & 0 deletions charts/jenkins/ci/k8s-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ k8sCredentials:
data:
username: foo
password: secret
- nameSuffix: text
type: secretText
description: Some username
data:
text: |
ds sdfsd dsfds fsdfdsfs dsf dsf
sdf fdsf dsf fdsfsfsdf sf sd
sdf fsf dsfsf sdfs fsdf f
test:
enabled: true
2 changes: 1 addition & 1 deletion charts/jenkins/templates/secret-credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ metadata:
type: Opaque
data:
{{- range $key, $value := required "Secret .data is required!" .data }}
{{ $key }}: {{ $value | b64enc }}
{{ $key }}: {{ tpl $value $ | b64enc }}
{{- end }}
{{- end }}

0 comments on commit 338be55

Please sign in to comment.