Skip to content

Latest commit

 

History

History
62 lines (34 loc) · 2.33 KB

File metadata and controls

62 lines (34 loc) · 2.33 KB

K8S, Jenkins and StickerStore app deployment

The purpose of this challenge is to build and deploy a application to a Kubernetes cluster

In this challenge we will:

  1. Install a Jenkins from Helm Chart
  2. Build the images from GitHub repo.
  3. Push the images to Docker Hub.
  4. Execute YAML deployment files in the K8S cluster from the Jenkins pipeline.

Installation

helm install --name jenkins-release -f values.yaml stable/jenkins

CI Setup

  • fork git repo https://github.com/<your-username>/k8s-workshop-microservices.git

  • Create a new "Freestyle Project"

image

  • Fill in the GitHub URL https://github.com/<your-username>/k8s-workshop-microservices in the GitHub project tab and the git URLhttps://github.com/<your-username>/k8s-workshop-microservices.git in the "Source Code Management"

image

  • Create a build step "Docker Build and Publish"
  • Enter the repo name and tag

image

  • Add your Docker Hub credentials by clicking on "Add" in "Registry Credentials

image

  • Modify the "Build Context" in the "Advanced" section to the relevant service folder.
  • Modify the "Dockerfile path" in the "Advanced" section to the relevant service folder dockerfile. For example: "Dockerfile"

image

  • Add more "Build steps" for each service. You can test is by clicking "Build Now" and checking the Jenkins console for the result.  

Deploy to K8S

  • Add "Build step" - > "Deploy to kubernetes"

image

  • Add the Kubernetes credentials from ~/.kube/config

image

  • Define the service YAML file. You can include multiple YAML files in the "Config Files" section

Deployment/YAML/webstore.yaml

  • Check the K8S cluster