Professional Documents
Culture Documents
Instructions:
First of all we are going to create our environment, to that we need install:
Docker, Jenkins and minikube.
Docker install
With this script the docker install is automated.
minikube start
And install kubectl to operate the cluster:
--src/com/mfranco/
--vars
--resources
Nex step is fork my repository:
Repository
This is a example app with resources to deploy it in k8s and build docker image.
Disclaimer!
Explain Jenkinsfile
New Job
Multibranch pipeline (Dont forget the name!)
Click on add source -> Github
Add our credentials
Add repository url
Two ways of add shared library.
In job folder
General option
And Save
That will scan our repository looking for Jenkinsfile, if it found one, that branch
will be execute.
Now, need the token and certificate created for that execute the next commands:
For Token:
SECRET=$(kubectl get secrets | grep deployer | awk '{print $1}') && kubectl get
secret $SECRET -o jsonpath='{.data.token}' | base64 -d
For Certificate:
SECRET=$(kubectl get secrets | grep deployer | awk '{print $1}') && kubectl get
secret $SECRET -o jsonpath='{.data.ca\.crt}'
Now we are going to create a kubeconfig file to can access to our cluster with the
agents to deploy pods:
manifests/kubeconfig-template.yaml
Agent
In this case we are going to use docker containers like agents:
First we have to create a agent in our localhost.