CANARY DEPLOYMENT IN AZURE KUBERNETES SERVICE

PART 2: SETTING UP YOUR CI SERVER

Shubham Singh
2 min readAug 21, 2020

This Blog is continuation of part 1

Bonjour,
In this blog I’ll help you set up your development environment for our canary project.

PREREQUISITE

  1. Jenkins should be installed on your Development Environment. If you need help to install Jenkins, follow this link
  2. Install kubectl and make sure that it is accessible inside Jenkins user.
TEST
$ sudo su - jenkins
$ kubectl version
SETUP FOR UBUNTU USER
1. Add kubectl path to /etc/environment
2. Run source /etc/environment from your terminal

3. Install docker and add Jenkins user to it

$ sudo usermod -aG docker jenkins

4. Install azure cli and login to your Azure AD

$ curl -L https://aka.ms/InstallAzureCli | bash
$ az login

DOWNLOAD AKS CREDENTIALS AND SETUP YOUR JENKINS

1. Store the AKS Credentials (Kube Config File) in Jenkins User.

TEMPLATE:
az aks get-credentials --name <CLUSTER_NAME> \
--resource-group <RESOURCE_GROUP_NAME>\
[--admin] [--context] [--file] [--overwrite-existing] \ [--subscription]
EXAMPLE:
$ az aks get-credentials --name MyManagedCluster --resource-group MyResourceGroup

2. Once you execute this statement you can very that credentials are download using

$ cd .kube/
$ ls -la
LOOK FOR CONFIG FILE

3. Add docker credentials in your Jenkins Global Credentials.
NOTE: You should give ID as dockerhub, as it is used in my Jenkinsfile.

4. fork this repository into your github https://github.com/denyshubh/eks-demo/tree/test

In the next Blog we’ll create a Jenkins Project and Deploy it to kubernetes.

You can read part 3 of this blog HERE

Thank You
Au revoir

--

--

No responses yet