Skip to content

Instantly share code, notes, and snippets.

@jkeam
Last active May 12, 2021 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkeam/1fe9b6c9f290aa6a67f651a4031e86cf to your computer and use it in GitHub Desktop.
Save jkeam/1fe9b6c9f290aa6a67f651a4031e86cf to your computer and use it in GitHub Desktop.
OpenShift GitOps with SpringBoot Petclinic App

OpenShift GitOps

Steps to install GitOps in OpenShift with SpringBoot Petclinic application.

Prerequisite

  1. OpenShift 4.7
  2. oc logged in as cluster-admin

Setup

  1. Install OpenShift GitOps from the OperatorHub
  2. Verify
watch -n 5 oc get pods -n openshift-gitops

You should get output like

NAME                                                          READY   STATUS    RESTARTS   AGE
cluster-b5798d6f9-xq7pb                                       1/1     Running   0          28s
kam-69866d7c48-5pcg6                                          1/1     Running   0          27s
openshift-gitops-application-controller-0                     1/1     Running   0          26s
openshift-gitops-applicationset-controller-6447b8dfdd-tbxgw   1/1     Running   0          25s
openshift-gitops-redis-74bd8d7d96-9pvcx                       1/1     Running   0          26s
openshift-gitops-repo-server-c999f75d5-47psw                  1/1     Running   0          26s
openshift-gitops-server-6ff4fbc8f6-mb8dn                      1/1     Running   0          26s
  1. Get URL and open ArgoCD in browser
oc get route openshift-gitops-server -n openshift-gitops -o jsonpath='{.spec.host}'
  1. Get password to log into ArgoCD, username is admin
oc extract secret/openshift-gitops-cluster -n openshift-gitops --to=-

Deploy UI Update

  1. Create basic cluster update
oc apply -f https://raw.githubusercontent.com/jkeam/openshift-gitops-getting-started/bugfix/1_1/argo/cluster.yaml
  1. Verify installation, it will say that it is OutOfSync because we chose manual reconciliation
oc get application -n openshift-gitops
  1. Log into ArgoCD and see that it also says OutOfSync. Click the Sync button and then Synchronize button. Then view OpenShift and click the app launcher in the upper right to see a new link added to the Developer Blogs. Also a new spring-petclinic project has been created.

Deploy App

The cluster.yaml we applied before created the necessary namespace and RoleBinding to allow us to be able to deploy the spring petclinic app. Let's do that now.

oc apply -f https://raw.githubusercontent.com/jkeam/openshift-gitops-getting-started/bugfix/1_1/argo/app.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment