How to use CI/CD using Jenkins in Google Kubernatives Engine. Leave a replyNote: Test everything before using it. Create an organization in Google Cloud Create a project under that organizationMain Steps: Package and deploy the app on google kubernatives engine. a) Package the app into a Docker image b) Run the container c) Upload image to a registry d) Create container cluster e) Deploy the app to the Cluster f) Expose the app to the Internet g) Scare up the deployment if required. h) Deploy new version using CI/CD – Jenkinsstep1:setting up project Enable the Google cloud API’s using the script attached. File Name: enable_api.shStep 2: Build the container image:export PROJECT_ID=[projectid] docker build -t gcr.io/${PROJECT_ID}/myapp:v1#verify the command is successfull docker imagesstep3: Upload the container image:configure docker to authenticate to container registry. gcloud auth configure-dockerupload the image to container registry docker push gcr.io/$PROJECT_ID/myapp:v1step4: Deploy the application kubectl create deployment myapp –image=gcr.io/$PROJECT_ID/myapp:v1step5: Expose the app to Internetkubectl expose deployment myapp -type=loadbalancer –port 80 –target-port 8080step6: scale up the application kubectl scale deployment myapp –replicas=3step7: use rolling update to the existing deployment with a new version kubectl set image deployment/myapp myapp=gcr.io/$PROJECT_ID/myapp:v2CI/CD STEPS:Push docker image to google container registry using Jenkinsstep1 #Installrequired Jenkins PluginsGoogle Oauth credentials PluginsDocker pipeline PluginsGoogle container registry Auth Pluginsstep 2 #Createservice account in GCPAttach roles – storage – storage admin & storage object viewerstep 3 #Jenkins – credentials- global credentials – Add credentials Select kind : Google service account from private keywe can use the json file which we get when we create a service accountstep 4: jenkins project > configure > Build > docker build and publishThe above steps helps to pull the code and push image to GCR repository.The script kube_deploy.sh will deploy the image to kubernatives cluster running on GCP Please use and comment in the github repo – https://github.com/linuxmaster007/GKE.git