kubernetes rolling updates not creating new podsKubectl apply for a deployment with revHistoryLimit 0 does not delete the old replica set, here is my deploment templateHow to start a pod in command line without deployment in kubernetes?How to map one single file into kubernetes pod using hostPath?Private repository passing through kubernetes yaml fileKubernetes doesn't allow to mount file to containerForbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbiddenHow to mount a volume with a windows container in kubernetes?Share nfs volume between kubernetes clusterskubernetes deployment with argskubernetes springboot app connect to external database is fail
ExactlyOne extension method
German phrase for 'suited and booted'
What exactly makes a General Products hull nearly indestructible?
dos2unix is unable to convert typescript file to unix format
Extrapolation v. Interpolation
Why is the UH-60 tail rotor canted?
"It is what it is" in French
Mavensmate: Getting error client identifier invalid while authentication to salesforce
Using paddles to support a bug net
Why do people say "I am broke" instead of "I am broken"?
Can't understand how static works exactly
Why can't a country print its own money to spend it only abroad?
What's the 1 inch size square knob sticking out of wall?
How can the artificial womb be made affordable for the common people?
Does Impedance Matching Imply any Practical RF Transmitter Must Waste >=50% of Energy?
Killing a star safely
How can Kazakhstan perform MITM attacks on all HTTPS traffic?
Are symplectomorphisms of Weil–Petersson symplectic form induced from surface diffeomorphisms?
In a script how can I signal who's winning the argument?
What is the spanish equivalent of "the boys are sitting"?
What is a "staved" town, like in "Staverton"?
High income and difficulty during interviews
what to say when a company asks you why someone (a friend) who was fired left?
Is a sentence true for two substructures also true for their intersection?
kubernetes rolling updates not creating new pods
Kubectl apply for a deployment with revHistoryLimit 0 does not delete the old replica set, here is my deploment templateHow to start a pod in command line without deployment in kubernetes?How to map one single file into kubernetes pod using hostPath?Private repository passing through kubernetes yaml fileKubernetes doesn't allow to mount file to containerForbidden: updates to statefulset spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbiddenHow to mount a volume with a windows container in kubernetes?Share nfs volume between kubernetes clusterskubernetes deployment with argskubernetes springboot app connect to external database is fail
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Below is my deployment file. I am trying to bring up new pod and bring down old pod using rolling update of kubernetes. I get a success message as
deployment "gql-deployment" successfully rolled out but pod remains as it is.
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gql-deployment
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: gql-pod
spec:
containers:
- name: gql-cont
image: bitnami/nginx:1.14
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 512Mi
cpu: 500m
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
step1:
kubectl apply -f deployment.yaml
Step2: I change the image name to
bitnami/nginx:1.14.2
Step3:
kubectl rollout status deployment.v1beta1.extensions/gql-deployment
I get message like deployment "gql-deployment" successfully rolled out
But pod names remains same. Am i missing some step?
|
show 2 more comments
Below is my deployment file. I am trying to bring up new pod and bring down old pod using rolling update of kubernetes. I get a success message as
deployment "gql-deployment" successfully rolled out but pod remains as it is.
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gql-deployment
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: gql-pod
spec:
containers:
- name: gql-cont
image: bitnami/nginx:1.14
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 512Mi
cpu: 500m
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
step1:
kubectl apply -f deployment.yaml
Step2: I change the image name to
bitnami/nginx:1.14.2
Step3:
kubectl rollout status deployment.v1beta1.extensions/gql-deployment
I get message like deployment "gql-deployment" successfully rolled out
But pod names remains same. Am i missing some step?
What commands/steps are you using to update the image name? Can you provide the return ofkubectl rollout history deployment/gql-deployment?
– Eduardo Baitello
Mar 22 at 17:12
@EduardoBaitello - In Step2, i update the deployment.yaml file manually. Is this the right way ti change image? Below is what i get using history command. REVISION CHANGE-CAUSE 1 <none>
– Hacker
Mar 23 at 2:31
1
you need tokubectl apply -fthe file again after changing it. Kubernetes doesn't watch the manifest files used to create the resources, you need to tell it for the apiserver every time.
– Eduardo Baitello
Mar 23 at 10:55
@EduardoBaitello - But if i apply, it would go for direct deployment right? When do i run rollout command?
– Hacker
Mar 23 at 11:41
Hacker, there is no need to run an explicit rollout command. The configuredstrategyfor your deployment isRollingUpdate, so any changes on.spec.template(this includes containers images) will trigger a rollout automatically.
– Eduardo Baitello
Mar 23 at 13:05
|
show 2 more comments
Below is my deployment file. I am trying to bring up new pod and bring down old pod using rolling update of kubernetes. I get a success message as
deployment "gql-deployment" successfully rolled out but pod remains as it is.
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gql-deployment
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: gql-pod
spec:
containers:
- name: gql-cont
image: bitnami/nginx:1.14
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 512Mi
cpu: 500m
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
step1:
kubectl apply -f deployment.yaml
Step2: I change the image name to
bitnami/nginx:1.14.2
Step3:
kubectl rollout status deployment.v1beta1.extensions/gql-deployment
I get message like deployment "gql-deployment" successfully rolled out
But pod names remains same. Am i missing some step?
Below is my deployment file. I am trying to bring up new pod and bring down old pod using rolling update of kubernetes. I get a success message as
deployment "gql-deployment" successfully rolled out but pod remains as it is.
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: gql-deployment
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
metadata:
labels:
app: gql-pod
spec:
containers:
- name: gql-cont
image: bitnami/nginx:1.14
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
memory: 512Mi
cpu: 500m
limits:
memory: 512Mi
cpu: 500m
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
step1:
kubectl apply -f deployment.yaml
Step2: I change the image name to
bitnami/nginx:1.14.2
Step3:
kubectl rollout status deployment.v1beta1.extensions/gql-deployment
I get message like deployment "gql-deployment" successfully rolled out
But pod names remains same. Am i missing some step?
asked Mar 22 at 14:30
HackerHacker
3,56911 gold badges58 silver badges115 bronze badges
3,56911 gold badges58 silver badges115 bronze badges
What commands/steps are you using to update the image name? Can you provide the return ofkubectl rollout history deployment/gql-deployment?
– Eduardo Baitello
Mar 22 at 17:12
@EduardoBaitello - In Step2, i update the deployment.yaml file manually. Is this the right way ti change image? Below is what i get using history command. REVISION CHANGE-CAUSE 1 <none>
– Hacker
Mar 23 at 2:31
1
you need tokubectl apply -fthe file again after changing it. Kubernetes doesn't watch the manifest files used to create the resources, you need to tell it for the apiserver every time.
– Eduardo Baitello
Mar 23 at 10:55
@EduardoBaitello - But if i apply, it would go for direct deployment right? When do i run rollout command?
– Hacker
Mar 23 at 11:41
Hacker, there is no need to run an explicit rollout command. The configuredstrategyfor your deployment isRollingUpdate, so any changes on.spec.template(this includes containers images) will trigger a rollout automatically.
– Eduardo Baitello
Mar 23 at 13:05
|
show 2 more comments
What commands/steps are you using to update the image name? Can you provide the return ofkubectl rollout history deployment/gql-deployment?
– Eduardo Baitello
Mar 22 at 17:12
@EduardoBaitello - In Step2, i update the deployment.yaml file manually. Is this the right way ti change image? Below is what i get using history command. REVISION CHANGE-CAUSE 1 <none>
– Hacker
Mar 23 at 2:31
1
you need tokubectl apply -fthe file again after changing it. Kubernetes doesn't watch the manifest files used to create the resources, you need to tell it for the apiserver every time.
– Eduardo Baitello
Mar 23 at 10:55
@EduardoBaitello - But if i apply, it would go for direct deployment right? When do i run rollout command?
– Hacker
Mar 23 at 11:41
Hacker, there is no need to run an explicit rollout command. The configuredstrategyfor your deployment isRollingUpdate, so any changes on.spec.template(this includes containers images) will trigger a rollout automatically.
– Eduardo Baitello
Mar 23 at 13:05
What commands/steps are you using to update the image name? Can you provide the return of
kubectl rollout history deployment/gql-deployment?– Eduardo Baitello
Mar 22 at 17:12
What commands/steps are you using to update the image name? Can you provide the return of
kubectl rollout history deployment/gql-deployment?– Eduardo Baitello
Mar 22 at 17:12
@EduardoBaitello - In Step2, i update the deployment.yaml file manually. Is this the right way ti change image? Below is what i get using history command. REVISION CHANGE-CAUSE 1 <none>
– Hacker
Mar 23 at 2:31
@EduardoBaitello - In Step2, i update the deployment.yaml file manually. Is this the right way ti change image? Below is what i get using history command. REVISION CHANGE-CAUSE 1 <none>
– Hacker
Mar 23 at 2:31
1
1
you need to
kubectl apply -f the file again after changing it. Kubernetes doesn't watch the manifest files used to create the resources, you need to tell it for the apiserver every time.– Eduardo Baitello
Mar 23 at 10:55
you need to
kubectl apply -f the file again after changing it. Kubernetes doesn't watch the manifest files used to create the resources, you need to tell it for the apiserver every time.– Eduardo Baitello
Mar 23 at 10:55
@EduardoBaitello - But if i apply, it would go for direct deployment right? When do i run rollout command?
– Hacker
Mar 23 at 11:41
@EduardoBaitello - But if i apply, it would go for direct deployment right? When do i run rollout command?
– Hacker
Mar 23 at 11:41
Hacker, there is no need to run an explicit rollout command. The configured
strategy for your deployment is RollingUpdate, so any changes on .spec.template (this includes containers images) will trigger a rollout automatically.– Eduardo Baitello
Mar 23 at 13:05
Hacker, there is no need to run an explicit rollout command. The configured
strategy for your deployment is RollingUpdate, so any changes on .spec.template (this includes containers images) will trigger a rollout automatically.– Eduardo Baitello
Mar 23 at 13:05
|
show 2 more comments
2 Answers
2
active
oldest
votes
For Step 2 you should do
kubectl set image deployment.v1.apps/gql-deployment gql-cont=nginx:1.14.2 --record=true
As you can see on the screenshot below old pod is terminated and new one with image 1.14.2 has been started
A rollout history also shows a successful update

Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?kubectl describe pod <pod-name>
– A_Suh
Mar 26 at 15:29
add a comment |
Deployment is working properly with "nginx" images. I would suggest to test "readinessProbe" with different images. Hope this help.
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:kubectl get pods,deploy,rskubectl describe pod your_pod(please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition:kubectl rollout status your_deploymentkubectl rollout history your_deploymentkubectl logs pod your_pod
– Hanx
Mar 24 at 20:09
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55301854%2fkubernetes-rolling-updates-not-creating-new-pods%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
For Step 2 you should do
kubectl set image deployment.v1.apps/gql-deployment gql-cont=nginx:1.14.2 --record=true
As you can see on the screenshot below old pod is terminated and new one with image 1.14.2 has been started
A rollout history also shows a successful update

Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?kubectl describe pod <pod-name>
– A_Suh
Mar 26 at 15:29
add a comment |
For Step 2 you should do
kubectl set image deployment.v1.apps/gql-deployment gql-cont=nginx:1.14.2 --record=true
As you can see on the screenshot below old pod is terminated and new one with image 1.14.2 has been started
A rollout history also shows a successful update

Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?kubectl describe pod <pod-name>
– A_Suh
Mar 26 at 15:29
add a comment |
For Step 2 you should do
kubectl set image deployment.v1.apps/gql-deployment gql-cont=nginx:1.14.2 --record=true
As you can see on the screenshot below old pod is terminated and new one with image 1.14.2 has been started
A rollout history also shows a successful update

For Step 2 you should do
kubectl set image deployment.v1.apps/gql-deployment gql-cont=nginx:1.14.2 --record=true
As you can see on the screenshot below old pod is terminated and new one with image 1.14.2 has been started
A rollout history also shows a successful update

edited Mar 26 at 15:20
answered Mar 26 at 10:53
A_SuhA_Suh
1,4271 silver badge7 bronze badges
1,4271 silver badge7 bronze badges
Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?kubectl describe pod <pod-name>
– A_Suh
Mar 26 at 15:29
add a comment |
Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?kubectl describe pod <pod-name>
– A_Suh
Mar 26 at 15:29
Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
Even if i remove rolling updates, it works same. So why do i need to add rolling updates?
– Hacker
Mar 26 at 15:18
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?
kubectl describe pod <pod-name>– A_Suh
Mar 26 at 15:29
@Hacker it looks like your pod is not ready. Are you sure your readinessProbe did not fail? Can you please update your post with pod description?
kubectl describe pod <pod-name>– A_Suh
Mar 26 at 15:29
add a comment |
Deployment is working properly with "nginx" images. I would suggest to test "readinessProbe" with different images. Hope this help.
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:kubectl get pods,deploy,rskubectl describe pod your_pod(please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition:kubectl rollout status your_deploymentkubectl rollout history your_deploymentkubectl logs pod your_pod
– Hanx
Mar 24 at 20:09
add a comment |
Deployment is working properly with "nginx" images. I would suggest to test "readinessProbe" with different images. Hope this help.
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:kubectl get pods,deploy,rskubectl describe pod your_pod(please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition:kubectl rollout status your_deploymentkubectl rollout history your_deploymentkubectl logs pod your_pod
– Hanx
Mar 24 at 20:09
add a comment |
Deployment is working properly with "nginx" images. I would suggest to test "readinessProbe" with different images. Hope this help.
Deployment is working properly with "nginx" images. I would suggest to test "readinessProbe" with different images. Hope this help.
answered Mar 22 at 19:50
HanxHanx
5268 bronze badges
5268 bronze badges
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:kubectl get pods,deploy,rskubectl describe pod your_pod(please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition:kubectl rollout status your_deploymentkubectl rollout history your_deploymentkubectl logs pod your_pod
– Hanx
Mar 24 at 20:09
add a comment |
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:kubectl get pods,deploy,rskubectl describe pod your_pod(please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition:kubectl rollout status your_deploymentkubectl rollout history your_deploymentkubectl logs pod your_pod
– Hanx
Mar 24 at 20:09
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
It failed with my regular image, so tried testing with nginx. Am i missing any step?
– Hacker
Mar 23 at 2:34
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:
kubectl get pods,deploy,rs kubectl describe pod your_pod (please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition: kubectl rollout status your_deployment kubectl rollout history your_deployment kubectl logs pod your_pod– Hanx
Mar 24 at 20:09
You can apply your deployment as described above: kubectl apply -f your_deployment.yaml It would be great to have more details:
kubectl get pods,deploy,rs kubectl describe pod your_pod (please take a look also for: Limits:"Cpu and Memory", Image, events, Readiness. In addition: kubectl rollout status your_deployment kubectl rollout history your_deployment kubectl logs pod your_pod– Hanx
Mar 24 at 20:09
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55301854%2fkubernetes-rolling-updates-not-creating-new-pods%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What commands/steps are you using to update the image name? Can you provide the return of
kubectl rollout history deployment/gql-deployment?– Eduardo Baitello
Mar 22 at 17:12
@EduardoBaitello - In Step2, i update the deployment.yaml file manually. Is this the right way ti change image? Below is what i get using history command. REVISION CHANGE-CAUSE 1 <none>
– Hacker
Mar 23 at 2:31
1
you need to
kubectl apply -fthe file again after changing it. Kubernetes doesn't watch the manifest files used to create the resources, you need to tell it for the apiserver every time.– Eduardo Baitello
Mar 23 at 10:55
@EduardoBaitello - But if i apply, it would go for direct deployment right? When do i run rollout command?
– Hacker
Mar 23 at 11:41
Hacker, there is no need to run an explicit rollout command. The configured
strategyfor your deployment isRollingUpdate, so any changes on.spec.template(this includes containers images) will trigger a rollout automatically.– Eduardo Baitello
Mar 23 at 13:05