Kubernetes

The Parro Nexus kubernetes setup

Kubernetes

Parro Nexus is run on our kubernetes clusters. The test environment is deployed on the onderwijs-intern cluster. Acceptance and production are run on the previder cluster.

To deploy the Parro Nexus service to the kubernetes clusters we use a combination of Helm charts and ArgoCD. The Helm charts contain the full set of yaml files required to deploy a single app, and ArgoCD is our automation tool for deploying these charts.

ArgoCD

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. (https://argo-cd.readthedocs.io/en/stable/)

ArgoCD is a deployment tool which makes sure that Parro Nexus is deployed the way it should. ArgoCD is connected to our kubernetes clusters and makes sure the deployments running on these clusters are the same as the desired state. To define this desired state we use a GitHub repository describing this desired state.

This way we have a single source of truth for our infra setup, and get a GitOps way of working.

ArgoCD is connected to our git repo and detects changes via GitHub hooks. Whenever you commit a change in the git repo ArgoCD will be notified of this change. It will then check out the change and using Helm it will create the desired state of yaml files. It will then connect to the kubernetes repo to get the actual state of the deployment and do a diff between the two. Al changes will then be synced to the kubernetes cluster.

Infra repository

There Parro Nexus infra repository (https://github.com/topicusonderwijs/parro-connect-infra) contains three branches:

  • development
  • acceptance
  • production

Each branch has the complete Parro Nexus setup and the value.yaml files with the settings for their environment. A typical app deployment contains at least the following two files:

  • Chart.yaml
  • values.yaml

The Chart.yaml contains the configuration of which Helm chart to use:

apiVersion: v2
version: 0.0.1
name: Customer API Gateway - Ouderportaal
description: Customer API Gateway for the ParnasSys ouder portaal

dependencies:
- name: parro-connect-customer-api-gateway
  version: 0.1.9
  repository: "@topicus"

The values.yaml contains all the overrides for that specific environment.

parro-connect-customer-api-gateway:
  replicaCount: 2
  image:
    repository: docker.topicus.education/parro-connect/customer-api-gateway
    tag: 0.0.1-119
...

Jenkins

The development branch of the infra repo also contains a Jenkinsfile. This Jenkinsfile is used by the deployment job (https://jenkins2.topicusonderwijs.nl/view/Parro/job/Microservices/job/deploy_development/). Whenever an app is successfully built by Jenkins it will deploy this new version to the development environment. Since we use ArgoCD for the actual deployment we only need to make a change in one of the yaml files a commit these changes. This is what the Jenkinsfile does, it receives two input parameters service and newVersion. The service matches one of the apps which will be deployed (it matches the directory of the app). The newVersion matches the new docker tag. The Jenkins job will do a checkout on the infra repo and go to the provided directory, it will then open the values.yaml and change the docker tag to the provided newVersion. Finally, it will commit and push these changes.

After this the ArgoCD setup will take over. It will detect the new version and deploy this to the onderwijs-intern cluster.

For acceptance and production the changes are still done by hand (for now).

Explanatory video’s

What is ArgoCD

What is GitOPS