See also
Summary
Here’s some insight into what’s happening under the covers during the Quick Start tutorial.
The Quick Start guide first installs the WebLogic Kubernetes Operator, then creates a domain using the Model in Image domain home source type.
- For a comparison of Model in Image to other domain home source types, see Choose a domain home source type.
- To learn more about Model in Image domains, see the detailed Model in Image user guide.
- Also recommended, review a detailed Model in Image sample here.
The WebLogic domain configuration is specified using the WebLogic Deployment Tool (WDT) model YAML file in a separate auxiliary image.
- The auxiliary image contains a WebLogic domain and WebLogic application defined by using WDT model YAML and application archive files.
- To learn more about auxiliary images, see the user guide.
- If you want to step through the auxiliary image creation process, follow the instructions in the Advanced do-it-yourself section.
The operator detects the domain and cluster resources, and deploys their WebLogic Server Administration Server and Managed Server pods.
Preparation - install required software
Install kubectl, Docker on Fedora
[dave@fedora ~]$ sudo yum install -y kubectl
[sudo] password for dave:
Kubernetes 15 kB/s | 9.9 kB 00:00
Dependencies resolved.
========================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================
Installing:
kubectl x86_64 1.29.2-150500.1.1 kubernetes 10 M
Transaction Summary
========================================================================================================================================
Install 1 Package
Total download size: 10 M
Installed size: 47 M
Downloading Packages:
kubectl-1.29.2-150500.1.1.x86_64.rpm 4.3 MB/s | 10 MB 00:02
----------------------------------------------------------------------------------------------------------------------------------------
Total 4.3 MB/s | 10 MB 00:02
Kubernetes 4.5 kB/s | 1.7 kB 00:00
Importing GPG key 0x9A296436:
Userid : "isv:kubernetes OBS Project <isv:kubernetes@build.opensuse.org>"
Fingerprint: DE15 B144 86CD 377B 9E87 6E1A 2346 54DA 9A29 6436
From : https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : kubectl-1.29.2-150500.1.1.x86_64 1/1
Verifying : kubectl-1.29.2-150500.1.1.x86_64 1/1
Installed:
kubectl-1.29.2-150500.1.1.x86_64
Complete!
[dave@fedora ~]$ kubectl cluster-info
E0302 10:33:57.899032 16797 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0302 10:33:57.899346 16797 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0302 10:33:57.900515 16797 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0302 10:33:57.900783 16797 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
E0302 10:33:57.902197 16797 memcache.go:265] couldn't get current server API group list: Get "http://localhost:8080/api?timeout=32s": dial tcp [::1]:8080: connect: connection refused
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server localhost:8080 was refused - did you specify the right host or port?
[dave@fedora ~]$ yum install bash-completion, etc.
[dave@fedora ~]$ sudo yum install -y bash-completion
Last metadata expiration check: 0:01:26 ago on Sat 02 Mar 2024 10:33:42 AM CET.
Package bash-completion-1:2.11-9.fc38.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[dave@fedora ~]$ echo 'source <(kubectl completion bash)' >>~/.bashrc
[dave@fedora ~]$ docker p[s
docker: 'p[s' is not a docker command.
See 'docker --help'
[dave@fedora ~]$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[dave@fedora ~]$ sudo systemctl start docker
[dave@fedora ~]$ sudo docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
[dave@fedora ~]$ sudo systemctl enable docker.service
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[dave@fedora ~]$ sudo systemctl enable containerd.service
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /usr/lib/systemd/system/containerd.service.
[dave@fedora ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[dave@fedora ~]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 9c7a54a9a43c 10 months ago 13.3kB
[dave@fedora ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
01a3a0f66b45 hello-world "/hello" 52 seconds ago Exited (0) 52 seconds ago sleepy_rhodes
4c9e871bc2b0 hello-world "/hello" 4 months ago Exited (0) 4 months ago naughty_nobel
Install minikube
[dave@fedora ~]$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 19.3M 100 19.3M 0 0 4897k 0 0:00:04 0:00:04 --:--:-- 4898k
[dave@fedora ~]$ sudo rpm -Uvh minikube-latest.x86_64.rpm
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:minikube-1.32.0-0 ################################# [100%]
For start of minikube verify the driver
~$ minikube profile list
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| Profile | VM Driver | Runtime | IP | Port | Version | Status | Nodes | Active |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| minikube | docker | docker | 192.168.49.2 | 8443 | v1.28.3 | Stopped | 1 | * |
[dave@fedora ~]$ minikube start --driver=docker
😄 minikube v1.32.0 on Fedora 38
✨ Using the docker driver based on user configuration
📌 Using Docker driver with root privileges
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
💾 Downloading Kubernetes v1.28.3 preload ...
> preloaded-images-k8s-v18-v1...: 403.35 MiB / 403.35 MiB 100.00% 2.72 Mi
> gcr.io/k8s-minikube/kicbase...: 453.90 MiB / 453.90 MiB 100.00% 2.86 Mi
🔥 Creating docker container (CPUs=2, Memory=3900MB) ...
🐳 Preparing Kubernetes v1.28.3 on Docker 24.0.7 ...
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔗 Configuring bridge CNI (Container Networking Interface) ...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎 Verifying Kubernetes components...
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
Install helm
[dave@fedora ~]$ kubectl create namespace sample-weblogic-operator-ns
namespace/sample-weblogic-operator-ns created
[dave@fedora ~]$ kubectl create serviceaccount -n sample-weblogic-operator-ns sample-weblogic-operator-sa
serviceaccount/sample-weblogic-operator-sa created
[dave@fedora ~]$ helm repo add weblogic-operator https://oracle.github.io/weblogic-kubernetes-operator/charts --force-update
bash: helm: command not found...
Install package 'helm' to provide command 'helm'? [N/y] y
* Waiting in queue...
* Loading list of packages....
The following packages have to be installed:
helm-3.11.1-1.fc38.x86_64 The Kubernetes Package Manager
Proceed with changes? [N/y] y
* Waiting in queue...
* Waiting for authentication...
* Waiting in queue...
* Downloading packages...
* Requesting data...
* Testing changes...
* Installing packages...
"weblogic-operator" has been added to your repositories
[dave@fedora ~]$ helm install sample-weblogic-operator weblogic-operator/weblogic-operator \
--namespace sample-weblogic-operator-ns \
--set serviceAccount=sample-weblogic-operator-sa \
--wait
NAME: sample-weblogic-operator
LAST DEPLOYED: Sat Mar 2 10:54:00 2024
NAMESPACE: sample-weblogic-operator-ns
STATUS: deployed
REVISION: 1
TEST SUITE: None
[dave@fedora ~]$ kubectl get pods -n sample-weblogic-operator-ns
NAME READY STATUS RESTARTS AGE
weblogic-operator-85cb6f9d8b-r6vrk 1/1 Running 0 96s
weblogic-operator-webhook-7c6cd97f67-dlw2p 1/1 Running 0 96s
[dave@fedora ~]$ kubectl logs -n sample-weblogic-operator-ns -c weblogic-operator deployments/weblogic-operator
Launching Oracle WebLogic Server Kubernetes Operator...
VM settings:
Max. Heap Size (Estimated): 10.73G
Using VM: Java HotSpot(TM) 64-Bit Server VM
{"timestamp":"2024-03-02T09:54:31.093569933Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.helpers.HealthCheckHelper","method":"createAndValidateKubernetesVersion","timeInMillis":1709373271093,"message":"Kubernetes version is: v1.28.3","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2024-03-02T09:54:31.193860709Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"logStartup","timeInMillis":1709373271193,"message":"Oracle WebLogic Kubernetes Operator, version: 4.1.8, implementation: 7abe1c872e14c58b07e4fc8750b46af1c1a25c17.7abe1c8, build time: 2024-01-30T20:19:12+0000","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2024-03-02T09:54:31.196011015Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"lambda$logStartup$0","timeInMillis":1709373271196,"message":"The following optional operator features are enabled: []","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2024-03-02T09:54:31.19825166Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"logStartup","timeInMillis":1709373271198,"message":"Operator namespace is: sample-weblogic-operator-ns","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2024-03-02T09:54:31.199235192Z","thread":1,"fiber":"","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$MainDelegateImpl","method":"logStartup","timeInMillis":1709373271199,"message":"Operator service account is: sample-weblogic-operator-sa","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2024-03-02T09:54:32.072311815Z","thread":60,"fiber":"-fiber-1 NOT_COMPLETE","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain$ReadResponseStep","method":"onSuccess","timeInMillis":1709373272072,"message":"The Custom Resource Definition (CRD) for domains.weblogic.oracle is not installed, waiting for 10 seconds for the CRD to be installed.","exception":"","code":"","headers":{},"body":""}
{"timestamp":"2024-03-02T09:54:42.477270833Z","thread":74,"fiber":"fiber-1 NOT_COMPLETE","namespace":"","domainUID":"","level":"INFO","class":"oracle.kubernetes.operator.OperatorMain","method":"logStartingLivenessMessage","timeInMillis":1709373282477,"message":"Starting operator liveness Thread","exception":"","code":"","headers":{},"body":""}
Install Traefik ingress controller
[dave@fedora ~]$ helm repo add traefik https://helm.traefik.io/traefik --force-update
"traefik" has been added to your repositories
[dave@fedora ~]$ kubectl create namespace traefik
namespace/traefik created
[dave@fedora ~]$ helm install traefik-operator traefik/traefik \
--namespace traefik \
--set "ports.web.nodePort=30305" \
--set "ports.websecure.nodePort=30443" \
--set "kubernetes.namespaces={traefik}"
NAME: traefik-operator
LAST DEPLOYED: Sat Mar 2 11:03:03 2024
NAMESPACE: traefik
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Traefik Proxy v2.11.0 has been deployed successfully on traefik namespace !
Prepare domain
[dave@fedora ~]$ kubectl create namespace sample-domain1-ns
namespace/sample-domain1-ns created
[dave@fedora ~]$ kubectl label ns sample-domain1-ns weblogic-operator=enabled
namespace/sample-domain1-ns labeled
[dave@fedora ~]$ helm upgrade traefik-operator traefik/traefik \
--namespace traefik \
--reuse-values \
--set "kubernetes.namespaces={traefik,sample-domain1-ns}"
Release "traefik-operator" has been upgraded. Happy Helming!
NAME: traefik-operator
LAST DEPLOYED: Sat Mar 2 11:05:34 2024
NAMESPACE: traefik
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
Traefik Proxy v2.11.0 has been deployed successfully on traefik namespace !
Configure Oracle Docker Registry - OCR
kubectl create secret docker-registry weblogic-repo-credentials \
--docker-server=container-registry.oracle.com \
--docker-username=YOUR_REGISTRY_USERNAME \
--docker-password=YOUR_REGISTRY_PASSWORD \
--docker-email=YOUR_REGISTRY_EMAIL \
-n sample-domain1-ns
Create domain
[dave@fedora ~]$ kubectl create secret generic sample-domain1-weblogic-credentials \
--from-literal=username=weblogic --from-literal=password=weblogic123 \
-n sample-domain1-ns
secret/sample-domain1-weblogic-credentials created
[dave@fedora ~]$ kubectl -n sample-domain1-ns create secret generic \
sample-domain1-runtime-encryption-secret \
--from-literal=password=weblogic123
secret/sample-domain1-runtime-encryption-secret created
[dave@fedora ~]$ kubectl apply -f https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/release/4.1/kubernetes/samples/quick-start/domain-resource.yaml
domain.weblogic.oracle/sample-domain1 created
cluster.weblogic.oracle/sample-domain1-cluster-1 created
[dave@fedora ~]$ kubectl describe domain sample-domain1 -n sample-domain1-ns
Name: sample-domain1
Namespace: sample-domain1-ns
Labels: weblogic.domainUID=sample-domain1
Annotations: <none>
API Version: weblogic.oracle/v9
Kind: Domain
Metadata:
Creation Timestamp: 2024-03-02T10:15:11Z
Generation: 1
Resource Version: 1828
UID: a1b57948-d186-4793-a2d2-a1628f4fdf48
Spec:
Clusters:
Name: sample-domain1-cluster-1
Configuration:
Model:
Auxiliary Images:
Image: phx.ocir.io/weblogick8s/quick-start-aux-image:v1
Domain Type: WLS
Runtime Encryption Secret: sample-domain1-runtime-encryption-secret
Override Distribution Strategy: Dynamic
Domain Home: /u01/domains/sample-domain1
Domain Home Source Type: FromModel
Failure Retry Interval Seconds: 120
Failure Retry Limit Minutes: 1440
Http Access Log In Log Home: true
Image: container-registry.oracle.com/middleware/weblogic:12.2.1.4
Image Pull Policy: IfNotPresent
Image Pull Secrets:
Name: weblogic-repo-credentials
Include Server Out In Pod Log: true
Introspect Version: 1
Max Cluster Concurrent Shutdown: 1
Max Cluster Concurrent Startup: 0
Max Cluster Unavailable: 1
Replace Variables In Java Options: false
Replicas: 1
Restart Version: 1
Server Pod:
Env:
Name: JAVA_OPTIONS
Value: -Dweblogic.StdoutDebugEnabled=false
Name: USER_MEM_ARGS
Value: -Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx512m
Resources:
Requests:
Cpu: 250m
Memory: 768Mi
Server Start Policy: IfNeeded
Web Logic Credentials Secret:
Name: sample-domain1-weblogic-credentials
Status:
Clusters:
Conditions:
Last Transition Time: 2024-03-02T10:15:12.031510Z
Status: False
Type: Available
Last Transition Time: 2024-03-02T10:15:12.031187Z
Status: False
Type: Completed
Observed Generation: 1
Servers:
Start Time: 2024-03-02T10:15:12.031167Z
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Created 19s weblogic.operator Domain sample-domain1 was created.
[dave@fedora ~]$ kubectl get domain sample-domain1 -n sample-domain1-ns -o json | jq .status
{
"clusters": [],
"conditions": [
{
"lastTransitionTime": "2024-03-02T10:15:12.031510Z",
"status": "False",
"type": "Available"
},
{
"lastTransitionTime": "2024-03-02T10:15:12.031187Z",
"status": "False",
"type": "Completed"
}
],
"observedGeneration": 1,
"servers": [],
"startTime": "2024-03-02T10:15:12.031167Z"
}
[dave@fedora ~]$ kubectl apply -f https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/release/4.1/kubernetes/samples/quick-start/domain-resource.yaml
^C
[dave@fedora ~]$ kubectl get domain sample-domain1 -n sample-domain1-ns -o json | jq .status
{
"clusters": [],
"conditions": [
{
"lastTransitionTime": "2024-03-02T10:15:12.031510Z",
"status": "False",
"type": "Available"
},
{
"lastTransitionTime": "2024-03-02T10:15:12.031187Z",
"status": "False",
"type": "Completed"
}
],
"observedGeneration": 1,
"servers": [],
"startTime": "2024-03-02T10:15:12.031167Z"
}
[dave@fedora ~]$ kubectl get domain sample-domain1 -n sample-domain1-ns -o jsonpath='{.status}'
{"clusters":[],"conditions":[{"lastTransitionTime":"2024-03-02T10:15:12.031510Z","status":"False","type":"Available"},{"lastTransitionTime":"2024-03-02T10:15:12.031187Z","status":"False","type":"Completed"}],"observedGenerationkubectl get pods -n sample-domain1-ns-02T10:15:12.031167Z"}[dave@fedora ~]$ kubectl get pods -n sample-domain1-ns
NAME READY STATUS RESTARTS AGE
sample-domain1-introspector-dtjdm 0/1 PodInitializing 0 92s
Create an ingress route for the domain - see
https://github.com/dveselka/weblogic/blob/master/k8s/quickstart/ingress-route.yaml$ cat ingress-route.yaml
# Copyright (c) 2022, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: console
namespace: sample-domain1-ns
spec:
routes:
- kind: Rule
match: PathPrefix(`/console`)
services:
- kind: Service
name: sample-domain1-admin-server
port: 7001
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: quickstart
namespace: sample-domain1-ns
spec:
routes:
- kind: Rule
match: PathPrefix(`/quickstart`)
services:
- kind: Service
name: sample-domain1-cluster-cluster-1
port: 8001
$ kubectl apply -f ingress-route.yaml \
--namespace sample-domain1-ns
ingressroute.traefik.containo.us/console created
ingressroute.traefik.containo.us/quickstart created
Access the quickstart app via minikube ip
[dave@fedora k8s]$ minikube ip
192.168.49.2
quickstart app test
dave@dave:~$ minikube ip
192.168.49.2
dave@dave:~$ curl -i http://192.168.49.2:30305/quickstart/
HTTP/1.1 200 OK
Content-Length: 274
Content-Type: text/html; charset=UTF-8
Date: Sat, 16 Mar 2024 08:21:15 GMT
Set-Cookie: JSESSIONID=tvhGWdirHtu2WJLNNeKG6OWs3z7wdMuR0Nhx79oRuplvGtWWExpX!-89486529; path=/; HttpOnly
X-Oracle-Dms-Ecid: 2b4a76f0-49ca-4bf7-88c2-8e483bd35400-0000004e
X-Oracle-Dms-Rid: 0
<!DOCTYPE html>
<html>
<body>
<h1>Welcome to the WebLogic on Kubernetes Quick Start Sample</font></h1><br>
<b>WebLogic Server Name:</b> managed-server1<br><b>Pod Name:</b> sample-domain1-managed-server1<br><b>Current time:</b> 08:21:17<br><p>
</body>
</html>