<p>I want to create a CI/CD on Azure with Jenkins, Docker, Kubernetes, starting from simple.</p>

<p>I already went through the <strong>Voting-app</strong> tutorial <strong>Tutorial: Prepare application for Azure Container Service (AKS)</strong> <a href="https://learn.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app" rel="nofollow noreferrer">Azure tutorial</a> The tutorial covers the steps: </p>

<blockquote>
  <p>1 - Prepare application for AKS  2 - Create container registry ACS  3
  -Create Kubernetes cluster  4 - Run application</p>
</blockquote>

<p>The application is working.</p>

<p>The next step I want to do, is to integrate Jenkins. I am following the tutorial <strong>Continuous deployment with Jenkins and Azure Container Service</strong> I couldn´t follow the tutorial because is too advanced to understand the commands from the files. For example, the way they deployed jenkins using the file <a href="https://github.com/Azure-Samples/azure-voting-app-redis/blob/master/jenkins-tutorial/deploy-jenkins-vm.sh" rel="nofollow noreferrer">deploy-jenkins-vm.sh</a> </p>

<p>Instead of that, I went to the Marketplace on Azure and created "Jenkins" and via the Azure UI, set up the configuration. Jenkins is now running on localhost:8080</p>

<p>From another video tutorial <a href="https://www.youtube.com/watch?v=UyYTrOCLuBs" rel="nofollow noreferrer">Hands-on Docker, Jenkins CI/CD Azure</a>  I shared the cluster kubeconfig to my remote jenkins host:</p>

<blockquote>
  <p>$ sudo scp ~/.kube/config
  anjenkins@jenkins9999.australiaeast.cloudapp.azure.com:/var/lib/jenkins/config</p>
</blockquote>

<p>It worked. </p>

<p>Then, from the same video tutorial they run a bash file</p>

<pre><code>#!/bin/bash
# Jenkins Bootstrap for ACS Kubernetes
set -x #echo on
wget https://raw.githubusercontent.com/mekenthompson/kubectl/master/kubectl -O ~/kubectl
chmod +x kubectl
sudo cp kubectl /usr/local/bin/kubectl
sudo mkdir /home/tomcat/.kube
sudo cp config /home/tomcat/.kube/config
sudo chown -R tomcat:tomcat /home/tomcat/.kube
sudo usermod -aG docker tomcat
sudo /opt/bitnami/ctlscript.sh restart
set +x #echo off
</code></pre>

<p>From the repository <a href="https://raw.githubusercontent.com/mekenthompson/example-voting-app/master/jenkins/jenkins-bootstrap.sh" rel="nofollow noreferrer">here</a>. It didn´t work for me</p>

<pre><code>+ chmod +x kubectl
+ sudo cp kubectl /usr/local/bin/kubectl
+ sudo mkdir /home/tomcat/.kube
mkdir: cannot create directory '/home/tomcat/.kube': No such file or directory
+ sudo cp config /home/tomcat/.kube/config
cp: cannot stat 'config': No such file or directory
+ sudo chown -R tomcat:tomcat /home/tomcat/.kube
chown: invalid user: 'tomcat:tomcat'
+ sudo usermod -aG docker tomcat
usermod: group 'docker' does not exist
+ sudo /opt/bitnami/ctlscript.sh restart
sudo: /opt/bitnami/ctlscript.sh: command not found
+ set +x
</code></pre>

<p>But my question is, what is the next step after I shared de kubeconfig to my jenkins remote host. I am just copying and pasting, but not knowing , what is happening</p>

<p>Form the tutorials, they seem to me, too advanced and I don´t know what is going on, or what exactly should be done.</p>

<p>From the Azure <strong>Voting tutorial</strong> they have another file, to set up Jenkins <a href="https://github.com/Azure-Samples/azure-voting-app-redis/blob/master/jenkins-tutorial/config-jenkins.sh" rel="nofollow noreferrer">config-jenkins.sh</a>, but as well I don´t know what needs to be done</p>

<p>What exactly I should do, Do you know other resources or links to follow. </p>

<p>I have already jenkins, an Azure Container Registry, Azure Container Service, and the voting app. </p>

<p>We're working on an open source project called <a href="https://jenkins-x.io/" rel="nofollow noreferrer">Jenkins X</a> which is a proposed sub project of the Jenkins foundation aimed at automating CI/CD on Kubernetes using Jenkins pipelines and GitOps for promotion across environments.</p>

<p>If you want to see how to automate CI/CD with multiple environments on Kubernetes using GitOps for promotion between environments and Preview Environments on Pull Requests you might wanna check out <a href="https://jenkins-x.io/demos/devoxx-uk-2018/" rel="nofollow noreferrer">my recent talk on Jenkins X at DevOxx UK</a> where I do a live demo of this on GKE. Though Jenkins X works on <a href="https://jenkins-x.io/getting-started/" rel="nofollow noreferrer">AWS, AKS and GKE and other kubernetes clusters too</a>.</p>
