Use a persistent storage for jenkins

This commit is contained in:
Ovidio Mallo 2017-01-02 18:40:24 +01:00
parent d707d0ea49
commit 1a545b425a
3 changed files with 23 additions and 2 deletions

View File

@ -3,6 +3,11 @@
sudo htpasswd -b /etc/origin/master/htpasswd dev1 dev1
sudo htpasswd -b /etc/origin/master/htpasswd test1 test1
oc login -u system:admin
mkdir -p ~/openshift/volumes/
oc delete -f infra/volumes-local.yaml
oc apply -f infra/volumes-local.yaml
oc login -u system:admin
oc project openshift
oc delete is oc-jenkins
@ -24,10 +29,13 @@ oc new-project rubex-test
oc policy add-role-to-user edit test1 -n rubex-test
oc policy add-role-to-group system:image-puller system:serviceaccounts:rubex-test -n rubex-dev
oc login -u admin -p admin
oc project cicd
oc process \
-f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-ephemeral-template.json \
-v MEMORY_LIMIT=2Gi \
-f https://raw.githubusercontent.com/openshift/origin/master/examples/jenkins/jenkins-persistent-template.json \
-v JENKINS_IMAGE_STREAM_TAG=oc-jenkins:latest \
-v MEMORY_LIMIT=2Gi \
-v VOLUME_CAPACITY=5Gi \
| oc apply -f -
# ---

13
infra/volumes-local.yaml Normal file
View File

@ -0,0 +1,13 @@
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: disk-1
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /Users/omallo/openshift/volumes/disk-1