OP Service Deployment Guideline
This document shares the steps on how we can deploy the microservice on the kubernetes cluster in the openshift environment.
Workflow
- Once the PR/ MR is merged, run the github actions configured with the repository with proper tags.
- Github actions containerizes the code and pushes images to the Github Container Registry(GHCR).
- Once Image is published in GHCR, update the imagestreams of the respective microservice in OpenShift.
- Roll out the microservice deployment and restart the One Platform API Gateway if required.
- Now your changes are live now
Building an Image
- For building the image after PR navigate to GIthub Actions and select the action you want to perform. Trigger the run workflow button for the action which you have selected.
- Once the GitHub action is completed you will be able to see the new/updated image on the packages section of the One Platform repository.
- Details of the new/updated image is available over the package page over the GitHub repository with the history of the update.
- Login to the Openshift Console and copy the login command with oc CLI.
oc login --token=token-test --server=https://test.openshiftapps.com:6442
- Switch to the project in openshift to update the imagestream.
oc project <project-name>
- Update the imagestream with a new image.
oc import-image <image-name>:<tagname>
- Under the imagestreams section of the openshift web ui you can see that the new image has rolled out.
- Navigate to respective Deployment config and redeploy the microservice to update what changes through web UI