How to deploy at least one pod per minion while configuring replication controller?

0 votes

I've got 4 nodes with label role=nginx

master ~ # kubectl get node
NAME          LABELS                                          STATUS
10.1.141.34   kubernetes.io/hostname=10.1.141.34,role=nginx   Ready
10.1.141.40   kubernetes.io/hostname=10.1.141.40,role=nginx   Ready
10.1.141.42   kubernetes.io/hostname=10.1.141.42,role=nginx   Ready
10.1.141.43   kubernetes.io/hostname=10.1.141.43,role=nginx   Ready

I have configured the selector to look for role=nginx

spec:
  replicas: 4
  selector:
    role: nginx

But when I deploy the controller it deploys 2 pods on 2 different hosts. I want it to deploy one pod each on each of the nodes? Please Help!

Nov 23, 2018 in Kubernetes by Atul
• 10,170 points
36 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

I think what you actually want to deploy is a daemon set. It's made for this exact purpose, ensuring one daemon/pod running on each of the nodes you specify.

Use something like this:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nginxDaemon
  labels:
    role: nginx
spec:
  selector:
    matchLabels:
      role: nginx

for more information check: DaemonSets

answered Nov 23, 2018 by ajs3033
• 7,000 points

Related Questions In Kubernetes

0 votes
1 answer
0 votes
1 answer

deleting pods using kubernetes replication controller

The pods which are managed by ReplicationController ...READ MORE

answered Jul 24, 2018 in Kubernetes by DareDev
• 6,520 points
124 views
0 votes
1 answer

Not able to access kubernetes api from a pod in azure

Follow these steps Add --bind-address=0.0.0.0 option to the line https://github.com/kubernetes/kubernetes/blob/v1.2.0/docs/getting-started-guides/coreos/azure/cloud_config_templates/kubernetes-cluster-main-nodes-template.yml#L218  Created ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 35,640 points
30 views
0 votes
2 answers

Deny access to some specific paths while using kubernetes ingress

Try to create two Ingresses first by default ...READ MORE

answered Sep 21, 2018 in Kubernetes by Nilesh
• 6,900 points
386 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
429 views
+3 votes
1 answer
0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,000 points
161 views
0 votes
2 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.