templates in openshift
Commands to create templates
- vim gogstmp.yml : create gogstmp.yml using the code given in the file
- We are using two images in which one is postgresql and another is gogs
- find DockerImage in that the gogs path is mention in it we have to check if this docker image is available in that path or we have to change the path
- search for docker gogs image using following command and search for openshift image which is (docker.io/openshiftdemos/gogs)
- docker search gogs
- Now change the path of the Gogs in gogstmp.yml
- Now another postgresql image we are using this imahe from image Stream
- check in Image stream using following commands 9)oc get is -n openshift : you will get list of different images from this we are using postgresql image
- Now check the version using #oc edit is postgresql -n openshift
- oc create a file
- oc create -f gogstmp.yml -n openshift : check if the image is find in console or not
- Now create a Project in console (for example : mypro)
- Now in command line type #oc create -f gogstmp.yml -n mypro
- now to goto console and goto mypro (console login and password is admin)
- Now search in catlog for gogs
- Now create it adn check the status as running pods.
- check the pods are running or not
- #oc get pods -n mypro
- now using route get a link
- oc get route -n mypro
- now paste link in address bar
- and now get the svc of postgresql
- #oc get svc :: copy the svc and port in the given field (postgresql ip and port for example 142.25.1.2:5432)
- now describe the deployment config
- oc describe dc postgresql -n mypro
- put user , password and link in it 28 ) paste the link which we are getting using route.