How do I constrain scheduling WebLogic Server pods to a particular set of nodes?
To do this:
First, set a label on the nodes on which the WebLogic Server pods will run. For example:
$ kubectl label nodes name=weblogic-pods
In the Domain CR, set a nodeSelector
: a selector which must match a node’s labels for the pod to be scheduled on that node. See kubectl explain pods.spec.nodeSelector
.
You can set nodeSelector
labels for WebLogic Server pods, all server pods in a cluster, or all server pods in a domain. nodeSelector
is a field under the serverPod
element, which occurs at several points in the Domain CR schema:
spec.severPod
for the entire domainspec.adminServer.serverPod
for the Administration Serverspec.clusters[*].serverPod
for each clusterspec.managedServers[*].serverPod
for individual Managed Serversspec:
serverPod:
nodeSelector:
Under that level, you specify labels and values that match the labels on the nodes you want to select. For example:
nodeSelector:
name: weblogic-pods
For more details, see Assign Pods to Nodes in the Kubernetes documentation.