oc cluster up \
--public-hostname=10.1.2.2 --routing-suffix=10.1.2.2.nip.io \
--host-data-dir=/var/lib/origin/openshift.local.data
[root@openshiftdev OpenShiftHowToGuides]# oc whoami
admin
[root@openshiftdev ~]# oc login -u admin
Logged into "https://10.0.2.15:8443" as "admin" using existing credentials.
You have access to the following projects and can switch between them with 'oc project <projectname>':
* default
kube-system
myproject
openshift
openshift-infra
Using project "default".
docker tag marklogic9 172.30.1.1:5000/openshift/marklogic9
docker login -u admin -p $(oc whoami -t) 172.30.1.1:5000
- This should create an ImageStream in the openshift namespace. You can check this by issuing the command:
[root@openshiftdev OpenShiftHowToGuides]# oc get is -n openshift|grep marklogic marklogic9 172.30.1.1:5000/openshift/marklogic9 latest About a minute ago
- You can view the contents of the ImageStream config file by issuing this command:
[root@openshiftdev ~]# oc export is marklogic9 -n openshift apiVersion: v1 kind: ImageStream metadata: creationTimestamp: null generation: 1 name: marklogic9 spec: tags:
curl https://raw.githubusercontent.com/corpbob/OpenShiftHowToGuides/marklogic/marklogic/slush-marklogic-node-templatel.yml -o slush-marklogic-node-templatel.yml
oc new-project ml-dev
oc adm policy add-scc-to-user anyuid -z default
oc secrets new-dockercfg push-secret --docker-server=172.30.1.1:5000 --docker-username=admin --docker-password=$(oc whoami -t) --docker-email=admin@example.com
oc secrets add serviceaccount/default secrets/push-secret --for=pull,mount
oc create -f slush-marklogic-node-templatel.yml
oc new-app slush-marklogic-node-app
oc create -f slush-marklogic-node-pipeline.yml
You should see a jenkins service was added:
Navigate to the pipeline to see it:
The pipeline that is yet to be started looks like:
However, we cannot start this yet. We need to create the UAT Environment.
oc new-project ml-uat
oc adm policy add-scc-to-user anyuid -z default
oc secrets new-dockercfg push-secret --docker-server=172.30.1.1:5000 --docker-username=admin --docker-password=$(oc whoami -t) --docker-email=admin@example.com
oc secrets add serviceaccount/default secrets/push-secret --for=pull,mount
oc create -f slush-marklogic-node-templatel-uat.yml
oc new-app slush-marklogic-node-app
TODO: this image should be uat environment.
[root@localhost marklogic]# oc policy add-role-to-user edit system:serviceaccount:ml-dev:jenkins -n ml-uat
role "edit" added: "system:serviceaccount:ml-dev:jenkins"
If you click on the jenkins like you’ll find the pipeline:
You can also look at the jenkins log:
At this stage the pipeline will wait for an Approver to give the go-signal.
username: admin
password: admin