Skip to content

fmlisco/wefox-challenge-automation-jenkins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http-echo

Description

Http echo - A small go web server that serves the contents it was started with as an HTML page.

Introduction

This chart deploys hello on a Kubernetes cluster using the Helm 3 package manager and Jenkins

Installing Minikube

To install Minikube if it's not available, run the script minikube_setup.sh located in the root folder.

$ bash minikube_setup.sh

The command checks, installs (if missing) and starts a minikube cluster named wefox-challenge-cluster The deploying section lists the commands to deploy and upgrade the Http echo helm chart.

Tip: check minikube using minikube status

Deploying the Jenkins helm chart

I deployed Jenkins to automate the deployment of http-echo User: admin password: Wefoxchallenge01

helm repo add jenkins https://charts.jenkins.io
helm repo update
kubectl create namespace devops-tools
kubectl config set-context --current --namespace=devops-tools
helm upgrade --install jenkins-admin --set controller.adminPassword=Wefoxchallenge01 jenkins/jenkins
kubectl --namespace devops-tools port-forward svc/myjenkins 8080:8080 &
kubectl apply -f charts/jenkins/rbac.yaml

Tip: I added a service account with the needed permissions to allow Jenkins to deploy/update our Helm Chart

Configure the GitHub repository

I generated a Personal access token (PAT) in the GitHub settings and added a webhook in the GitHub repository that we are going to use (wefox-challenge-automation-jenkins)

Define the URL for http-echo

sudo -- sh -c "echo 127.0.0.1    hello.wefox.localhost >> /etc/hosts"

Deploying

I have already deployed the helm chart for http-echo with image version 0.2.1. as soon as a new git tag is created in the git repo, Github notifies Jenkins that runs the 'wefox-challenge' pipeline and atuomatically deploys the http-echo helm chart.

Tip: The git tag must match the image name since Jenkins uses it.

Tip: The service should be available from outside the cluster, via something like: curl http://hello.wefox.localhost:8081/

One line commands

Minikube Dashboard

minikube dashboard --url

Tip: A great help to monitor the Minikube cluster

Delete the minikube cluster

minikube delete -p wefox-challenge-cluster

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published