Deployment
GlobalDcc services are deployed to AMCS Azure Kubernetes Services (AKS) following GitOps principles. As a result of these principles, all aspects of GlobalDcc deployment are managed via files stored in a Git repository - GlobalDccDeploymentK8.
All deployment logic for the new GlobalDcc service is contained in the
manifests
directory.
The structure of manifests
directory is tailored for
kustomize -
Kubernetes configuration management tool.
Kustomize overlays
With different folders under overlays
we define the shape of different
environments/stages, for example Europe DEV (eu-dev
), or North America
Production (na-prd
).
Each overlay contains 3 files:
kustomization.yaml
- kustomize configuration with paths to customize infrastructure names like Azure Resource Groups, DNS etcglobaldcc-values.yaml
- Helm values file with most app configuration including image versions of each serviceroadnets.yaml
- Helm values file for roadnets. We store it in a separate file for UX purposes so that PS and other stakeholders can easily update roadnets without getting lost in all other app settings
Kustomize base
The base
directory contains Kubernetes manifests for cloud infrastructure and
application that are common for all stages/environments
Deploying new versions
To deploy new version of a service to an environment, you first need the tag of the Docker image you want to deploy. You can get it in the log of Global DCC pipelines. Find the step pushing the docker image and you should find the tag in the log. One of the first lines in the log should say something like "C:\Windows\system32\docker.exe push ***/globaldcc:xxx-x.x.xxx", the "xxx-x.x.xxx" part after the colon is the tag. The tag number is also the name of the pipeline run.
Then simply modify the image tag in globaldcc-values.yaml
file in the
corresponding overlay directory, these files are in the main branch of
GlobalDccDeploymentK8. For example, to update the backend image from
backend-1.0.0
to backend-2.0.0
, modify backend.image.tag
so it looks like
this:
backend:
image:
registry: amcsmainprdcr.azurecr.io
repository: globaldcc
tag: backend-2.0.0
Commit the change and let ArgoCD sync the change into Kubernetes. Once the change is in the cluster, AKS will start updating your services: pulling new image, rolling out the deployment, pinging health probes etc.
After the change is committed to the branch watched by ArgoCD (can be checked here, for DEV), you don't need to do anything but wait for the magic to happen. If you are impatient or want to see things moving, you can open GlobalDCC app in ArgoCD to see what it's doing: https://argocd-dev.amcsgroup.io/applications/transport-bu/globaldcc-eu
Troubleshooting deployments
In case of a regression or a bug, where a new pod fails to start, we currently have these limited options:
- Browse to ArgoCD app and look for red errors/events, or inspect pod's logs