Scheduling pods to particular nodes
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:
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
:
- At the top-level
spec.severPodfor the entire domain - At
spec.adminServer.serverPodfor the Administration Server - At
spec.clusters[*].serverPodfor each cluster - At
spec.managedServers[*].serverPodfor individual Managed Servers
Under that level, you specify labels and values that match the labels on the nodes you want to select. For example:
For more details, see Assign Pods to Nodes in the Kubernetes documentation.