Create a domain
Create the domain using a domain resource.
-
Select a user name and password for the WebLogic domain administrator credentials and use them to create a Kubernetes Secret for the domain.
Replace
ADMIN_USERNAMEandADMIN_PASSWORDwith your choice of user name and password. Note that the password must be at least 8 characters long and must contain at least one non-alphabetical character. -
Create a domain runtime encryption secret.
These two commands create secrets named
sample-domain1-weblogic-credentialsandsample-domain1-runtime-encryption-secretused in the sample domain YAML file. If you want to use different secret names, then you will need to update the sample domain YAML file accordingly in the next step. -
Create the
sample-domain1domain resource and an associatedsample-domain1-cluster-1cluster resource using a single YAML resource file which defines both resources. The domain resource and cluster resource do not replace the traditional WebLogic configuration files, but instead cooperates with those files to describe the Kubernetes artifacts of the corresponding domain.-
Use the following command to apply the two sample resources.
-
NOTE: If you want to view or need to modify it, you can download the sample domain resource to a file called
/tmp/quickstart/domain-resource.yamlor similar. Then apply the file usingkubectl apply -f /tmp/quickstart/domain-resource.yaml.
The domain resource references the cluster resource, a WebLogic Server installation image, the secrets you defined, and a sample “auxiliary image”, which contains traditional WebLogic configuration and a WebLogic application.
- To examine the domain resource, click here .
- For detailed information, see Domain resource .
Note
The Quick Start guide’s sample domain resource references a WebLogic Server version 14.1.2.0 General Availability (GA) image. GA images are suitable for demonstration and development purposes only where the environments are not available from the public Internet; they are not acceptable for production use. In production, you should always use CPU (patched) images from OCR or create your images using the WebLogic Image Tool (WIT) with the
--recommendedPatchesoption. -
-
Confirm that the operator started the servers for the domain.
a. Use
kubectlto show that the Domain was created.b. Get the domain status using the following command. If you don’t have the
jqexecutable installed, then run the second command to get the domain status.OR
c. After a short time, you will see the Administration Server and Managed Servers running.
d. You should also see all the Kubernetes Services for the domain.
If the operator didn’t start the servers for the domain, see Domain debugging .
Create an ingress route for the domain.
-
Create an ingress route for the domain, in the domain namespace, by using the following YAML file.
a. Download the ingress route YAML to a file called
/tmp/quickstart/ingress-route.yamlor similar.b. Then apply the file using the following command.
-
To confirm that the ingress controller noticed the new ingress route and is successfully routing to the domain’s server pods, send a request to the URL for the “quick start app”, as shown in the following example, which will return an HTTP 200 status code.
$ curl -i http://localhost:30305/quickstart/ HTTP/1.1 200 OK Content-Length: 274 Content-Type: text/html; charset=UTF-8 Date: Wed, 15 Jun 2022 14:20:59 GMT Set-Cookie: JSESSIONID=JONnvS__IkBUN9nqZG4SfuUU3QdEj_4bissfck1GPbY6YJxgjXpS!1733001435; path=/; HttpOnly X-Oracle-Dms-Ecid: be865b9d-cc96-4dca-ab80-f0b6c5b05326-00000015 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> 14:21:00<br><p> </body> </html>$ LOADBALANCER_INGRESS_IP=$(kubectl get svc traefik-operator -n traefik -o jsonpath='{.status.loadBalancer.ingress[].ip}{"\n"}') $ curl -i http://${LOADBALANCER_INGRESS_IP}/quickstart/ HTTP/1.1 200 OK Content-Length: 274 Content-Type: text/html; charset=UTF-8 Date: Wed, 15 Jun 2022 14:20:59 GMT Set-Cookie: JSESSIONID=JONnvS__IkBUN9nqZG4SfuUU3QdEj_4bissfck1GPbY6YJxgjXpS!1733001435; path=/; HttpOnly X-Oracle-Dms-Ecid: be865b9d-cc96-4dca-ab80-f0b6c5b05326-00000015 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> 14:21:00<br><p> </body> </html>Note
Depending on where your Kubernetes cluster is running, you may need to open firewall ports or update security lists to allow ingress to this port.
-
To access the WebLogic Server Administration Console:
Open a browser to http://localhost:30305/console.a. Get the load balancer ingress IP address using the following command: $ LOADBALANCER_INGRESS_IP=$(kubectl get svc traefik-operator -n traefik -o jsonpath='{.status.loadBalancer.ingress[].ip}{"\n"}') b. Open a browser to http://${LOADBALANCER_INGRESS_IP}/console.Note
Do not use the WebLogic Server Administration Console to start or stop servers, or for scaling clusters. See Starting and stopping servers and Scaling .