Deploy daemonset as the first deployment in kubernetes

10/10/2019

i am learning kubernetes in google cloud right now with Kubernetes 1.12 version

I deployed a daemonset and then suddently the daemonset is in pending situation. This is caused by insufficient resources quota.

I can solve that by adding more nodes in my cluster. However, i'm curious about how to deploy the daemonsets as a first deploy rather than other deployments ?

Have read the documentation but i still can not find out the solution.

-- Nicky Puff
google-kubernetes-engine
kubernetes

2 Answers

10/11/2019

There are ways to do it.

  1. You can use pod priority in your pod definition.You need to define pod priority for your daemonsets.https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/

  2. Try to deploy these daemonsets before all deployments.

  3. Define Helm charts and deploy chart before other deployments helm charts.

  4. Lets say you have all the deployments and daemonsets in one helm chart, then add file naming convention as 0-daemonsets.yaml , 1-deployments.yaml . If you do like this 0-daemonsets.yaml will get deployed first followed by 1-deployments.yaml.

-- Sachin Arote
Source: StackOverflow

10/10/2019

I suppose you are using a small compute size for your cluster, with only one or two computes.

To answer the question, no you can't have the first deployment in Kubernetes, some System deployment already exists when you launch your cluster, you can see them doing a : kubectl -n kube-system get deployment

You could also look for pod and you can confirm your cluster status using kubectl top node.

Upgrading the compute type you are using is a good idea at first, having more node is also a good solution.

-- night-gold
Source: StackOverflow