Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-07 Thread mderosa83
With Daemonset now everything is working properly. Anyway I'm using Kubernetes 1.8.1-gke.1 -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-07 Thread Rodrigo Campos
Oh, I thought you wanted on different hosts but not as many pods as hosts. If you want that's daemonset guarantees that (even if more nodes are created later, etc.) And what Kubernetes version are you using? There is some kind of support to upgrade them in recent versions IIRC (not used that more

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-07 Thread mderosa83
Today during a deploy I get a pod with 2 containers -,- I can confirm that the best solution to make sure you have only one pod per node is using the DaemonSet. Unfortunately using the approach to reapply the deployment yaml does not guarantee that after deployment each node has only a single po

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-05 Thread Rodrigo Campos
Cool. Take into account that daemon set it is created to guarantee having exactly one pod per node. For example, if you had more nodes, more pods for a daemonset will be added. And the same if some crash or you reduce. If that fits better what you want (sorry I didn't understood before), then don'

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-05 Thread mderosa83
As I said before, using multiple times the command "kubectl apply -f my-deployment.yaml" (changing from time to time the image version inside the yaml) I noticed that Kubernetes never deploys 2 pod in a same node. I tested this behavior many times so yes it's working as I need :) If I had proble

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread Rodrigo Campos
It's working as you need? :) On Monday, December 4, 2017, wrote: > thank you all for the support ;-) > > -- > You received this message because you are subscribed to the Google Groups > "Kubernetes user discussion and Q&A" group. > To unsubscribe from this group and stop receiving emails from it

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
thank you all for the support ;-) -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscr...@googlegroups.com. To post to

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread Itamar O
If your only requirements is to have one pod per node, then I think the best solution, as Tim suggested, is a Daemon Set ( https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/). And yes, it's perfectly reasonable to edit and reapply YAML's. On Mon, Dec 4, 2017, 18:45 wrote: > So

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
So re-apply the deployment.yaml is an acceptable solution considering that my only requirement is have one pod for node? Unfortunately I have a very close due date so I would like to find the faster-simpler and quite stable solution to do a code upgrade :) -- You received this message becau

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread Rodrigo Campos
The scheduler makes the decision trying to spread the pods on nodes as you say. But that is just a "signal", other things are taken into account (pods availability zone, in case of AWS, for example, to spread across AZs too) node's resources, etc. So, the default will try to do that, taking into a

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
I tried some solutions and one that is working at the moment is simply based to change my deployment.yaml every time. I mean: 1) I have to deploy for the 1' time my application based on a pod with some containers. These pods should be deployed on every cluster node (I have 3 nodes). I did the d

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread
Would you prefer a Daemon set instead? On Dec 4, 2017 7:28 AM, "Itamar O" wrote: > I'm guessing you have as many replicas as you have nodes, and you used the > "required" affinity policy over the "preferred" one. > If this is the case, then when you try to update the deployment (with the > defau

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread Itamar O
I'm guessing you have as many replicas as you have nodes, and you used the "required" affinity policy over the "preferred" one. If this is the case, then when you try to update the deployment (with the default upgrade strategy), the controller tries the schedule a *4th pod* (with the new image) bef

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
Sorry but now I'm facing another problem :-( The deployment with the options podAntiAffinity/podAffinity is working but when I try to update the deployment with the command: kubectl set image deployment/apache-deployment apache-container=xx:v2.1.2 then I get this error: apache-deployment-7c

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
At https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity there is an example (perfect for my case) where 2 files yaml are used: one for redis-cache and the other for web-store. Anyway I'll try to concatenate them. Thanks -- You received this message beca

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread Itamar O
Not sure where you have 2 YAML's (since you specify the afiinity under the deployment template spec), but if you end up with the need for multiple YAML's you can always concatenate them to a single file by separating with "---". On Mon, Dec 4, 2017 at 1:41 PM wrote: > I'm reading the documentati

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
I'm reading the documentation and it's just what I was looking for. Many thanks! But is there a way to create a single yaml deployment file to ensure that every pod will be deployed in a single node? So a single file to be executed and not 2 different yaml files as in the example -- You receiv

Re: [kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread Itamar O
I think that if you create a service that matches the pods of the deployment, K8s will attempt to spread out the pods by default. Also, check out "pod anti-affinity" ( https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature ). On Mon, De

[kubernetes-users] How to force Kubernetes to update deployment with a pod in every node

2017-12-04 Thread mderosa83
Hi all! I would like to know if there is a way to force Kubernetes, during a deploy, to use every node in the cluster. The question is due some attempts that I have done where I noticed a situation like this: - a cluster of 3 nodes - I update a deployment with a command like: kubectl set image