From b7b9199da9c60657cf2f7094f7674197e1be27b8 Mon Sep 17 00:00:00 2001 From: jdrios Date: Thu, 11 Aug 2016 17:27:28 +0200 Subject: [PATCH 1/3] Added Jenkins Chart --- jenkins/Chart.yaml | 10 ++++ jenkins/README.md | 66 ++++++++++++++++++++++++++ jenkins/manifests/jenkins-rc.yaml | 57 ++++++++++++++++++++++ jenkins/manifests/jenkins-secrets.yaml | 11 +++++ jenkins/manifests/jenkins-svc.yaml | 20 ++++++++ jenkins/tpl/jenkins-rc.yaml | 57 ++++++++++++++++++++++ jenkins/tpl/jenkins-secrets.yaml | 11 +++++ jenkins/tpl/values.toml | 2 + 8 files changed, 234 insertions(+) create mode 100644 jenkins/Chart.yaml create mode 100644 jenkins/README.md create mode 100644 jenkins/manifests/jenkins-rc.yaml create mode 100644 jenkins/manifests/jenkins-secrets.yaml create mode 100644 jenkins/manifests/jenkins-svc.yaml create mode 100644 jenkins/tpl/jenkins-rc.yaml create mode 100644 jenkins/tpl/jenkins-secrets.yaml create mode 100644 jenkins/tpl/values.toml diff --git a/jenkins/Chart.yaml b/jenkins/Chart.yaml new file mode 100644 index 000000000..04bc35196 --- /dev/null +++ b/jenkins/Chart.yaml @@ -0,0 +1,10 @@ +name: jenkins +home: https://jenkins.io/ +source: +- https://github.com/bitnami/bitnami-docker-jenkins +version: 0.2.1 +description: The leading open source automation server +maintainers: +- Bitnami +details: |- + Joomla is the leading open source automation server diff --git a/jenkins/README.md b/jenkins/README.md new file mode 100644 index 000000000..ff5e7c8c9 --- /dev/null +++ b/jenkins/README.md @@ -0,0 +1,66 @@ +# Jenkins + +> Jenkins is widely recognized as the most feature-rich CI available with easy configuration, continuous delivery and continuous integration support, easily test, build and stage your app, and more. It supports multiple SCM tools including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based projects as well as arbitrary scripts. + +Based on the [Bitnami Jenkins](https://github.com/bitnami/bitnami-docker-jenkins) image for docker, this Chart bootstraps a [Jenkins](https://jenkins.io) deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh). + +## Persistence + +> *You may skip this section if your only interested in testing the Jenkins Chart and have not yet made the decision to use it for your production workloads.* + +For persistence of the Jenkins data and configuration, mount a [storage volume](http://kubernetes.io/v1.0/docs/user-guide/volumes.html) at the `/bitnami/jenkins` path of the Jenkins pod. + +By default the Jenkins Chart mounts an [emptyDir](http://kubernetes.io/docs/user-guide/volumes/#emptydir) volume. + +## Configuration + +To edit the default Jenkins configuration, run + +```bash +$ helmc edit jenkins +``` + +Here you can update the Jenkins admin username and password in `tpl/values.toml`. When not specified, the default values are used. + +Refer to the [Environment variables](https://github.com/bitnami/bitnami-docker-jenkins/#environment-variables) section of the [Bitnami Jenkins](https://github.com/bitnami/bitnami-docker-jenkins) image for the default values. + +The values of `jenkinsUser` and `jenkinsPassword` are the login credentials when you [access the Jenkins instance](#access-your-jenkins-application). + +Finally, generate the chart to apply your changes to the configuration. + +```bash +$ helmc generate --force jenkins +``` + +## Access your Jenkins application + +You should now be able to access the application using the external IP configured for the Joomla service. + +> Note: +> +> On GKE, the service will automatically configure a firewall rule so that the Joomla instance is accessible from the internet, for which you will be charged additionally. +> +> On other cloud platforms you may have to setup a firewall rule manually. Please refer your cloud providers documentation. + +Get the external IP address of your Jenkins instance using: + +```bash +$ kubectl get services jenkins +NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE +jenkins 10.63.246.116 146.148.20.117 80/TCP,443/TCP app=jenkins 15m +``` + +Access your Jenkins deployment using the IP address listed under the `EXTERNAL_IP` column. + +The default credentials are: + + - Username: `user` + - Password: `bitnami` + +## Cleanup + +To delete the Jenkins deployment completely: + +```bash +$ helmc uninstall -n default jenkins +``` diff --git a/jenkins/manifests/jenkins-rc.yaml b/jenkins/manifests/jenkins-rc.yaml new file mode 100644 index 000000000..9c5dc31b3 --- /dev/null +++ b/jenkins/manifests/jenkins-rc.yaml @@ -0,0 +1,57 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/jenkins-rc.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: ReplicationController +metadata: + name: jenkins + labels: + app: jenkins + provider: jenkins-server + heritage: bitnami +spec: + replicas: 1 + selector: + app: jenkins + provider: jenkins-server + version: 2.17-r0 + template: + metadata: + labels: + app: jenkins + provider: jenkins-server + version: 2.17-r0 + heritage: bitnami + spec: + containers: + - name: jenkins + image: bitnami/jenkins:2.17-r0 + env: + - name: JENKINS_USERNAME + value: "user" + - name: JENKINS_PASSWORD + valueFrom: + secretKeyRef: + name: jenkins + key: jenkins-password + ports: + - name: http + containerPort: 8080 + - name: https + containerPort: 8443 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 120 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: jenkins-data + mountPath: /bitnami/jenkins + volumes: + - name: jenkins-data + emptyDir: {} diff --git a/jenkins/manifests/jenkins-secrets.yaml b/jenkins/manifests/jenkins-secrets.yaml new file mode 100644 index 000000000..f28c71ee8 --- /dev/null +++ b/jenkins/manifests/jenkins-secrets.yaml @@ -0,0 +1,11 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/jenkins-secrets.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: Secret +metadata: + name: jenkins + labels: + provider: jenkins + heritage: bitnami +type: Opaque +data: + jenkins-password: "Yml0bmFtaQ==" diff --git a/jenkins/manifests/jenkins-svc.yaml b/jenkins/manifests/jenkins-svc.yaml new file mode 100644 index 000000000..75e4412de --- /dev/null +++ b/jenkins/manifests/jenkins-svc.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: jenkins + labels: + app: jenkins + provider: jenkins-server + heritage: bitnami +spec: + type: LoadBalancer + ports: + - name: http + port: 80 + targetPort: http + - name: https + port: 443 + targetPort: https + selector: + app: jenkins + provider: jenkins-server diff --git a/jenkins/tpl/jenkins-rc.yaml b/jenkins/tpl/jenkins-rc.yaml new file mode 100644 index 000000000..e80b841c1 --- /dev/null +++ b/jenkins/tpl/jenkins-rc.yaml @@ -0,0 +1,57 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/jenkins-rc.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: ReplicationController +metadata: + name: jenkins + labels: + app: jenkins + provider: jenkins-server + heritage: bitnami +spec: + replicas: 1 + selector: + app: jenkins + provider: jenkins-server + version: 2.17-r0 + template: + metadata: + labels: + app: jenkins + provider: jenkins-server + version: 2.17-r0 + heritage: bitnami + spec: + containers: + - name: jenkins + image: bitnami/jenkins:2.17-r0 + env: + - name: JENKINS_USERNAME + value: {{ .jenkinsUser | quote }} + - name: JENKIS_PASSWORD + valueFrom: + secretKeyRef: + name: jenkins + key: jenkins-password + ports: + - name: http + containerPort: 8080 + - name: https + containerPort: 8443 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 120 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: jenkins-data + mountPath: /bitnami/jenkins + volumes: + - name: jenkins-data + emptyDir: {} diff --git a/jenkins/tpl/jenkins-secrets.yaml b/jenkins/tpl/jenkins-secrets.yaml new file mode 100644 index 000000000..a6cf40d5a --- /dev/null +++ b/jenkins/tpl/jenkins-secrets.yaml @@ -0,0 +1,11 @@ +#helm:generate helmc tpl -d tpl/values.toml -o manifests/jenkins-secrets.yaml $HELM_GENERATE_FILE +apiVersion: v1 +kind: Secret +metadata: + name: jenkins + labels: + provider: jenkins + heritage: bitnami +type: Opaque +data: + jenkins-password: {{ .jenkinsPassword | b64enc | quote }} diff --git a/jenkins/tpl/values.toml b/jenkins/tpl/values.toml new file mode 100644 index 000000000..766f9f29f --- /dev/null +++ b/jenkins/tpl/values.toml @@ -0,0 +1,2 @@ +jenkinsUser = "user" +jenkinsPassword = "bitnami" From 34f006065b7f1917b1bdd2f8e8df1e8ce7bca8fd Mon Sep 17 00:00:00 2001 From: jdrios Date: Thu, 11 Aug 2016 17:51:37 +0200 Subject: [PATCH 2/3] Fix typo --- jenkins/manifests/jenkins-rc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins/manifests/jenkins-rc.yaml b/jenkins/manifests/jenkins-rc.yaml index 9c5dc31b3..d2149ea8c 100644 --- a/jenkins/manifests/jenkins-rc.yaml +++ b/jenkins/manifests/jenkins-rc.yaml @@ -27,7 +27,7 @@ spec: env: - name: JENKINS_USERNAME value: "user" - - name: JENKINS_PASSWORD + - name: JENKIS_PASSWORD valueFrom: secretKeyRef: name: jenkins From cc4c13577d774a9577aec3863167fb5cb8dc0440 Mon Sep 17 00:00:00 2001 From: jdrios Date: Thu, 11 Aug 2016 17:57:23 +0200 Subject: [PATCH 3/3] Fix typo, now really --- jenkins/manifests/jenkins-rc.yaml | 2 +- jenkins/tpl/jenkins-rc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jenkins/manifests/jenkins-rc.yaml b/jenkins/manifests/jenkins-rc.yaml index d2149ea8c..9c5dc31b3 100644 --- a/jenkins/manifests/jenkins-rc.yaml +++ b/jenkins/manifests/jenkins-rc.yaml @@ -27,7 +27,7 @@ spec: env: - name: JENKINS_USERNAME value: "user" - - name: JENKIS_PASSWORD + - name: JENKINS_PASSWORD valueFrom: secretKeyRef: name: jenkins diff --git a/jenkins/tpl/jenkins-rc.yaml b/jenkins/tpl/jenkins-rc.yaml index e80b841c1..2f067793e 100644 --- a/jenkins/tpl/jenkins-rc.yaml +++ b/jenkins/tpl/jenkins-rc.yaml @@ -27,7 +27,7 @@ spec: env: - name: JENKINS_USERNAME value: {{ .jenkinsUser | quote }} - - name: JENKIS_PASSWORD + - name: JENKINS_PASSWORD valueFrom: secretKeyRef: name: jenkins