0

I am creating four replicas of a deployment. The concern is that all pods go to different nodes. I have no PodAffinity defined. I have 4 nodes in my cluster and 3 master nodes. I have one deployment already running on one pod (only one replica), which occupies a node. Now, I am trying to deploy another deployment (4 replicas), which fails. Why is it not spreading pods on existing nodes in place of failing?

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: product-download-deployment-sslsigned-live
spec:
  replicas: 4
  template:
    metadata:
      labels:
        app: product-download-service-sslsigned-live
        color: blue
    spec:
      hostNetwork: true
      containers:
      - name: product-download-api
        image: 5648601107.dkr.ecr.us-west-2.amazonaws.com/pd_repo_8080
        ports:
        - containerPort: 8080
        volumeMounts:
        - name: pd-log-volume
          mountPath: /tmp/pd_log
        readinessProbe:
          tcpSocket:
           port: 8080
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          tcpSocket:
           port: 8080
          initialDelaySeconds: 15
          periodSeconds: 20    
      - name: nginxhttps
        image: 5648601107.dkr.ecr.us-west-2.amazonaws.com/nginx_ssl
        ports:
        - containerPort: 443
        readinessProbe:
          httpGet:
            path: /product-downloads/health
            port: 443
            scheme: HTTPS
          initialDelaySeconds: 5
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /product-downloads/health
            port: 443
            scheme: HTTPS
          initialDelaySeconds: 15
          periodSeconds: 20 
      volumes:
       - name: pd-log-volume
         hostPath:
           path: /var/log/pd
           type: DirectoryOrCreate

enter image description here

  • Possible duplicate of [How to force Pods/Deployments to Master nodes?](https://stackoverflow.com/questions/41999756/how-to-force-pods-deployments-to-master-nodes) – Janos Lenart Apr 16 '18 at 16:01
  • No, I don't want to force. I want them to share the nodes. –  Apr 16 '18 at 17:12
  • I get that, but the information you need is contained in the discussion there. You either need to add a *tolaration* in your Pods for the master's taint, or you need to remove the taint from your masters (using `kubectl taint nodes -l node-role.kubernetes.io/master node-role.kubernetes.io/master-`) – Janos Lenart Apr 16 '18 at 17:21

0 Answers0