Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jenkins to marketplace #12

Merged
merged 4 commits into from Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
78 changes: 78 additions & 0 deletions jenkins/app.yaml
@@ -0,0 +1,78 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: jenkins-pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: $VOLUME_SIZE
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jenkins-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: $VOLUME_SIZE
---
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
ports:
- name: jenkins
port: 8080
targetPort: 8080
- name: jenkins-agent
port: 50000
targetPort: 50000
selector:
app: jenkins
clusterIP: None
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jenkins
spec:
selector:
matchLabels:
app: jenkins
serviceName: jenkins
replicas: 1
template:
metadata:
labels:
app: jenkins
spec:
containers:
- image: bitnami/jenkins:2.190.1-debian-9-r14
name: jenkins
env:
- name: JENKINS_USERNAME
value: $JENKINS_USERNAME
- name: JENKINS_PASSWORD
value: $JENKINS_PASSWORD
ports:
- containerPort: 8080
name: jenkins
- containerPort: 50000
name: jenkins-agent
volumeMounts:
- name: jenkins-persistent-storage
mountPath: /bitnami
volumes:
- name: jenkins-persistent-storage
persistentVolumeClaim:
claimName: jenkins-pv-claim
Binary file added jenkins/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions jenkins/manifest.yaml
@@ -0,0 +1,29 @@
---
name: Jenkins
version: 2.190.1
maintainer: "@ruanbekker"
description: Jenkins is a Continuous Integration and Delivery server
url: https://jenkins.io
category: architecture
dependencies:
- Longhorn
plans:
- label: "5GB"
configuration:
VOLUME_SIZE:
value: 5Gi
- label: "10GB"
configuration:
VOLUME_SIZE:
value: 10Gi
- label: "20GB"
configuration:
VOLUME_SIZE:
value: 20Gi
configuration:
JENKINS_USERNAME:
label: "Jenkins username"
value: "CIVO:ALPHANUMERIC(8)"
JENKINS_PASSWORD:
label: "Jenkins password"
value: "CIVO:ALPHANUMERIC(30)"
26 changes: 26 additions & 0 deletions jenkins/post_install.md
@@ -0,0 +1,26 @@
## Jenkins

### External access

By default external access to the Jenkins UI port isn't available. This is easily changed by applying the following YAML to your cluster with `kubectl apply -f jenkins-service.yaml` (or whatever you call the file containing the contents below):

```
apiVersion: v1
kind: Service
metadata:
name: jenkins-service
spec:
type: LoadBalancer
ruanbekker marked this conversation as resolved.
Show resolved Hide resolved
ports:
- port: 8080
targetPort: 8080
protocol: TCP
selector:
app: jenkins
```

This will open up http://YOUR_CLUSTER_ID.k8s.civo.com:8080 to the whole world. You should lock this down in the [firewall](https://www.civo.com/account/firewalls) automatically created in Civo for your Kubernetes cluster. Locking down the firewall will only affect access from OUTSIDE of your Kubernetes cluster, access from your applications within Kubernetes will not be affected.

### Usage instruction

You can use this application from within your cluster by just using the hostname `jenkins`, so jenkins agents can use the hostname `jenkins` and the port `50000`. The username and password for jenkins is set via environment variables, `JENKINS_USERNAME` and `JENKINS_PASSWORD` using `CIVO:ALPHANUMERIC(x)` value and is presented in the Web UI and CLI.