I use kubernetes-cd plugin in Jenkins (https://plugins.jenkins.io/kubernetes-cd/) to deploy my application successfully.
But, I got a problem, when I re-run the job again, the jenkins doesn't update my pod (doesn't delete and create new pod again), so my changes of code aren't affected. And after I delete the pod manual using kubectl commands in kubernetes cluster and re-run the job, it make changes
Below is my yaml file. Do you know how to fix this ?
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: tds-upload
name: tds-upload
spec:
replicas: 1
selector:
matchLabels:
app: tds-upload
template:
metadata:
labels:
app: tds-upload
spec:
containers:
- image: dev-master:5000/tds-upload:1.0.0
imagePullPolicy: Always
name: tds-upload
---
apiVersion: v1
kind: Service
metadata:
labels:
app: tds-upload
name: tds-upload
spec:
ports:
- nodePort: 31313
port: 8889
protocol: TCP
targetPort: 8889
selector:
app: tds-upload
type: NodePort
