Skip to content

Deploy pipeline to aks

Winding Up deploy release pipleline to new Aks cluster

This document describes the steps we need to take to set up release piplline for new aks cluster.

1. Copy the release from existing release
2. Edit the Upgrade Helm step
3. Add the config maps/secrets to the cluster

All the above steps are explained in detail below:-

1. Copy the release from existing relase

Clone any existing piple n the azure dev ops

2. Edit the Upgrade Helm step

Choose "Kubernetes Service Connection" in the "Connection Type". Create a service connection using kubeconfig.

$CLUSTER_NAME = 'dev-cluster'
$KUBECONFIG_FILE = 'config'
$SERVER = 'https://dev-minority-dad309b4.hcp.eastus2.azmk8s.io:443' # change the server name to the new one
$USER = 'tiller'

##  to get ca.crt and token run:
##  kubectl get secret SERVICE_ACCOUNT_SECRET_NAME --namespace=kube-system -o=yaml
##  base64 decode token and ca values in the secret. Save certificate in ca.crt file
$CA = 'ca.crt'
$TOKEN = ''

kubectl config set-cluster $CLUSTER_NAME --kubeconfig=$KUBECONFIG_FILE --server=$SERVER --certificate-authority=$CA --embed-certs=true
kubectl config set-credentials $USER --kubeconfig=$KUBECONFIG_FILE --token=$TOKEN
kubectl config set-context $USER --kubeconfig=$KUBECONFIG_FILE --cluster=$CLUSTER_NAME --user=$USER
kubectl config use-context $USER --kubeconfig=$KUBECONFIG_FILE

Create the Kube.config and create a service account in azure dev ops.

Referece Article -> https://medium.com/@elijudah/configuring-minimal-rbac-permissions-for-helm-and-tiller-e7d792511d10

Save the release pipeline and run to see the pods have started being created in the cluster.

3. Add the config maps/secrets to the cluster

We need to use the tool that Roman will work on to move all the configs and secrets to new cluster.