Setting up a new environment - Arthyon/microservice-poc GitHub Wiki

This guide describes how to set up a new environment to deploy to.

Kubernetes

A namespace must be created that equals the name of the namespace specified as a variable in Azure DevOps. This must be done before creating the first release, because the Kubernetes-task is scoped to a namespace before running any commands. If the namespace does not exist, the deploy will fail.

Run kubectl create namespace <namespace name> to create it. Namespaces must be lower case. Remember to be in the right context (so you don't create the namespace locally).

Azure Api Management Service

Create a new Api Management Service. Note the name and resource group as you need to add them as environment variables in the next step.

Azure DevOps

To start with, edit the release pipeline. Clone an existing stage to get started, then click the lightning bolt to set up Pre-deployment conditions. The stage should most likely be run after another stage, and possibly with some approval scheme.

You want to remove the task that creates a github release if you cloned the preprod-stage. We should not create new releases for each environment.

Some services need environment variables. Go to the Variables-tab. You will see that a copy of all variables have been created with the correct scope. Change the values to match your environment.

If you do not know the ip of the Kubernetes Ingress at this time, add a placeholder url or use the same url as another environment temporarily.