is there a way to tell kubectl that my pods should only deployed on a certain instance pool?
For example:
nodeSelector: pool: poolname
Assumed i created already my pool with something like:
gcloud container node-pools create poolname --cluster=cluster-1 --num-nodes=10 --machine-type=n1-highmem-32
You can add the nodeSelector field to your Pod specification and specify the node labels you want the target node to have. Kubernetes only schedules the Pod onto nodes that have each of the labels you specify. See Assign Pods to Nodes for more information.
First of all you cannot “move” a pod from one node to another. You can only delete it from one node and have it re-created on another. To delete use the kubectl delete command. To ensure a pod lands on a specific node using node affinity/taints and tolerations.
A Node can have multiple pods, and the Kubernetes control plane automatically handles scheduling the pods across the Nodes in the cluster. The control plane's automatic scheduling takes into account the available resources on each Node.
Ok, i found out a solution:
gcloud creates a label for the pool name. In my manifest i just dropped that under the node selector. Very easy.
Here comes my manifest.yaml: i deploy ipyparallel with kubernetes
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ipengine spec: replicas: 1 template: metadata: labels: app: ipengine spec: containers: - name: ipengine image: <imageaddr.> args: - ipengine - --ipython-dir=/tmp/config/ - --location=ipcontroller.default.svc.cluster.local - --log-level=0 resources: requests: cpu: 1 #memory: 3Gi nodeSelector: #<labelname>:value cloud.google.com/gke-nodepool: pool-highcpu32
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With