Test for DevOps by Han. How to use script to create docker image and deploy to Kubernetes using Jenkins pipeline
-
Install the latest versions of Docker, kubeadm, Kubectl and Jenkins
-
Clone this repository
How to use
- Add new credentials for Docker Hub with username/password
- Create new item. Provide a name for your new item (e.g. Assignment-node-app) and select Pipeline
- Click This project is parameterized and add 2 String parameter
- Click Pipeline tab
- Definition select Pipeline script from SCM
- SCM select Git and Repository URL :https://github.com/aihan/Assignment1.git
- Script Path : pipeline/Jenkinfile
- Click Build with Parameters
- Check required parameter and Click Build
- If the job status is success, all stage color would be green.
- Click Console Output to see the full output from the Pipeline run. The following output shows a successful run of your Pipeline.

- Open Kubernetes dashboard you will see node-app in deployment , pod and service with relate to node-app from jenkins pipeline deployment
- Open Browser enter endpoint service URL you will got response