NOTE:

For demonstration purposes only, not for use in production. 

Refer the following documentation for detailed information:

https://oracle.github.io/weblogic-kubernetes-operator/


 

WebLogic Server deployment on a Kubernetes cluster using WKO involves the following tasks:

1. Download, Install and Configure WebLogic Kubernetes Operator

 – Create a namespace – “sample-weblogic-operator-ns”

 – Create a Service Account – “sample-weblogic-operator-sa”

 – Add a repo and install Operator using Helm – “sample-weblogic-operator”

2. Download, Install and Configure Traefik

 – Create a namespace – “Traefik”

 – Add a repo and install Traefik using Helm – “traefik-operator”

3. Download and Install WebLogic Server from Oracle Container Registry (OCR) 

 – Create a namespace – “sample-domain1-ns”

 – Configure Traefik to manage ingresses created

 – Create a secret which contains username and password to login and pull WebLogic Server image from Oracle Container Registry (OCR) – “weblogic-repo-credentials”

4. Create and configure a WebLogic Server Domain

 – Create a kubernetes secret for domain which contains the WebLogic Server Admin username and password – “sample-domain1-weblogic-credentials”

 – Create a domain runtime encryption secret. – “sample-domain1-runtime-encryption-secret”

 – Create a sample WebLogic Server domain – “sample-domain1” with wls cluster “sample-domain1-cluster-1”

 – Create ingress route for WebLogic domain


 

1. Download, Install and Configure WebLogic Kubernetes Operator

 

Step 1.1:

Create a namespace, say “sample-weblogic-operator-ns” for WebLogic Kubernetes Operator: 

kubectl create namespace sample-weblogic-operator-ns

 

Step 1.2:

Create a ServiceAccount, say “sample-weblogic-operator-sa” in Operator namespace “sample-weblogic-operator-ns”

kubectl create serviceaccount -n sample-weblogic-operator-ns sample-weblogic-operator-sa

 

Step 1.3:

Add repo and install Weblogic Kubernetes Operator using Helm

helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts –force-update  
helm install sample-weblogic-operator weblogic-operator/weblogic-operator –namespace sample-weblogic-operator-ns –set serviceAccount=sample-weblogic-operator-sa –wait

 

OR 

If you want to use a custom build WKO image or pull the image from another repository:

 

Example:

helm install sample-weblogic-operator kubernetes/charts/weblogic-operator –set image=ghcr.io/thelearnloop/exploringkubernetes/weblogic-kubernetes-operator:4.1.6 –namespace sample-weblogic-operator-ns –set serviceAccount=sample-weblogic-operator-sa  –wait

 

https://blogs.oracle.com/blogbypuneeth/post/build-weblogic-kubernetes-operator-wko-source-code-using-maven

 

Verify if the pods were created successfully:

kubectl get pods -n sample-weblogic-operator-ns

 

kubectl logs -n sample-weblogic-operator-ns -c weblogic-operator deployments/weblogic-operator

 

2. Download, Install and Configure Traefik

 

Step 2.1:

Create a namespace for Traefik, say “traefik”

kubectl create namespace traefik

 

Step 2.2:

Add repo and install Traefik:

helm repo add traefik https://helm.traefik.io/traefik –force-update

 

helm install traefik-operator traefik/traefik –namespace traefik –set “ports.web.nodePort=30305” –set “ports.websecure.nodePort=30443” –set “kubernetes.namespaces={traefik}”

 

OR

 

If you want to pull Traefik image from a different repository:

 

Example:

helm install traefik-operator traefik/traefik –namespace traefik –set “ports.web.nodePort=30305” –set “ports.websecure.nodePort=30443” –set “kubernetes.namespaces={traefik}” –set image.registry=ghcr.io –set image.repository=thelearnloop/exploringkubernetes/traefik –set image.tag=v2.10.4

 

3. Download and Install WebLogic Server from Oracle Container Registry (OCR) 

 

Step 3.1:

Create a namespace for WebLogic Server, say “sample-domain1-ns”

kubectl create namespace sample-domain1-ns

This namespace can host one or more domains. Set a label “weblogic-operator=enabled” to this namespace.

kubectl label ns sample-domain1-ns weblogic-operator=enabled

 

Step 3.2:

Configure Traefik to manage ingresses created in this namespace.

helm upgrade traefik-operator traefik/traefik –namespace traefik –reuse-values –set “kubernetes.namespaces={traefik,sample-domain1-ns}”

 

Step 3.3:

Create a secret which contains username and password to pull WebLogic Server image from Oracle Container Registry (OCR)

kubectl create secret docker-registry weblogic-repo-credentials –docker-server=container-registry.oracle.com –docker-username=xxxx@oracle.com –docker-password=xxxx –docker-email=xxxx@oracle.com -n sample-domain1-ns

 

4. Create and configure a WebLogic Server Domain

 

Step 4.1:

Create a secret that holds WebLogic Server Admin username and password

kubectl create secret generic sample-domain1-weblogic-credentials –from-literal=username=weblogic –from-literal=password=xxxx -n sample-domain1-ns

 

Step 4.2:

Create a secret that contains domain runtime encryption password

kubectl -n sample-domain1-ns create secret generic sample-domain1-runtime-encryption-secret –from-literal=password=xxxx

 

Step 4.3:

Create a domain, say “sample-domain1” with a WebLogic cluster, say “sample-domain1-cluster-1”

 

Verify if it was created successfully:

kubectl describe domain sample-domain1 -n sample-domain1-ns

 

kubectl get domain sample-domain1 -n sample-domain1-ns -o json | jq .status

 

kubectl get pods -n sample-domain1-ns

 

kubectl get services -n sample-domain1-ns

 

Step 4.4:

Create an ingress route for this domain

 

Access WebLogic console:

http://localhost:30305/console