ci/cd

Deploy node app to okd/ocp with Argocd

Author Photo

Mikael Eklund

· 1 min read
Thumbnail

With a working ci part it is now time to deploy the image to our okd cluster. This will be done by using Argocd. In the project I create a kustomize folder and drop a deployment.yaml, secret.yaml, service.yaml and a route.yaml. With theese file I can just go ocp appy -f and the different yamls to deploy to my cluster. What I want is to get an automatic deployment when pushing files to the repo. Argocd is looking a customize folder when creating a new application. In the kustomize folder we drop a kustomization.yaml and drop the barebone config in it:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources: 
   - secret.yaml
   - service.yaml 
   - route.yaml
   - deployment.yaml

When setting up the Argocd application it searches the resource files for updates. Initially I leave Argocd in manual mode. In the ui you get a message that the files is out of sync and just manually start the syncronization. When shure that everything runs smooth it will be altered to automatic mode. One big bonus with Argocd is that if pods or deployment get altered or deleted manually argocd reports this and if in automatic mode it will repair the deployment.

#astro#blog#ocp#okd#argocd
Author Photo

About Mikael Eklund

Mikael Eklund is a Senior it technology specialist. With a passion for technology and programming.