Created
August 30, 2018 05:43
-
-
Save h3nryza/10ff3a8470f53602c2251f31cbe76ec1 to your computer and use it in GitHub Desktop.
Create a simple jenkins on a local kubernetes installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
kind: Namespace | |
apiVersion: v1 | |
metadata: | |
name: jenkins | |
labels: | |
name: jenkins | |
--- | |
kind: PersistentVolume | |
apiVersion: v1 | |
metadata: | |
name: jenkins-home | |
labels: | |
type: local | |
namespace: jenkins | |
spec: | |
storageClassName: slow | |
capacity: | |
storage: 5Gi | |
accessModes: | |
- ReadWriteOnce | |
hostPath: | |
path: /mnt/disks/jenkins/jenkins-home | |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: jenkins-home | |
namespace: jenkins | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
storageClassName: slow | |
resources: | |
requests: | |
storage: 5Gi | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: jenkins | |
labels: | |
app: jenkins | |
namespace: jenkins | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: jenkins | |
template: | |
metadata: | |
labels: | |
app: jenkins | |
spec: | |
volumes: | |
- name: jenkins-home | |
persistentVolumeClaim: | |
claimName: jenkins-home | |
containers: | |
- name: jenkins | |
image: jenkins/jenkins | |
imagePullPolicy: Always | |
ports: | |
- containerPort: 8080 | |
- containerPort: 5000 | |
volumeMounts: | |
- mountPath: /var/jenkins_home | |
name: jenkins-home | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app: jenkins | |
name: jenkins | |
namespace: jenkins | |
spec: | |
ports: | |
- name: jenkins-reg | |
port: 5000 | |
protocol: TCP | |
targetPort: 5000 | |
- name: jenkins-http | |
port: 8080 | |
protocol: TCP | |
targetPort: 8080 | |
selector: | |
app: jenkins | |
type: NodePort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment