rakeshh92
rakeshh92

Reputation: 985

deployment not in nodeSelector kubernetes

I have a cluster having 2 nodes and one of the nodes is labelled as "SS" for node selector.

I have three services and one service should be deployed in node selector node(which is happening properly) and the other two services should be deployed in another node

How to deploy the remaining services should be deployed in a node(which is not been labelled)?

I don't want to use a node selector also for the other two services.

Upvotes: 3

Views: 1601

Answers (1)

hoque
hoque

Reputation: 6471

You can use Node Affinity

spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: <label-key>
            operator: NotIn
            values:
            - SS

Upvotes: 5

Related Questions