In this challenge we will:
- Install a Jenkins from Helm Chart
- Build the images from GitHub repo.
- Push the images to Docker Hub.
- Execute YAML deployment files in the K8S cluster from the Jenkins pipeline.
helm install --name jenkins-release -f values.yaml stable/jenkins
-
fork git repo
https://github.com/<your-username>/k8s-workshop-microservices.git
-
Create a new "Freestyle Project"
- 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"
- Create a build step "Docker Build and Publish"
- Enter the repo name and tag
- Add your Docker Hub credentials by clicking on "Add" in "Registry Credentials
- 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"
- Add more "Build steps" for each service. You can test is by clicking "Build Now" and checking the Jenkins console for the result.
- Add "Build step" - > "Deploy to kubernetes"
- Add the Kubernetes credentials from ~/.kube/config
- Define the service YAML file. You can include multiple YAML files in the "Config Files" section
Deployment/YAML/webstore.yaml
- Check the K8S cluster