Selecting the Kubernetes nodes in which WebLogic Server pods run


Recently, Oracle updated the licensing policies for running Oracle software in Kubernetes clusters as stated here.

NOTE: Regarding licensing matters, please always verify with the official sources because the information here can be inaccurate or may fall obsolete someday.

In this post we are explaining how to proceed when we are running WLS on K8S leveraging WebLogic Kubernetes Operator

STEP 1: get node information

kubecetl get nodes -o wide

STEP 2: get pods in the namespace

kubectl get po -o wide

STEP 3: label nodes in which we want to run Oracle software

The label can be whatever pair key=value you can imagine just by following how nodeSelectors work and the WebLogic Kubernetes Operator domain resource

kubectl label node 10.0.10.37 license=oracle
kubectl label node 10.0.10.38 license=oracle

STEP 4: edit domain

As the mentioned document states, the“serverPod” element may be applied to following scopes:

  • —  spec.serverPod – for domain wide settings
  • —  spec.adminServer.serverPod – for settings that are applied to the WebLogic Admin Server
  • —  spec.clusters[*].serverPod – for settings that are applied to named clusters
  • —  spec.managedServer[*].serverPod – for settings that are applied to named WebLogic Managed Servers
kubectl edit domain <yourdomainname>

In this particular case we are putting it at cluster level

STEP 5: make some changes in the desired state of the domain

For instance stop and start, add more replicas, …

STEP 6: verify

kubectl get po -o wide

As you can see all the pods are running in the labeled nodes!

That’s all, hope it helps!! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.