Currently I am working with implementation demo of CI/CD pipeline using Jenkins and kubernetes. I am created one Jenkins pipeline job and added every step in my Jenkinsfile. For kubernetes , I created deployment and service YAML files for Kubernetes resources.
Image Version Management In deployment
For each commit in my SVN repository , I am creating docker images by adding the tag as build number through Jenkins environment variable.
image:1
image:2
.
.
image:n
Confusion
If I am using kubectl set image command for updating my deployment in my Jenkinsfile deployment stage , then It will work for first commit ?
I felt this confusion , because command says that it is for updating the deployment if there is change in image defined in YAML file. So If I am changing image for each commit according to build number( image-name:buildnumber) , then if there is no deployment exits , it will work for first time?
kubectl set imagefor first deployment in my pipeline.Can you look on question please? - Jacobkubectl applyor in case of second commitkubectl set imagewill work - damitj07