Jenkins pipeline jobs to deploy to kubernetes Jenkins pipeline jobs to deploy to kubernetes kubernetes kubernetes

Jenkins pipeline jobs to deploy to kubernetes


There is no better or worst way, but there is a way that works for your.

You can keep all your kubernetes file (yamls files) on a git repository, and them when you run the pipeline the Jenkins will retrive these repository to run.

I'm not sure why you are deleting the resources before apply, but if you are using a kind: deployment you can use the command kubectl apply with rollingUpdate strategy to avoid downtimes.

Here you can find a lot of useful information about deployment strategy with Jenkins.

Other useful links:

Kubernetes deployments

Jenkins K8s Plugin