Quantcast
Channel: DevOps tips & tricks
Viewing all 181 articles
Browse latest View live

Setup Weblogic Kubernetes ( k8s) Operator in GCP - create domain

$
0
0

 HOWTO


See also

GitHub


Create and label a namespace that can host one or more domains.

$ kubectl create namespace sample-domain1-ns
namespace/sample-domain1-ns created
dave@dave:~$ kubectl label ns sample-domain1-ns weblogic-operator=enabled
namespace/sample-domain1-ns labeled


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}"
W1214 11:03:23.618551   10551 warnings.go:70] autopilot-default-resources-mutator:Autopilot updated Deployment traefik/traefik-operator: defaulted unspecified resources for containers [traefik-operator] (see http://g.co/gke/autopilot-defaults)
Release "traefik-operator" has been upgraded. Happy Helming!
NAME: traefik-operator
LAST DEPLOYED: Thu Dec 14 11:03:20 2023
NAMESPACE: traefik
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
Traefik Proxy v2.10.6 has been deployed successfully on traefik namespace !

Domain on PV sample instructions Domain PV prerequisites 

 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.
$ kubectl create secret generic sample-domain1-weblogic-credentials \
  --from-literal=username=SOME_USER --from-literal=password=SOME_PASSWORD \
  -n sample-domain1-ns
secret/sample-domain1-weblogic-credentials created


Create a domain runtime encryption secret.
$ kubectl -n sample-domain1-ns create secret generic \
  sample-domain1-runtime-encryption-secret \
   --from-literal=password=SOME_PASSWORD
secret/sample-domain1-runtime-encryption-secret created

Create the sample-domain1 domain resource and an associated sample-domain1-cluster-1 cluster 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. 


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.yaml or similar. Then apply the file using kubectl apply -f /tmp/quickstart/domain-resource.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: "weblogic.oracle/v9"
kind: Domain
metadata:
  name: sample-domain1
  namespace: sample-domain1-ns
  labels:
    weblogic.domainUID: sample-domain1

spec:
  configuration:

    model:
      # Optional auxiliary image(s) containing WDT model, archives, and install.
      # Files are copied from `sourceModelHome` in the aux image to the `/aux/models` directory
      # in running WebLogic Server pods, and files are copied from `sourceWDTInstallHome`
      # to the `/aux/weblogic-deploy` directory. Set `sourceModelHome` and/or `sourceWDTInstallHome`
      # to "None" if you want skip such copies.
      #   `image`                - Image location
      #   `imagePullPolicy`      - Pull policy, default `IfNotPresent`
      #   `sourceModelHome`      - Model file directory in image, default `/auxiliary/models`.
      #   `sourceWDTInstallHome` - WDT install directory in image, default `/auxiliary/weblogic-deploy`.
      auxiliaryImages:
      - image: "phx.ocir.io/weblogick8s/quick-start-aux-image:v1"
        #imagePullPolicy: IfNotPresent
        #sourceWDTInstallHome: /auxiliary/weblogic-deploy
        #sourceModelHome: /auxiliary/models

      # Optional configmap for additional models and variable files
      #configMap: sample-domain1-wdt-config-map

      # All 'FromModel' domains require a runtimeEncryptionSecret with a 'password' field
      runtimeEncryptionSecret: sample-domain1-runtime-encryption-secret

  # Set to 'FromModel' to indicate 'Model in Image'.
  domainHomeSourceType: FromModel

  # The WebLogic Domain Home, this must be a location within
  # the image for 'Model in Image' domains.
  domainHome: /u01/domains/sample-domain1

  # The WebLogic Server image that the Operator uses to start the domain
  # **NOTE**:
  # This example uses General Availability (GA) images. 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.
  # Please refer to the `OCR` and `WebLogic Images` pages in the WebLogic Kubernetes Operator
  # documentation for details.
  image: "container-registry.oracle.com/middleware/weblogic:12.2.1.4"

  # Defaults to "Always" if image tag (version) is ':latest'
  imagePullPolicy: "IfNotPresent"

  # Identify which Secret contains the credentials for pulling an image
  imagePullSecrets:
  - name: weblogic-repo-credentials

  # Identify which Secret contains the WebLogic Admin credentials,
  # the secret must contain 'username' and 'password' fields.
  webLogicCredentialsSecret:
    name: sample-domain1-weblogic-credentials

  # Whether to include the WebLogic Server stdout in the pod's stdout, default is true
  includeServerOutInPodLog: true

  # Whether to enable overriding your log file location, see also 'logHome'
  #logHomeEnabled: false

  # The location for domain log, server logs, server out, introspector out, and Node Manager log files
  # see also 'logHomeEnabled', 'volumes', and 'volumeMounts'.
  #logHome: /shared/logs/sample-domain1

  # Set which WebLogic Servers the Operator will start
  # - "Never" will not start any server in the domain
  # - "AdminOnly" will start up only the administration server (no managed servers will be started)
  # - "IfNeeded" will start all non-clustered servers, including the administration server, and clustered servers up to their replica count.
  serverStartPolicy: IfNeeded

  # Settings for all server pods in the domain including the introspector job pod
  serverPod:
    # Optional new or overridden environment variables for the domain's pods
    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"

    # Optional volumes and mounts for the domain's pods. See also 'logHome'.
    #volumes:
    #- name: weblogic-domain-storage-volume
    #  persistentVolumeClaim:
    #    claimName: sample-domain1-weblogic-sample-pvc
    #volumeMounts:
    #- mountPath: /shared
    #  name: weblogic-domain-storage-volume

  # The desired behavior for starting the domain's administration server.
  # adminServer:
    # Set up a Kubernetes node port for the administration server default channel
    #adminService:
    #  channels:
    #  - channelName: default
    #    nodePort: 30701

  # The number of managed servers to start for unlisted clusters
  replicas: 1

  # The desired behavior for starting a specific cluster's member servers
  clusters:
  - name: sample-domain1-cluster-1

  # Change the restartVersion to force the introspector job to rerun
  # and apply any new model configuration, to also force a subsequent
  # roll of your domain's WebLogic Server pods.
  restartVersion: '1'

  # Changes to this field cause the operator to repeat its introspection of the
  #  WebLogic domain configuration.
  introspectVersion: '1'

    # Secrets that are referenced by model yaml macros
    # (the model yaml in the optional configMap or in the image)
    #secrets:
    #- sample-domain1-datasource-secret

---

apiVersion: "weblogic.oracle/v1"
kind: Cluster
metadata:
  name: sample-domain1-cluster-1
  # Update this with the namespace your domain will run in:
  namespace: sample-domain1-ns
  labels:
    # Update this with the `domainUID` of your domain:
    weblogic.domainUID: sample-domain1

spec:
  replicas: 2
  clusterName: cluster-1

GKE cluster logs

Setup Weblogic Kubernetes ( k8s) Operator in GCP - create Persistent Volume domain

$
0
0

 HOWTO




GitHub


Domain on PV 

  • Set the domain resource domain.spec.domainHomeSourceType attribute to PersistentVolume.
  • Supply a WebLogic installation in an image and supply a WebLogic configuration as a domain home in a persistent volume.
  • Optionally supply the domain resource domain.spec.configuration.initialDomainOnPV section to provide information for the Operator to create the initial domain home.
  • Supply WebLogic applications in the persistent volume.
  • Update the WebLogic configuration using WLST, or the WebLogic Server Administration Console.
  • Optionally use configuration overrides supplied in a Kubernetes ConfigMap. Use this only if WLST, or the WebLogic Server Administration Console does not fit your deployment strategy.

Weblogic k8s Operator - pull Docker images from Oracle Container Registry

$
0
0

 HOWTO



Prepare domain - create Oracle container registry secret

  1. Accept the license agreement for WebLogic Server images.

    a. In a browser, go to the Oracle Container Registry (OCR) and log in using the Oracle Single Sign-On (SSO) authentication service. If you do not already have SSO credentials, then at the top, right side of the page, click Sign In to create them.

    b. Search for weblogic, then select weblogic in the Search Results.

    c. From the drop-down menu, select your language and click Continue.

    d. Then read and accept the license agreement.

  2. Create a docker-registry secret to enable pulling the example WebLogic Server image from the registry.

    $ 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
    

    Replace YOUR_REGISTRY_USERNAMEYOUR_REGISTRY_PASSWORD - use AUTHTOKEN, not password, and YOUR_REGISTRY_EMAIL with the values you use to access the registry.



Product Homeand Oracle Linux versionDated TagNon Dated Tag (latest)
Oracle WebLogic Server 14.1.1.0 Generic Installation11.0.21 + Oracle Linux 7u914.1.1.0-11-23071814.1.1.0-11
Oracle WebLogic Server 14.1.1.0 Generic Installation11.0.21 + Oracle Linux 8u414.1.1.0-11-ol8-23071814.1.1.0-11-ol8












Pull Docker Weblogic 14.1.1 image from OCR
$ docker pull container-registry.oracle.com/middleware/weblogic:14.1.1.0
14.1.1.0: Pulling from middleware/weblogic
cd17e56c322c: Pull complete 
159378624825: Pull complete 
c04549775f16: Pull complete 
3843b8b6117a: Pull complete 
8c356b9f7aaa: Pull complete 
800aaf7a8639: Pull complete 
Digest: sha256:1b5c18b921fdc8367c07b5feb38189da06e7cb6d519ca125c7c50794e0ec2b29
Status: Downloaded newer image for container-registry.oracle.com/middleware/weblogic:14.1.1.0
container-registry.oracle.com/middleware/weblogic:14.1.1.0

Downloaded image
$ docker images
REPOSITORY                                                TAG                   IMAGE ID       CREATED         SIZE
container-registry.oracle.com/middleware/weblogic         14.1.1.0              17f98eb6bba3   3 years ago     1.33GB

Install Weblogic k8s Operator into Minikube on Fedora

$
0
0

HOWTO

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.

^C
[dave@fedora ~]$ ,^C
[dave@fedora ~]$ sudo yum install -y kubectl^C
[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 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%]
[dave@fedora ~]$ minikube start
😄  minikube v1.32.0 on Fedora 38
^C
[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 Weblogic console Use minikube ip

[dave@fedora k8s]$ minikube ip
192.168.49.2

Use browser with console URL using minikube IP 

 http://192.168.49.2:30305/console 


Running servers 

Docker status 


 Switch do minikube Docker env
eval $(minikube docker-env)








 Check running Docker processes
[dave@fedora ~]$ docker ps
\CONTAINER ID   IMAGE                                         COMMAND                  CREATED          STATUS          PORTS     NAMES
5fda35c81e08   f25890f836d0                                  "/weblogic-operator/…"   7 minutes ago    Up 7 minutes              k8s_weblogic-server_sample-domain1-managed-server1_sample-domain1-ns_9bde17b3-3744-4d2b-903c-7160b9349171_0
0306ebac0f0c   f25890f836d0                                  "/weblogic-operator/…"   7 minutes ago    Up 7 minutes              k8s_weblogic-server_sample-domain1-managed-server2_sample-domain1-ns_2a091ea5-a072-4042-9845-f40da3c699c3_0
827504e7cead   registry.k8s.io/pause:3.9                     "/pause"                 7 minutes ago    Up 7 minutes              k8s_POD_sample-domain1-managed-server2_sample-domain1-ns_2a091ea5-a072-4042-9845-f40da3c699c3_0
c1280c7e18f2   registry.k8s.io/pause:3.9                     "/pause"                 7 minutes ago    Up 7 minutes              k8s_POD_sample-domain1-managed-server1_sample-domain1-ns_9bde17b3-3744-4d2b-903c-7160b9349171_0
3d4a0f7af09c   f25890f836d0                                  "/weblogic-operator/…"   7 minutes ago    Up 7 minutes              k8s_weblogic-server_sample-domain1-admin-server_sample-domain1-ns_0913ce87-2626-42a6-9b3e-e67a927a946d_0
5dd65ceb9693   registry.k8s.io/pause:3.9                     "/pause"                 7 minutes ago    Up 7 minutes              k8s_POD_sample-domain1-admin-server_sample-domain1-ns_0913ce87-2626-42a6-9b3e-e67a927a946d_0
7023b2c79658   traefik                                       "/entrypoint.sh --gl…"   24 minutes ago   Up 24 minutes             k8s_traefik-operator_traefik-operator-696c678b7d-b72ll_traefik_5739817a-7d98-420a-a5ce-e4b062cf823c_0
ed3f4b88bb85   registry.k8s.io/pause:3.9                     "/pause"                 24 minutes ago   Up 24 minutes             k8s_POD_traefik-operator-696c678b7d-b72ll_traefik_5739817a-7d98-420a-a5ce-e4b062cf823c_0
7f94ed689c89   ghcr.io/oracle/weblogic-kubernetes-operator   "/deployment/operato…"   33 minutes ago   Up 33 minutes             k8s_weblogic-operator_weblogic-operator-85cb6f9d8b-r6vrk_sample-weblogic-operator-ns_f6725210-4237-4307-b936-204a8196c08e_0
f4a6fd4c8b27   ghcr.io/oracle/weblogic-kubernetes-operator   "/deployment/webhook…"   33 minutes ago   Up 33 minutes             k8s_weblogic-operator-webhook_weblogic-operator-webhook-7c6cd97f67-dlw2p_sample-weblogic-operator-ns_1072cb89-971e-47cd-8687-f0f3ff045334_0
c9a72a33a577   registry.k8s.io/pause:3.9                     "/pause"                 33 minutes ago   Up 33 minutes             k8s_POD_weblogic-operator-webhook-7c6cd97f67-dlw2p_sample-weblogic-operator-ns_1072cb89-971e-47cd-8687-f0f3ff045334_0
5e6105db9ac1   registry.k8s.io/pause:3.9                     "/pause"                 33 minutes ago   Up 33 minutes             k8s_POD_weblogic-operator-85cb6f9d8b-r6vrk_sample-weblogic-operator-ns_f6725210-4237-4307-b936-204a8196c08e_0
cd3b1c89a3eb   kubernetesui/metrics-scraper                  "/metrics-sidecar"       35 minutes ago   Up 35 minutes             k8s_dashboard-metrics-scraper_dashboard-metrics-scraper-7fd5cb4ddc-59w48_kubernetes-dashboard_0d19eb39-4ce8-484d-980e-9c23e70834f6_0
8326a5920edb   kubernetesui/dashboard                        "/dashboard --insecu…"   35 minutes ago   Up 35 minutes             k8s_kubernetes-dashboard_kubernetes-dashboard-8694d4445c-bl8kc_kubernetes-dashboard_78eb67be-fb2c-4d84-a1e5-220d7cda2dc7_0
7cc4a174161b   registry.k8s.io/pause:3.9                     "/pause"                 36 minutes ago   Up 36 minutes             k8s_POD_dashboard-metrics-scraper-7fd5cb4ddc-59w48_kubernetes-dashboard_0d19eb39-4ce8-484d-980e-9c23e70834f6_0
12322e3b7308   registry.k8s.io/pause:3.9                     "/pause"                 36 minutes ago   Up 36 minutes             k8s_POD_kubernetes-dashboard-8694d4445c-bl8kc_kubernetes-dashboard_78eb67be-fb2c-4d84-a1e5-220d7cda2dc7_0
1e26f31cffd3   6e38f40d628d                                  "/storage-provisioner"   36 minutes ago   Up 36 minutes             k8s_storage-provisioner_storage-provisioner_kube-system_bffb582c-4082-4f59-b8a6-2c56c4bc31e6_1
9854332b53a7   ead0a4a53df8                                  "/coredns -conf /etc…"   37 minutes ago   Up 37 minutes             k8s_coredns_coredns-5dd5756b68-5g68q_kube-system_92354626-39a3-4265-99fa-5bebf5bf87df_0
d6e8c1ec59cc   bfc896cf80fb                                  "/usr/local/bin/kube…"   37 minutes ago   Up 37 minutes             k8s_kube-proxy_kube-proxy-27b6m_kube-system_fe8f7377-ff32-43d6-af3a-a8af8f10cf95_0
d2a750b4cc3e   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_coredns-5dd5756b68-5g68q_kube-system_92354626-39a3-4265-99fa-5bebf5bf87df_0
25cd5a09f091   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_kube-proxy-27b6m_kube-system_fe8f7377-ff32-43d6-af3a-a8af8f10cf95_0
ab890fd51e0b   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_storage-provisioner_kube-system_bffb582c-4082-4f59-b8a6-2c56c4bc31e6_0
a23bec31c202   73deb9a3f702                                  "etcd --advertise-cl…"   37 minutes ago   Up 37 minutes             k8s_etcd_etcd-minikube_kube-system_9aac5b5c8815def09a2ef9e37b89da55_0
40bb03658ccf   6d1b4fd1b182                                  "kube-scheduler --au…"   37 minutes ago   Up 37 minutes             k8s_kube-scheduler_kube-scheduler-minikube_kube-system_75ac196d3709dde303d8a81c035c2c28_0
a90bea9a1d25   10baa1ca1706                                  "kube-controller-man…"   37 minutes ago   Up 37 minutes             k8s_kube-controller-manager_kube-controller-manager-minikube_kube-system_7da72fc2e2cfb27aacf6cffd1c72da00_0
9e55d4a89311   537434729123                                  "kube-apiserver --ad…"   37 minutes ago   Up 37 minutes             k8s_kube-apiserver_kube-apiserver-minikube_kube-system_55b4bbe24dac3803a7379f9ae169d6ba_0
84c84b032082   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_kube-scheduler-minikube_kube-system_75ac196d3709dde303d8a81c035c2c28_0
74929d8ef048   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_kube-controller-manager-minikube_kube-system_7da72fc2e2cfb27aacf6cffd1c72da00_0
fe3b648634f4   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_kube-apiserver-minikube_kube-system_55b4bbe24dac3803a7379f9ae169d6ba_0
6a2bcb38533b   registry.k8s.io/pause:3.9                     "/pause"                 37 minutes ago   Up 37 minutes             k8s_POD_etcd-minikube_kube-system_9aac5b5c8815def09a2ef9e37b89da55_0

Running Java processes
[dave@fedora k8s]$ pgrep -a java
26325 java -cp /operator/weblogic-kubernetes-operator.jar -XshowSettings:vm -Djava.util.logging.config.file=/deployment/logstash.properties oracle.kubernetes.operator.WebhookMain
26401 java -XshowSettings:vm -XX:MaxRAMPercentage=70 -Djava.util.logging.config.file=/deployment/logstash.properties -jar /operator/weblogic-kubernetes-operator.jar
70236 /u01/jdk/bin/java -DLogFile=/u01/nodemanager/sample-domain1/admin-server/sample-domain1/servers/admin-server/logs/admin-server_nodemanager.log -DNodeManagerHome=/u01/nodemanager/sample-domain1/admin-server -server -Djdk.tls.ephemeralDHKeySize=2048 -Dcoherence.home=/u01/oracle/wlserver/../coherence -Dbea.home=/u01/oracle/wlserver/.. -Xms64m -Xmx100m -Djava.security.egd=file:/dev/./urandom -XX:+CrashOnOutOfMemoryError -Dweblogic.StdoutDebugEnabled=false -Dweblogic.RootDirectory=/u01/domains/sample-domain1 -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Dweblogic.nodemanager.JavaHome=/u01/jdk weblogic.NodeManager -v
70844 /u01/jdk/bin/java -Djava.security.manager -Djava.security.policy=/u01/oracle/wlserver/common/derby/derbyServer.policy -Dderby.system.home=/u01/domains/sample-domain1/common/db -classpath /u01/oracle/wlserver/common/derby/lib/derby.jar:/u01/oracle/wlserver/common/derby/lib/derbynet.jar:/u01/oracle/wlserver/common/derby/lib/derbytools.jar:/u01/oracle/wlserver/common/derby/lib/derbyoptionaltools.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar org.apache.derby.drda.NetworkServerControl start
70845 /u01/jdk/bin/java -server -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=admin-server -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Dweblogic.system.BootIdentityFile=/u01/domains/sample-domain1/servers/admin-server/security/boot.properties -Dweblogic.nodemanager.ServiceEnabled=true -Dweblogic.nmservice.RotationEnabled=true -Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx512m -Dweblogic.Stdout=/u01/domains/sample-domain1/servers/admin-server/logs/admin-server.out -XX:+CrashOnOutOfMemoryError -Dweblogic.StdoutDebugEnabled=false -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server weblogic.Server
75268 /u01/jdk/bin/java -DLogFile=/u01/nodemanager/sample-domain1/managed-server1/sample-domain1/servers/managed-server1/logs/managed-server1_nodemanager.log -DNodeManagerHome=/u01/nodemanager/sample-domain1/managed-server1 -server -Djdk.tls.ephemeralDHKeySize=2048 -Dcoherence.home=/u01/oracle/wlserver/../coherence -Dbea.home=/u01/oracle/wlserver/.. -Xms64m -Xmx100m -Djava.security.egd=file:/dev/./urandom -XX:+CrashOnOutOfMemoryError -Dweblogic.StdoutDebugEnabled=false -Dweblogic.RootDirectory=/u01/domains/sample-domain1 -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Dweblogic.nodemanager.JavaHome=/u01/jdk weblogic.NodeManager -v
75269 /u01/jdk/bin/java -DLogFile=/u01/nodemanager/sample-domain1/managed-server2/sample-domain1/servers/managed-server2/logs/managed-server2_nodemanager.log -DNodeManagerHome=/u01/nodemanager/sample-domain1/managed-server2 -server -Djdk.tls.ephemeralDHKeySize=2048 -Dcoherence.home=/u01/oracle/wlserver/../coherence -Dbea.home=/u01/oracle/wlserver/.. -Xms64m -Xmx100m -Djava.security.egd=file:/dev/./urandom -XX:+CrashOnOutOfMemoryError -Dweblogic.StdoutDebugEnabled=false -Dweblogic.RootDirectory=/u01/domains/sample-domain1 -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Dweblogic.nodemanager.JavaHome=/u01/jdk weblogic.NodeManager -v
76640 /u01/jdk/bin/java -Djava.security.manager -Djava.security.policy=/u01/oracle/wlserver/common/derby/derbyServer.policy -Dderby.system.home=/u01/domains/sample-domain1/common/db -classpath /u01/oracle/wlserver/common/derby/lib/derby.jar:/u01/oracle/wlserver/common/derby/lib/derbynet.jar:/u01/oracle/wlserver/common/derby/lib/derbytools.jar:/u01/oracle/wlserver/common/derby/lib/derbyoptionaltools.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar org.apache.derby.drda.NetworkServerControl start
76641 /u01/jdk/bin/java -server -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=managed-server1 -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Dweblogic.system.BootIdentityFile=/u01/domains/sample-domain1/servers/managed-server1/security/boot.properties -Dweblogic.nodemanager.ServiceEnabled=true -Dweblogic.nmservice.RotationEnabled=true -Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx512m -Dweblogic.Stdout=/u01/domains/sample-domain1/servers/managed-server1/logs/managed-server1.out -XX:+CrashOnOutOfMemoryError -Dweblogic.StdoutDebugEnabled=false -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server -Dweblogic.management.server=http://sample-domain1-admin-server:7001 weblogic.Server
76731 /u01/jdk/bin/java -Djava.security.manager -Djava.security.policy=/u01/oracle/wlserver/common/derby/derbyServer.policy -Dderby.system.home=/u01/domains/sample-domain1/common/db -classpath /u01/oracle/wlserver/common/derby/lib/derby.jar:/u01/oracle/wlserver/common/derby/lib/derbynet.jar:/u01/oracle/wlserver/common/derby/lib/derbytools.jar:/u01/oracle/wlserver/common/derby/lib/derbyoptionaltools.jar:/u01/oracle/wlserver/common/derby/lib/derbyclient.jar org.apache.derby.drda.NetworkServerControl start
76732 /u01/jdk/bin/java -server -cp /u01/oracle/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=managed-server2 -Djava.security.policy=/u01/oracle/wlserver/server/lib/weblogic.policy -Dweblogic.system.BootIdentityFile=/u01/domains/sample-domain1/servers/managed-server2/security/boot.properties -Dweblogic.nodemanager.ServiceEnabled=true -Dweblogic.nmservice.RotationEnabled=true -Djava.security.egd=file:/dev/./urandom -Xms256m -Xmx512m -Dweblogic.Stdout=/u01/domains/sample-domain1/servers/managed-server2/logs/managed-server2.out -XX:+CrashOnOutOfMemoryError -Dweblogic.StdoutDebugEnabled=false -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/u01/oracle/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/u01/oracle/wlserver/server -Dweblogic.home=/u01/oracle/wlserver/server -Dweblogic.management.server=http://sample-domain1-admin-server:7001 weblogic.Server

Minikube dashboard

browser URL http://127.0.0.1:39359/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/overview?namespace=sample-weblogic-operator-ns

Operator namespace



Domain namespace

Pod details


Weblogic k8s operator - create model in image

$
0
0

 HOWTO

See also

GitHub code


Quick start sample files
[dave@fedora weblogic-kubernetes-operator]$ cd kubernetes/samples/quick-start/
[dave@fedora quick-start]$ find
.
./archive
./archive/wlsdeploy
./archive/wlsdeploy/applications
./archive/wlsdeploy/applications/quickstart
./archive/wlsdeploy/applications/quickstart/WEB-INF
./archive/wlsdeploy/applications/quickstart/WEB-INF/web.xml
./archive/wlsdeploy/applications/quickstart/index.jsp
./domain-resource.yaml
./ingress-route.yaml
./model.properties
./model.yaml


Download the latest WebLogic Deploy Tooling (WDT) and WebLogic Image Tool (WIT) installer ZIP files to a new directory; for example, use directory /tmp/quickstart/tools. Both WDT and WIT are required to create your Model in Image auxiliary images.
Download WDT and image tool
 mkdir -p ~/k8s/quickstart/tools
$ curl -m 120 -fL https://github.com/oracle/weblogic-deploy-tooling/releases/latest/download/weblogic-deploy.zip   -o ~/k8s/quickstart/tools/weblogic-deploy.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2382k  100 2382k    0     0  1685k      0  0:00:01  0:00:01 --:--:-- 3648k
[dave@fedora tools]$ curl -m 120 -fL https://github.com/oracle/weblogic-image-tool/releases/latest/download/imagetool.zip \
  -o ~/k8s/quickstart/tools/imagetool.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2075k  100 2075k    0     0  1322k      0  0:00:01  0:00:01 --:--:-- 4572k

$ imagetool.sh cache addInstaller \
  --type wdt \
  --version latest \
  --path ~/k8s/quickstart/tools/weblogic-deploy.zip
list files in WDT
[dave@fedora k8s]$ find weblogic-deploy -type d
weblogic-deploy
weblogic-deploy/etc
weblogic-deploy/lib
weblogic-deploy/lib/python
weblogic-deploy/lib/python/wlsdeploy
weblogic-deploy/lib/python/wlsdeploy/util
weblogic-deploy/lib/python/wlsdeploy/json
weblogic-deploy/lib/python/wlsdeploy/yaml
weblogic-deploy/lib/python/wlsdeploy/aliases
weblogic-deploy/lib/python/wlsdeploy/exception
weblogic-deploy/lib/python/wlsdeploy/logging
weblogic-deploy/lib/python/wlsdeploy/tool
weblogic-deploy/lib/python/wlsdeploy/tool/validate
weblogic-deploy/lib/python/wlsdeploy/tool/discover
weblogic-deploy/lib/python/wlsdeploy/tool/util
weblogic-deploy/lib/python/wlsdeploy/tool/util/filters
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets
weblogic-deploy/lib/python/wlsdeploy/tool/prepare
weblogic-deploy/lib/python/wlsdeploy/tool/deploy
weblogic-deploy/lib/python/wlsdeploy/tool/compare
weblogic-deploy/lib/python/wlsdeploy/tool/extract
weblogic-deploy/lib/python/wlsdeploy/tool/modelhelp
weblogic-deploy/lib/python/wlsdeploy/tool/encrypt
weblogic-deploy/lib/python/wlsdeploy/tool/create
weblogic-deploy/lib/typedefs
weblogic-deploy/lib/targets
weblogic-deploy/lib/targets/vz
weblogic-deploy/lib/targets/wko4-pv
weblogic-deploy/lib/targets/wko4
weblogic-deploy/lib/targets/wko-pv
weblogic-deploy/lib/targets/vz-dii
weblogic-deploy/lib/targets/k8s
weblogic-deploy/lib/targets/wko4-dii
weblogic-deploy/lib/targets/vz-pv
weblogic-deploy/lib/targets/wko-dii
weblogic-deploy/lib/targets/templates
weblogic-deploy/lib/targets/wko
weblogic-deploy/lib/injectors
weblogic-deploy/bin
weblogic-deploy/samples

unzip image tool
[dave@fedora k8s]$ unzip  imagetool.zip 
Archive:  imagetool.zip
   creating: imagetool/
   creating: imagetool/lib/
  inflating: imagetool/lib/fluent-hc-4.5.14.jar  
  inflating: imagetool/lib/httpclient-4.5.14.jar  
  inflating: imagetool/lib/httpcore-4.4.16.jar  
  inflating: imagetool/lib/commons-logging-1.2.jar  
  inflating: imagetool/lib/commons-codec-1.11.jar  
  inflating: imagetool/lib/httpmime-4.5.14.jar  
  inflating: imagetool/lib/picocli-4.7.4.jar  
  inflating: imagetool/lib/compiler-0.9.10.jar  
   creating: imagetool/bin/
  inflating: imagetool/bin/setup.sh  
  inflating: imagetool/bin/logging.properties  
  inflating: imagetool/bin/imagetool.cmd  
  inflating: imagetool/bin/imagetool.sh  
  inflating: imagetool/LICENSE.txt   
  inflating: imagetool/lib/imagetool.jar  
  inflating: imagetool/lib/imagetool_completion.sh  
  inflating: imagetool/VERSION.txt   
[dave@fedora k8s]$ ls /home/


Download 

 and put them in your ~/k8s/quickstart/models directory. 

Then use the jar command to put the web application files into a model archive ZIP file.


[dave@fedora k8s]$ imagetool.sh cache deleteEntry --key wdt_latest
[INFO   ] Nothing to delete for key: wdt_latest
[dave@fedora k8s]$ imagetool.sh cache addInstaller \
  --type wdt \
  --version latest \
  --path imagetool.zip 
[INFO   ] Successfully added to cache. wdt_latest=/home/dave/k8s/imagetool.zip
[dave@fedora k8s]$ mkdir -p ~/k8s/quickstart/models/archive/wlsdeploy/applications/quickstart/WEB-INF
[dave@fedora k8s]$ curl -m 120 -fL https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/release/4.1/kubernetes/samples/quick-start/model.yaml -o ~/k8s/quickstart/models/model.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1057  100  
$ curl -m 120 -fL https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/release/4.1/kubernetes/samples/quick-start/model.properties -o ~/k8s/quickstart/models/model.properties
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    94  100    94    0     0    405      0 --:--:-- --:--:-- --:--:--   406

[dave@fedora k8s]$ curl -m 120 -fL https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/release/4.1/kubernetes/samples/quick-start/archive/wlsdeploy/applications/quickstart/index.jsp -o ~/k8s/quickstart/models/archive/wlsdeploy/applications/quickstart/index.jsp
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1243  100  1243    0     0   4836      0 --:--:-- --:--:-- --:--:--  4855
[dave@fedora k8s]$ curl -m 120 -fL https://raw.githubusercontent.com/oracle/weblogic-kubernetes-operator/release/4.1/kubernetes/samples/quick-start/archive/wlsdeploy/applications/quickstart/WEB-INF/web.xml -o ~/k8s/quickstart/models/archive/wlsdeploy/applications/quickstart/WEB-INF/web.xml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   390  100   390    0     0   1461      0 --:--:-- --:--:-- --:--:--  1460
[dave@fedora k8s]$ jar cvf ~/k8s/quickstart/models/archive.zip -C ~/k8s/quickstart/models/archive/ wlsdeploy
added manifest
adding: wlsdeploy/(in = 0) (out= 0)(stored 0%)
adding: wlsdeploy/applications/(in = 0) (out= 0)(stored 0%)
adding: wlsdeploy/applications/quickstart/(in = 0) (out= 0)(stored 0%)
adding: wlsdeploy/applications/quickstart/WEB-INF/(in = 0) (out= 0)(stored 0%)
adding: wlsdeploy/applications/quickstart/WEB-INF/web.xml(in = 390) (out= 278)(deflated 28%)
adding: wlsdeploy/applications/quickstart/index.jsp(in = 1243) (out= 585)(deflated 52%)
[dave@fedora k8s]$ jar tvf ~/k8s/quickstart/models/archive.zip
     0 Sat Mar 02 20:02:28 CET 2024 META-INF/
    67 Sat Mar 02 20:02:28 CET 2024 META-INF/MANIFEST.MF
     0 Sat Mar 02 20:00:06 CET 2024 wlsdeploy/
     0 Sat Mar 02 20:00:06 CET 2024 wlsdeploy/applications/
     0 Sat Mar 02 20:01:32 CET 2024 wlsdeploy/applications/quickstart/
     0 Sat Mar 02 20:01:54 CET 2024 wlsdeploy/applications/quickstart/WEB-INF/
   390 Sat Mar 02 20:01:54 CET 2024 wlsdeploy/applications/quickstart/WEB-INF/web.xml
  1243 Sat Mar 02 20:01:32 CET 2024 wlsdeploy/applications/quickstart/index.jsp

Model files
$ find quickstart/models/
quickstart/models/
quickstart/models/archive
quickstart/models/archive/wlsdeploy
quickstart/models/archive/wlsdeploy/applications
quickstart/models/archive/wlsdeploy/applications/quickstart
quickstart/models/archive/wlsdeploy/applications/quickstart/WEB-INF
quickstart/models/archive/wlsdeploy/applications/quickstart/WEB-INF/web.xml
quickstart/models/archive/wlsdeploy/applications/quickstart/index.jsp
quickstart/models/model.yaml
quickstart/models/archive.zip
quickstart/models/model.properties

Create auxiliary image containing WDT model YAML files application archives the WDT installation files
 $ imagetool.sh createAuxImage   --tag quick-start-aux-image:v1   --wdtModel ~/k8s/quickstart/models/model.yaml   --wdtVariables ~/k8s/quickstart/models/model.properties   --wdtArchive ~/k8s/quickstart/models/archive.zip
[INFO   ] WebLogic Image Tool version 1.12.1
[INFO   ] Image Tool build ID: bcc59d31-b52a-4464-95c5-0e49307fb550
[INFO   ] Temporary directory used for image build context: /home/dave/wlsimgbuilder_temp1447416871605136089
[INFO   ] Copying /home/dave/k8s/quickstart/models/model.yaml to build context folder.
[INFO   ] Copying /home/dave/k8s/quickstart/models/archive.zip to build context folder.
[INFO   ] Copying /home/dave/k8s/quickstart/models/model.properties to build context folder.
[INFO   ] Copying /home/dave/k8s/quickstart/tools/weblogic-deploy.zip to build context folder.
[INFO   ] Starting build: docker build --no-cache --force-rm --tag quick-start-aux-image:v1 /home/dave/wlsimgbuilder_temp1447416871605136089
[INFO   ] Build successful. Build time=3s. Image tag=quick-start-aux-image:v1

Check created Docker image
$ docker images quick-start-aux-image:v1
REPOSITORY              TAG       IMAGE ID       CREATED          SIZE
quick-start-aux-image   v1        7d0eca09a837   40 seconds ago   6.65MB

After the image is created, it will have the WDT executables in /auxiliary/weblogic-deploy, and WDT model, property, and archive files in /auxiliary/models. You can run ls in the Docker image to verify this.
$  docker run -it --rm quick-start-aux-image:v1 ls -l /auxiliary
total 0
drwxr-x---    1 oracle   oracle          56 Mar  2 19:12 imagetool
drwxr-xr-x    1 oracle   oracle          74 Mar  2 19:12 models
[dave@fedora k8s]$ docker run -it --rm quick-start-aux-image:v1 ls -l /auxiliary/models
total 12
-rw-r-----    1 oracle   oracle        2092 Mar  2 19:12 archive.zip
-rw-r-----    1 oracle   oracle          94 Mar  2 19:12 model.properties
-rw-r-----    1 oracle   oracle        1057 Mar  2 19:12 model.yaml

weblogic-deploy
$ docker run -it --rm quick-start-aux-image:v1 ls -l /auxiliary/weblogic-deploy
total 8
-rw-r-----    1 oracle   oracle        1839 Mar  2 19:27 LICENSE.txt
-rw-r-----    1 oracle   oracle          29 Mar  2 19:27 VERSION.txt
drwxr-x---    1 oracle   oracle         826 Mar  2 19:27 bin
drwxr-x---    1 oracle   oracle          36 Mar  2 19:27 etc
drwxr-x---    1 oracle   oracle         298 Mar  2 19:27 lib
drwxr-x---    1 oracle   oracle          96 Mar  2 19:27 samples

Create the domain model file Check deployed app in Weblogic console
Quick start app URL 




Weblogic k8s Operator - SSH into minikube container

$
0
0

HOWTO


SSH into pod

dave@fedora quickstart]$ kubectl get pods -n sample-domain1-ns
NAME                             READY   STATUS    RESTARTS   AGE
sample-domain1-admin-server      1/1     Running   0          10h
sample-domain1-managed-server1   1/1     Running   0          10h
sample-domain1-managed-server2   1/1     Running   0          10h
[dave@fedora quickstart]$  kubectl exec -it -n sample-domain1-ns sample-domain1-admin-server -- /bin/bash
Defaulted container "weblogic-server" out of: weblogic-server, operator-aux-container1 (init)
[oracle@sample-domain1-admin-server oracle]$ ls
OPatch  coherence  create-wls-domain.py  createAndStartEmptyDomain.sh  inventory  oraInst.loc  oraInventory  oracle_common  oui  root.sh  wlserver

Domain location
[oracle@sample-domain1-admin-server u01]$ ls -1
domains
jdk
nodemanager
oracle

Admin server log
[oracle@sample-domain1-admin-server u01]$ cat   /u01/domains/sample-domain1/servers/admin-server/logs/admin-server.log
####<Mar 2, 2024 10:20:16,078 AM GMT> <Info> <Security> <sample-domain1-admin-server> <> <main> <> <> <> <1709374816078> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
####<Mar 2, 2024 10:20:16,131 AM GMT> <Info> <Security> <sample-domain1-admin-server> <> <main> <> <> <> <1709374816131> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
####<Mar 2, 2024 10:20:16,544 AM GMT> <Info> <WebLogicServer> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374816544> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.391-b26 from Oracle Corporation.> 
####<Mar 2, 2024 10:20:16,605 AM GMT> <Info> <RCM> <sample-domain1-admin-server> <> <Thread-5> <> <> <> <1709374816605> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
####<Mar 2, 2024 10:20:16,763 AM GMT> <Info> <Management> <sample-domain1-admin-server> <> <Thread-8> <> <> <> <1709374816763> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-141107> <Version: WebLogic Server 12.2.1.4.0 Thu Sep 12 04:04:29 GMT 2019 1974621> 
####<Mar 2, 2024 10:20:17,569 AM GMT> <Notice> <WebLogicServer> <sample-domain1-admin-server> <> <Thread-8> <> <> <> <1709374817569> <[severity-value: 32] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000365> <Server state changed to STARTING.> 
####<Mar 2, 2024 10:20:17,592 AM GMT> <Info> <WorkManager> <sample-domain1-admin-server> <> <Thread-8> <> <> <> <1709374817592> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002900> <Initializing self-tuning thread pool.> 
####<Mar 2, 2024 10:20:17,614 AM GMT> <Info> <WorkManager> <sample-domain1-admin-server> <> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1709374817614> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
####<Mar 2, 2024 10:20:17,641 AM GMT> <Info> <WebLogicServer> <sample-domain1-admin-server> <> <Thread-8> <> <> <> <1709374817641> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000214> <WebLogic Server "admin-server" version:
WebLogic Server 12.2.1.4.0 Thu Sep 12 04:04:29 GMT 2019 1974621 Copyright (c) 1995,2019, Oracle and/or its affiliates. All rights reserved.> 
####<Mar 2, 2024 10:20:17,661 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817661> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "t3" is now configured.> 
####<Mar 2, 2024 10:20:17,661 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817661> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "t3s" is now configured.> 
####<Mar 2, 2024 10:20:17,661 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817661> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "http" is now configured.> 
####<Mar 2, 2024 10:20:17,661 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817661> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "https" is now configured.> 
####<Mar 2, 2024 10:20:17,662 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817662> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "iiop" is now configured.> 
####<Mar 2, 2024 10:20:17,662 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817662> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "iiops" is now configured.> 
####<Mar 2, 2024 10:20:17,662 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817662> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "ldap" is now configured.> 
####<Mar 2, 2024 10:20:17,662 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817662> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "ldaps" is now configured.> 
####<Mar 2, 2024 10:20:17,663 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817663> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "cluster" is now configured.> 
####<Mar 2, 2024 10:20:17,664 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817664> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "clusters" is now configured.> 
####<Mar 2, 2024 10:20:17,665 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817665> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "snmp" is now configured.> 
####<Mar 2, 2024 10:20:17,665 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817665> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002622> <The protocol "admin" is now configured.> 
####<Mar 2, 2024 10:20:17,665 AM GMT> <Info> <Server> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817665> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-002624> <The administration protocol is "t3s" and is now configured.> 
####<Mar 2, 2024 10:20:17,686 AM GMT> <Info> <RJVM> <sample-domain1-admin-server> <> <Thread-7> <> <> <> <1709374817686> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000570> <Network Configuration for Channel "admin-server"
 Listen Address         sample-domain1-admin-server:7001
 Public Address         N/A
 Http Enabled         true
 Tunneling Enabled     false
 Outbound Enabled     false
 Admin Traffic Enabled     true ResolveDNSName Enabled     false> 

Domain config.xml
[oracle@sample-domain1-admin-server oracle]$ cat /u01/domains/sample-domain1/config/config.xml 
<?xml version="1.0" encoding="UTF-8"?>
<domain xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd" xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <name>sample-domain1</name>
  <domain-version>12.2.1.4.0</domain-version>
  <security-configuration xmlns:xacml="http://xmlns.oracle.com/weblogic/security/xacml" xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator">
    <name>sample-domain1</name>
    <realm>
      <sec:authentication-provider xsi:type="wls:default-authenticatorType">
        <sec:name>DefaultAuthenticator</sec:name>
      </sec:authentication-provider>
      <sec:authentication-provider xsi:type="wls:default-identity-asserterType">
        <sec:name>DefaultIdentityAsserter</sec:name>
        <sec:active-type>AuthenticatedUser</sec:active-type>
        <sec:active-type>weblogic-jwt-token</sec:active-type>
      </sec:authentication-provider>
      <sec:role-mapper xsi:type="xacml:xacml-role-mapperType">
        <sec:name>XACMLRoleMapper</sec:name>
      </sec:role-mapper>
      <sec:authorizer xsi:type="xacml:xacml-authorizerType">
        <sec:name>XACMLAuthorizer</sec:name>
      </sec:authorizer>
      <sec:adjudicator xsi:type="wls:default-adjudicatorType">
        <sec:name>DefaultAdjudicator</sec:name>
      </sec:adjudicator>
      <sec:credential-mapper xsi:type="wls:default-credential-mapperType">
        <sec:name>DefaultCredentialMapper</sec:name>
      </sec:credential-mapper>
      <sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType">
        <sec:name>WebLogicCertPathProvider</sec:name>
      </sec:cert-path-provider>
      <sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
      <sec:name>myrealm</sec:name>
      <sec:password-validator xsi:type="pas:system-password-validatorType">
        <sec:name>SystemPasswordValidator</sec:name>
        <pas:min-password-length>8</pas:min-password-length>
        <pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
      </sec:password-validator>
    </realm>
    <default-realm>myrealm</default-realm>
    <credential-encrypted>{AES256}nUSNfFy5HebZaCxN7d6lotMx9ummfbPxODz8QDAtpGvrpIBYXZ4rOTFMA/P38eaB8v4V101EFb5B7PBEvBCsx5sIfZnb2i34Ov3RgF6BzzhRAGxNduc3vIEAa4rJzzK4</credential-encrypted>
    <node-manager-username>weblogic</node-manager-username>
    <node-manager-password-encrypted>{AES256}l1JDbXn8tQQknuxwpZW24lx8X3BJhF9HEYfyaNj9Q+E=</node-manager-password-encrypted>
  </security-configuration>
  <server>
    <name>admin-server</name>
    <listen-address>sample-domain1-admin-server</listen-address>
    <network-access-point>
      <name>internal-t3</name>
      <listen-address>localhost</listen-address>
      <listen-port>7001</listen-port>
    </network-access-point>
    <server-life-cycle-timeout-val>30</server-life-cycle-timeout-val>
    <startup-timeout>0</startup-timeout>
  </server>
  <server-template>
    <name>server-template_1</name>
    <ssl>
      <name>server-template_1</name>
      <enabled>false</enabled>
      <listen-port>8100</listen-port>
    </ssl>
    <listen-port>8001</listen-port>
    <cluster>cluster-1</cluster>
    <listen-address>sample-domain1-managed-server${id}</listen-address>
    <jta-migratable-target>
      <name>${serverName}</name>
      <cluster>cluster-1</cluster>
    </jta-migratable-target>
  </server-template>
  <cluster>
    <name>cluster-1</name>
    <cluster-messaging-mode>unicast</cluster-messaging-mode>
    <dynamic-servers>
      <name>NO_NAME_0</name>
      <server-template>server-template_1</server-template>
      <maximum-dynamic-server-count>5</maximum-dynamic-server-count>
      <calculated-listen-ports>false</calculated-listen-ports>
      <server-name-prefix>managed-server</server-name-prefix>
      <dynamic-cluster-size>5</dynamic-cluster-size>
    </dynamic-servers>
  </cluster>
  <embedded-ldap>
    <name>sample-domain1</name>
    <credential-encrypted>{AES256}RF9stk46SYlr3TQEmx+42kJUrYUNT05jpayh8fwV9IPAKGDZIKGF1kM+GWDYb+FA</credential-encrypted>
  </embedded-ldap>
  <configuration-version>12.2.1.4.0</configuration-version>
  <app-deployment>
    <name>quickstart</name>
    <target>cluster-1</target>
    <module-type>war</module-type>
    <source-path>wlsdeploy/applications/quickstart</source-path>
  </app-deployment>
  <admin-server-name>admin-server</admin-server-name>
</domain>

Weblogic k8s operator - domain debugging

$
0
0

 HOWTO

Describe domain
$  kubectl -n sample-domain1-ns describe domain sample-domain1
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-16T07:20:03Z
  Generation:          2
  Resource Version:    2948
  UID:                 8dc5eb07-aeca-43dc-adb9-086bd97e61c9
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:14.1.1.0-11
  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:
    Cluster Name:  cluster-1
    Conditions:
      Last Transition Time:  2024-03-16T07:44:51.848598Z
      Status:                True
      Type:                  Available
      Last Transition Time:  2024-03-16T07:44:51.848653Z
      Status:                True
      Type:                  Completed
    Label Selector:          weblogic.domainUID=sample-domain1,weblogic.clusterName=cluster-1
    Maximum Replicas:        5
    Minimum Replicas:        0
    Observed Generation:     2
    Ready Replicas:          1
    Replicas:                1
    Replicas Goal:           1
  Conditions:
    Last Transition Time:    2024-03-16T07:44:51.848475Z
    Status:                  True
    Type:                    Available
    Last Transition Time:    2024-03-16T07:44:51.848361Z
    Status:                  True
    Type:                    Completed
  Failed Introspection UID:  0bd431ef-b6ba-4d8e-93bd-611be705e03c
  Observed Generation:       2
  Replicas:                  1
  Servers:
    Health:
      Overall Health:  Not available
      Subsystems:
    Node Name:     minikube
    Pod Phase:     Running
    Pod Ready:     True
    Server Name:   admin-server
    State:         RUNNING
    State Goal:    RUNNING
    Cluster Name:  cluster-1
    Health:
      Overall Health:  Not available
      Subsystems:
    Node Name:     minikube
    Pod Phase:     Running
    Pod Ready:     True
    Server Name:   managed-server1
    State:         RUNNING
    State Goal:    RUNNING
    Cluster Name:  cluster-1
    Server Name:   managed-server2
    State:         SHUTDOWN
    State Goal:    SHUTDOWN
    Cluster Name:  cluster-1
    Server Name:   managed-server3
    State:         SHUTDOWN
    State Goal:    SHUTDOWN
    Cluster Name:  cluster-1
    Server Name:   managed-server4
    State:         SHUTDOWN
    State Goal:    SHUTDOWN
    Cluster Name:  cluster-1
    Server Name:   managed-server5
    State:         SHUTDOWN
    State Goal:    SHUTDOWN
  Start Time:      2024-03-16T07:20:04.243627Z
Events:
  Type     Reason       Age                 From               Message
  ----     ------       ----                ----               -------
  Normal   Created      25m                 weblogic.operator  Domain sample-domain1 was created.

Describe cluster
$ kubectl -n sample-domain1-ns describe cluster sample-domain1-cluster-1
Name:         sample-domain1-cluster-1
Namespace:    sample-domain1-ns
Labels:       weblogic.domainUID=sample-domain1
Annotations:  <none>
API Version:  weblogic.oracle/v1
Kind:         Cluster
Metadata:
  Creation Timestamp:  2024-03-16T07:20:04Z
  Generation:          2
  Resource Version:    3292
  UID:                 79c20a7a-1193-41d9-bdc4-2bf78d8350c0
Spec:
  Cluster Name:  cluster-1
  Replicas:      1
Status:
  Cluster Name:  cluster-1
  Conditions:
    Last Transition Time:  2024-03-16T07:51:07.078447Z
    Status:                False
    Type:                  Available
    Last Transition Time:  2024-03-16T07:51:07.078558Z
    Status:                False
    Type:                  Completed
  Label Selector:          weblogic.domainUID=sample-domain1,weblogic.clusterName=cluster-1
  Maximum Replicas:        5
  Minimum Replicas:        0
  Observed Generation:     2
  Ready Replicas:          1
  Replicas:                1
  Replicas Goal:           1
Events:
  Type     Reason              Age                 From               Message
  ----     ------              ----                ----               -------
  Normal   ClusterCreated      21m (x7 over 32m)   weblogic.operator  Cluster resource sample-domain1-cluster-1 was created.
  Normal   ClusterChanged      19m                 weblogic.operator  Cluster resource sample-domain1-cluster-1 was changed.
  Normal   ClusterAvailable    73s (x10 over 18m)  weblogic.operator  Cluster sample-domain1-cluster-1 is available: a sufficient number of its servers have reached the ready state.
  Normal   ClusterCompleted    73s (x10 over 18m)  weblogic.operator  Cluster sample-domain1-cluster-1 is complete because all of the following are true: there is no failure detected, there are no pending server shutdowns, and all servers expected to be running are ready and at their target image, auxiliary images, restart version, and introspect version.
  Warning  ClusterIncomplete   57s (x15 over 20m)  weblogic.operator  Cluster sample-domain1-cluster-1 is incomplete for one or more of the following reasons: there are failures detected, there are pending server shutdowns, or not all servers expected to be running are ready and at their target image, auxiliary images, restart version, and introspect version.
  Warning  ClusterUnavailable  57s (x15 over 20m)  weblogic.operator  Cluster sample-domain1-cluster-1 is unavailable: an insufficient number of its servers that are expected to be running are ready.";

workload distribution between managed servers

Weblogic dynamic clusters

$
0
0

HOWTO 

Previously, the WebLogic Kubernetes Operator supported configured clusters only.  That is, the operator could only manage and scale Managed Servers defined for a configured cluster.  Now, this limitation has been removed. By supporting dynamic clusters, the operator can easily scale the number of Managed Server instances based on a server template instead of requiring that you first manually configure them.

 

Creating a Dynamic Cluster in a WebLogic Domain in Kubernetes

 

The WebLogic Server team has been actively working to integrate WebLogic Server in Kubernetes, WebLogic Server Certification on Kubernetes.  The Oracle WebLogic Kubernetes Operator provides a mechanism for creating and managing any number of WebLogic domains, automates domain startup, allows scaling of WebLogic clusters, manages load balancing for web applications deployed in WebLogic clusters, and provides integration with Elasticsearch, Logstash, and Kibana. The operator is currently available as an open source project at https://oracle.github.io/weblogic-kubernetes-operator.  

 To create a WebLogic domain, see scripts

The following parameters of the input file are used when creating a dynamic cluster:

 

Parameter

Definition

Default

clusterName

The name of the WebLogic cluster instance to generate for the domain.

cluster-1

clusterType

The type of WebLogic cluster. Legal values are "CONFIGURED" or "DYNAMIC".

CONFIGURED

configuredManagedServerCount

 

The number of Managed Server instances to generate for the domain.

2

initialManagedServerReplicas

The number of Managed Servers to start initially for the domain.

2

managedServerNameBase

Base string used to generate Managed Server names.  Used as the server name prefix in a server template for dynamic clusters.

managed-server

 

 

 

The following example configuration will create a dynamic cluster named ‘cluster-1’ with four defined Managed Servers (managed-server1 … managed-server4) in which the operator will initially start up two Managed Servers instances, managed-server1and managed-server2:

 

# Type of WebLogic Cluster

# Legal values are "CONFIGURED" or "DYNAMIC"

clusterType: DYNAMIC

 

# Cluster name

clusterName: cluster-1

 

# Number of Managed Servers to generate for the domain

configuredManagedServerCount: 4

 

# Number of Managed Servers to initially start for the domain

initialManagedServerReplicas: 2

 

    # Base string used to generate Managed Server names

managedServerNameBase: managed-server



 


Weblogic Deploy Tool - discover domain

$
0
0

 HOWTO

GitHub

Install WDT 

 

dave@dave:/app$ tar xzvf weblogic-deploy.tar.gz 
weblogic-deploy/etc/logging.properties
weblogic-deploy/lib/python/compare_model.py
weblogic-deploy/lib/python/encrypt.py
weblogic-deploy/lib/python/update.py
weblogic-deploy/lib/python/deploy.py
weblogic-deploy/lib/python/create.py
weblogic-deploy/lib/python/extract_resource.py
weblogic-deploy/lib/python/discover.py
weblogic-deploy/lib/python/__init__.py
weblogic-deploy/lib/python/wlsdeploy/util/model_context.py
weblogic-deploy/lib/python/wlsdeploy/util/exit_code.py
weblogic-deploy/lib/python/wlsdeploy/util/weblogic_roles_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/getcreds.py
weblogic-deploy/lib/python/wlsdeploy/util/model_config.py
weblogic-deploy/lib/python/wlsdeploy/util/unicode_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/variables.py
weblogic-deploy/lib/python/wlsdeploy/util/cla_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/validate_configuration.py
weblogic-deploy/lib/python/wlsdeploy/util/__init__.py
weblogic-deploy/lib/python/wlsdeploy/util/model.py
weblogic-deploy/lib/python/wlsdeploy/util/target_configuration_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/string_utils.py
weblogic-deploy/lib/python/wlsdeploy/util/weblogic_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/model_translator.py
weblogic-deploy/lib/python/wlsdeploy/util/target_configuration.py
weblogic-deploy/lib/python/wlsdeploy/util/cla_utils.py
weblogic-deploy/lib/python/wlsdeploy/util/model_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/enum.py
weblogic-deploy/lib/python/wlsdeploy/util/tool_main.py
weblogic-deploy/lib/python/wlsdeploy/util/env_helper.py
weblogic-deploy/lib/python/wlsdeploy/util/path_utils.py
weblogic-deploy/lib/python/wlsdeploy/util/dictionary_utils.py
weblogic-deploy/lib/python/wlsdeploy/__init__.py
weblogic-deploy/lib/python/wlsdeploy/json/__init__.py
weblogic-deploy/lib/python/wlsdeploy/json/json_translator.py
weblogic-deploy/lib/python/wlsdeploy/yaml/__init__.py
weblogic-deploy/lib/python/wlsdeploy/yaml/yaml_translator.py
weblogic-deploy/lib/python/wlsdeploy/aliases/flattened_folder.py
weblogic-deploy/lib/python/wlsdeploy/aliases/wlst_modes.py
weblogic-deploy/lib/python/wlsdeploy/aliases/alias_entries.py
weblogic-deploy/lib/python/wlsdeploy/aliases/location_context.py
weblogic-deploy/lib/python/wlsdeploy/aliases/validation_codes.py
weblogic-deploy/lib/python/wlsdeploy/aliases/__init__.py
weblogic-deploy/lib/python/wlsdeploy/aliases/aliases.py
weblogic-deploy/lib/python/wlsdeploy/aliases/password_utils.py
weblogic-deploy/lib/python/wlsdeploy/aliases/alias_utils.py
weblogic-deploy/lib/python/wlsdeploy/aliases/alias_jvmargs.py
weblogic-deploy/lib/python/wlsdeploy/aliases/model_constants.py
weblogic-deploy/lib/python/wlsdeploy/aliases/alias_constants.py
weblogic-deploy/lib/python/wlsdeploy/exception/exception_types.py
weblogic-deploy/lib/python/wlsdeploy/exception/__init__.py
weblogic-deploy/lib/python/wlsdeploy/exception/exception_helper.py
weblogic-deploy/lib/python/wlsdeploy/logging/platform_logger.py
weblogic-deploy/lib/python/wlsdeploy/logging/__init__.py
weblogic-deploy/lib/python/wlsdeploy/logging/log_collector.py
weblogic-deploy/lib/python/wlsdeploy/tool/validate/validator.py
weblogic-deploy/lib/python/wlsdeploy/tool/validate/crd_sections_validator.py
weblogic-deploy/lib/python/wlsdeploy/tool/validate/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/validate/content_validator.py
weblogic-deploy/lib/python/wlsdeploy/tool/validate/validation_utils.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/multi_tenant_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/multi_tenant_resources_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/coherence_resources_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/global_resources_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/deployments_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/jms_resources_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/custom_folder_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/multi_tenant_topology_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/topology_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/domain_info_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/resources_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/discover/common_resources_discoverer.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/beaninfo_constants.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/results_file.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/filters/wko_filter.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/filters/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/filters/model_traverse.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/filters/wko_final_filter.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targeting_types.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/attribute_setter.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/target_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/mbean_utils.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/model_crd_folder.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/file_template_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/crd_file_updater.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/additional_output_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/schema_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/targets/model_crd_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/saml2_security_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/topology_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/model_context_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/filter_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/archive_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/appmodule_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/default_authenticator_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/rcu_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/credential_map_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/credential_injector.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/string_output_stream.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/library_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/variable_injector.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/variable_injector_functions.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/k8s_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/wlst_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/util/topology_profiles.py
weblogic-deploy/lib/python/wlsdeploy/tool/prepare/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/prepare/model_preparer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/jms_resources_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/datasource_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/deployer_utils.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/resources_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/applications_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/multi_tenant_resources_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/common_resources_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/model_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/log_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/odl_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/wldf_resources_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/coherence_resources_deployer.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/topology_updater.py
weblogic-deploy/lib/python/wlsdeploy/tool/deploy/applications_version_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/compare/model_comparer.py
weblogic-deploy/lib/python/wlsdeploy/tool/compare/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/extract/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/extract/domain_resource_extractor.py
weblogic-deploy/lib/python/wlsdeploy/tool/modelhelp/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/modelhelp/model_help_utils.py
weblogic-deploy/lib/python/wlsdeploy/tool/modelhelp/model_crd_section_printer.py
weblogic-deploy/lib/python/wlsdeploy/tool/modelhelp/model_help_printer.py
weblogic-deploy/lib/python/wlsdeploy/tool/modelhelp/model_sample_printer.py
weblogic-deploy/lib/python/wlsdeploy/tool/encrypt/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/encrypt/encryption_utils.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/domain_typedef.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/rcudbinfo_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/wlsroles_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/__init__.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/security_provider_creator.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/domain_creator.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/custom_folder_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/ssl_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/creator.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/atp_helper.py
weblogic-deploy/lib/python/wlsdeploy/tool/create/opss_helper.py
weblogic-deploy/lib/python/validate.py
weblogic-deploy/lib/python/model_help.py
weblogic-deploy/lib/python/variable_inject.py
weblogic-deploy/lib/python/prepare_model.py
weblogic-deploy/lib/typedefs/JRF.json
weblogic-deploy/lib/typedefs/JRF-Compact.json
weblogic-deploy/lib/typedefs/WLS.json
weblogic-deploy/lib/typedefs/RestrictedJRF.json
weblogic-deploy/lib/targets/vz/target.json
weblogic-deploy/lib/targets/vz/vz_filter.py
weblogic-deploy/lib/targets/wko4-pv/target.json
weblogic-deploy/lib/targets/wko4/target.json
weblogic-deploy/lib/targets/wko-pv/target.json
weblogic-deploy/lib/targets/vz-dii/target.json
weblogic-deploy/lib/targets/k8s/target.json
weblogic-deploy/lib/targets/k8s/k8s_operator_filter.py
weblogic-deploy/lib/targets/wko4-dii/target.json
weblogic-deploy/lib/targets/vz-pv/target.json
weblogic-deploy/lib/targets/wko-dii/target.json
weblogic-deploy/lib/targets/templates/wko-domain.yaml
weblogic-deploy/lib/targets/templates/vz-application-v1.yaml
weblogic-deploy/lib/targets/templates/wko-domain-v4.yaml
weblogic-deploy/lib/targets/wko/target.json
weblogic-deploy/lib/targets/wko/wko_operator_filter.py
weblogic-deploy/bin/discoverDomain.cmd
weblogic-deploy/bin/deployApps.cmd
weblogic-deploy/bin/extractDomainResource.cmd
weblogic-deploy/bin/injectVariables.cmd
weblogic-deploy/bin/prepareModel.cmd
weblogic-deploy/bin/updateDomain.cmd
weblogic-deploy/bin/validateModel.cmd
weblogic-deploy/bin/createDomain.cmd
weblogic-deploy/bin/modelHelp.cmd
weblogic-deploy/bin/shared.cmd
weblogic-deploy/bin/encryptModel.cmd
weblogic-deploy/bin/archiveHelper.cmd
weblogic-deploy/bin/compareModel.cmd
weblogic-deploy/bin/shared.sh
weblogic-deploy/bin/extractDomainResource.sh
weblogic-deploy/bin/prepareModel.sh
weblogic-deploy/bin/deployApps.sh
weblogic-deploy/bin/modelHelp.sh
weblogic-deploy/bin/encryptModel.sh
weblogic-deploy/bin/createDomain.sh
weblogic-deploy/bin/compareModel.sh
weblogic-deploy/bin/discoverDomain.sh
weblogic-deploy/bin/archiveHelper.sh
weblogic-deploy/bin/injectVariables.sh
weblogic-deploy/bin/updateDomain.sh
weblogic-deploy/bin/validateModel.sh
weblogic-deploy/lib/
weblogic-deploy/lib/injectors/
weblogic-deploy/lib/variable_keywords.json
weblogic-deploy/lib/tool.properties
weblogic-deploy/lib/injectors/host.json
weblogic-deploy/lib/injectors/target.json
weblogic-deploy/lib/injectors/url.json
weblogic-deploy/lib/injectors/port.json
weblogic-deploy/lib/injectors/credentials.json
weblogic-deploy/lib/injectors/topology.json
weblogic-deploy/samples/
weblogic-deploy/samples/model_variable_injector.json
weblogic-deploy/samples/custom_injector.json
weblogic-deploy/LICENSE.txt
weblogic-deploy/VERSION.txt
weblogic-deploy/lib/weblogic-deploy-core.jar
weblogic-deploy/lib/antlr4-runtime-4.9.3.jar
weblogic-deploy/lib/snakeyaml-2.2.jar
weblogic-deploy/lib/picocli-4.7.5.jar

Discover domain
dave@dave:/app/weblogic-deploy/bin$ ./discoverDomain.sh -oracle_home /app/weblogic -domain_home /app/domains/myDomain/ -archive_file /git/weblogic/wdt/DiscoveredMyDomain.zip -model_file /git/weblogic/wdt/DiscoveredMyDomain.yaml
JDK version is 11.0.21+9-LTS-193
JAVA_HOME = /usr/java/jdk-11
WLST_EXT_CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
WLST_PROPERTIES = -Dcom.oracle.cie.script.throwException=true -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig 
/app/weblogic/oracle_common/common/bin/wlst.sh /app/weblogic-deploy/lib/python/discover.py -oracle_home /app/weblogic -domain_home /app/domains/myDomain/ -archive_file /git/weblogic/wdt/DiscoveredMyDomain.zip -model_file /git/weblogic/wdt/DiscoveredMyDomain.yaml

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Mar 16, 2024 6:35:46 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling discoverDomain version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Mar 16, 2024 6:35:46 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The discoverDomain program will write its log to directory /app/weblogic-deploy/logs>
####<Mar 16, 2024 6:35:46 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 16, 2024 6:35:46 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 16, 2024 6:35:46 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 16, 2024 6:35:46 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 16, 2024 6:35:46 PM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Mar 16, 2024 6:35:46 PM> <INFO> <discover> <main> <WLSDPLY-06024> <No variable file provided. Model passwords will contain the token '-- FIX ME --'>
####<Mar 16, 2024 6:35:49 PM> <INFO> <discover> <_get_domain_name> <WLSDPLY-06022> <Discover domain myDomain>
####<Mar 16, 2024 6:35:49 PM> <INFO> <TopologyDiscoverer> <discover> <WLSDPLY-06600> <Discovering domain model topology>
####<Mar 16, 2024 6:35:49 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain Log>
####<Mar 16, 2024 6:35:49 PM> <INFO> <TopologyDiscoverer> <_get_nm_properties> <WLSDPLY-06627> <Discovering NM Properties>
####<Mar 16, 2024 6:35:50 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06601> <Discovering 1 clusters>
####<Mar 16, 2024 6:35:50 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster cluster1>
####<Mar 16, 2024 6:35:50 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06603> <Discovering 1 servers>
####<Mar 16, 2024 6:35:50 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server myadmin>
####<Mar 16, 2024 6:35:50 PM> <INFO> <TopologyDiscoverer> <get_server_templates> <WLSDPLY-06605> <Discovering 1 server templates>
####<Mar 16, 2024 6:35:50 PM> <INFO> <TopologyDiscoverer> <get_server_templates> <WLSDPLY-06606> <Adding cluster1-template Server Template>
####<Mar 16, 2024 6:35:51 PM> <INFO> <TopologyDiscoverer> <discover_security_configuration> <WLSDPLY-06622> <Adding Security Configuration>
####<Mar 16, 2024 6:35:52 PM> <INFO> <TopologyDiscoverer> <get_embedded_ldap_configuration> <WLSDPLY-06639> <Skipping Embedded LDAP Server Configuration>
####<Mar 16, 2024 6:35:52 PM> <INFO> <ResourcesDiscoverer> <discover> <WLSDPLY-06300> <Discovering domain model resources>
####<Mar 16, 2024 6:35:52 PM> <INFO> <DeploymentsDiscoverer> <discover> <WLSDPLY-06380> <Discovering domain model deployments>
####<Mar 16, 2024 6:35:52 PM> <INFO> <DeploymentsDiscoverer> <get_applications> <WLSDPLY-06391> <Discovering 1 Applications>
####<Mar 16, 2024 6:35:52 PM> <INFO> <DeploymentsDiscoverer> <get_applications> <WLSDPLY-06392> <Adding Application basicWebappEjb>
####<Mar 16, 2024 6:35:52 PM> <INFO> <DeploymentsDiscoverer> <add_application_to_archive> <WLSDPLY-06394> <Add application basicWebappEjb binary /u01/oracle/user_projects/domains/basicWebappEjb.war to archive>
####<Mar 16, 2024 6:35:52 PM> <WARNING> <DeploymentsDiscoverer> <_disconnect_target> <WLSDPLY-06395> <Cannot add application binary for application basicWebappEjb to archive file. The application was removed from target cluster1 : WLSDeployArchive /git/weblogic/wdt/DiscoveredMyDomain.zip unable to add file /u01/oracle/user_projects/domains/basicWebappEjb.war to the archive because the file does not exist>
####<Mar 16, 2024 6:35:52 PM> <INFO> <MultiTenantDiscoverer> <discover> <WLSDPLY-06700> <Discover Multi-tenant>
####<Mar 16, 2024 6:35:52 PM> <INFO> <MultiTenantTopologyDiscoverer> <discover> <WLSDPLY-06709> <Discover Multi-tenant Topology>
####<Mar 16, 2024 6:35:52 PM> <INFO> <MultiTenantResourcesDiscoverer> <discover> <WLSDPLY-06707> <Discover Multi-tenant Resources>
####<Mar 16, 2024 6:35:52 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20017> <No filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Mar 16, 2024 6:35:52 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type discover found in filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Mar 16, 2024 6:35:52 PM> <INFO> <variable_injector> <inject_variables_keyword_file> <WLSDPLY-19519> <No variables were inserted into the model during variable replacement>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST OFFLINE mode>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredMyDomain.yaml model file>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05005> <Performing archive validation on the /git/weblogic/wdt/DiscoveredMyDomain.zip archive file>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_single_path_in_archive> <WLSDPLY-05031> <Attribute FileName in model location topology:/Log references a relative file location myDomain.log.  This makes the model subject to failure unless the tool invoked from the correct location to resolve the relative path to the file. It is recommended to use a path token if the absolute path is expected to change between systems.>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredMyDomain.yaml does not contain a resources section, validation of resources was skipped.>
####<Mar 16, 2024 6:35:52 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>

Issue Log for discoverDomain version 3.5.4 running WebLogic version 14.1.1.0.0 offline mode:

WARNING Messages:

        1. WLSDPLY-06395: Cannot add application binary for application basicWebappEjb to archive file. The application was removed from target cluster1 : WLSDeployArchive /git/weblogic/wdt/DiscoveredMyDomain.zip unable to add file /u01/oracle/user_projects/domains/basicWebappEjb.war to the archive because the file does not exist

Total:   SEVERE :    0  WARNING :    1

discoverDomain.sh completed but with some issues (exit code = 1)

Created model file
$ cat  /git/weblogic/wdt/DiscoveredMyDomain.yaml 
# This model was created using the WebLogic Deploy Tooling 3.5.4 discoverDomain tool
# running in OFFLINE mode against a domain using WebLogic Server 14.1.1.0.0.
# 
domainInfo:
    AdminUserName: --FIX ME--
    AdminPassword: --FIX ME--
topology:
    Name: myDomain
    AdminServerName: myadmin
    Log:
        FileName: myDomain.log
    NMProperties:
        DomainsFile: /u01/oracle/user_projects/domains/myDomain/nodemanager/nodemanager.domains
        LogFile: /u01/oracle/user_projects/domains/myDomain/nodemanager/nodemanager.log
        JavaHome: /usr/lib/jvm/jdk-11-oracle-x64
        NodeManagerHome: /u01/oracle/user_projects/domains/myDomain/nodemanager
    Cluster:
        cluster1:
            DynamicServers:
                DynamicClusterSize: 2
                MaxDynamicClusterSize: 2
                ServerNamePrefix: MS
                ServerTemplate: cluster1-template
                CalculatedListenPorts: false
                MaximumDynamicServerCount: 2
    Server:
        myadmin: {}
    ServerTemplate:
        cluster1-template:
            Cluster: cluster1
            ListenPort: 8001
            JTAMigratableTarget:
                Cluster: cluster1
                MigrationPolicy: manual
appDeployments:
    Application:
        basicWebappEjb:
            SourcePath: /u01/oracle/user_projects/domains/basicWebappEjb.war
            ModuleType: war
            SecurityDDModel: DDOnly

Archive file for wldeploy
$ jar tvf /git/weblogic/wdt/DiscoveredMyDomain.zip
28381726 Sat Mar 16 18:43:28 CET 2024 wlsdeploy/applications/basicWebappEjb.war

run extract model
ave@dave:/app/weblogic-deploy/bin$ ./extractDomainResource.sh -oracle_home /app/weblogic -domain_home /app/domains/myDomain/ -model_file  /git/weblogic/wdt/DiscoveredMyDomain.yaml  -output_dir  /git/weblogic/wdt/resource -target wko
JDK version is 11.0.21+9-LTS-193
JAVA_HOME = /usr/java/jdk-11
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar
JAVA_PROPERTIES = -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console= 
/usr/java/jdk-11/bin/java -cp /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar           -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console=            -Dpython.path=/app/weblogic/wlserver/common/wlst/modules/jython-modules.jar/Lib           org.python.util.jython           /app/weblogic-deploy/lib/python/extract_resource.py -oracle_home /app/weblogic -domain_home /app/domains/myDomain/ -model_file /git/weblogic/wdt/DiscoveredMyDomain.yaml -output_dir /git/weblogic/wdt/resource -target wko
####<Mar 16, 2024 6:54:07 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling extractDomainResource version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Mar 16, 2024 6:54:07 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The extractDomainResource program will write its log to directory /app/weblogic-deploy/logs>
####<Mar 16, 2024 6:54:08 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 16, 2024 6:54:08 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 16, 2024 6:54:08 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 16, 2024 6:54:08 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 16, 2024 6:54:08 PM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Mar 16, 2024 6:54:08 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type extract found in filter configuration file /app/weblogic-deploy/lib/targets/wko/target.json>
####<Mar 16, 2024 6:54:08 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST OFFLINE mode>
####<Mar 16, 2024 6:54:08 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredMyDomain.yaml model file>
####<Mar 16, 2024 6:54:08 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Mar 16, 2024 6:54:08 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Mar 16, 2024 6:54:08 PM> <INFO> <Validator> <__validate_single_path_in_archive> <WLSDPLY-05031> <Attribute FileName in model location topology:/Log references a relative file location myDomain.log.  This makes the model subject to failure unless the tool invoked from the correct location to resolve the relative path to the file. It is recommended to use a path token if the absolute path is expected to change between systems.>
####<Mar 16, 2024 6:54:09 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Mar 16, 2024 6:54:09 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredMyDomain.yaml does not contain a resources section, validation of resources was skipped.>
####<Mar 16, 2024 6:54:09 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Mar 16, 2024 6:54:09 PM> <INFO> <Validator> <__validate_single_path_in_archive> <WLSDPLY-05025> <Attribute SourcePath in model location appDeployments:/Application/basicWebappEjb references archive entry wlsdeploy/applications/basicWebappEjb.war but the archive file was not provided>
####<Mar 16, 2024 6:54:09 PM> <INFO> <vz_config_helper> <_create_file> <WLSDPLY-01662> <Creating target configuration file /git/weblogic/wdt/resource/wko-domain.yaml>
####<Mar 16, 2024 6:54:09 PM> <INFO> <crd_file_updater> <update_from_model> <WLSDPLY-01675> <Updating target output file "/git/weblogic/wdt/resource/wko-domain.yaml" from the kubernetes section of the model>

Issue Log for extractDomainResource version 3.5.4 running WebLogic version 14.1.1.0.0 offline mode:

Total:   SEVERE :    0  WARNING :    0

extractDomainResource.sh completed successfully (exit code = 0)

extract domain - created model
$ cat resource/wko-domain.yaml
apiVersion: weblogic.oracle/v8
kind: Domain
metadata:
    name: mydomain
    namespace: mydomain
    labels:
        weblogic.domainUID: mydomain
spec:
    domainHome: /app/domains/myDomain/
    domainHomeSourceType: FromModel
    image: '{{{imageName}}}'
    # Add any credential secrets that are required to pull the image
    imagePullSecrets: []
    webLogicCredentialsSecret:
        name: mydomain-weblogic-credentials
    serverPod:
        env:
          - name: JAVA_OPTIONS
            value: -Dweblogic.StdoutDebugEnabled=false
          - name: USER_MEM_ARGS
            value: '-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m '
    clusters:
      - clusterName: cluster1
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
    configuration:
        istio:
            enabled: false
        introspectorJobActiveDeadlineSeconds: 900
        model:
            domainType: WLS
            modelHome: '{{{modelHome}}}'
            runtimeEncryptionSecret: mydomain-runtime-encryption-secret

Weblogic k8s - create model image

$
0
0

 HOWTO

 

GitHub 

Steps to do 

  • Install WIT 
  • Prepare WDT model 
  • Create auxiliary image via WIT
  • Create domain  via kubectl

 

Weblogic Deploy Tool - discover domain with 4 managed servers

$
0
0

 HOWTO


See also 

GitHub



Create Weblogic domain via config.sh 




Discover domain via WDT


$ ./discoverDomain.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDomain.yaml -admin_user weblogic -admin_url t3://dave:7001
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
WLST_EXT_CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
WLST_PROPERTIES = -Dcom.oracle.cie.script.throwException=true -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig 
/app/weblogic/oracle_common/common/bin/wlst.sh /app/weblogic-deploy/lib/python/discover.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDomain.yaml -admin_user weblogic -admin_url t3://dave:7001

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Mar 29, 2024 10:20:37 AM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling discoverDomain version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Mar 29, 2024 10:20:37 AM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The discoverDomain program will write its log to directory /app/weblogic-deploy/logs>
####<Mar 29, 2024 10:20:37 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:20:37 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
Please enter the WebLogic administrator password: 
####<Mar 29, 2024 10:20:44 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:20:44 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 29, 2024 10:20:44 AM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Mar 29, 2024 10:20:44 AM> <INFO> <discover> <main> <WLSDPLY-06024> <No variable file provided. Model passwords will contain the token '-- FIX ME --'>

####<Mar 29, 2024 10:20:45 AM> <INFO> <discover> <_get_domain_name> <WLSDPLY-06022> <Discover domain base_domain>
####<Mar 29, 2024 10:20:46 AM> <INFO> <TopologyDiscoverer> <discover> <WLSDPLY-06600> <Discovering domain model topology>
####<Mar 29, 2024 10:20:47 AM> <INFO> <WlstHelper> <is_set> <WLSDPLY-00129> <Error calling isSet() for attribute ResourceManagement at location /: java.lang.AssertionError: java.lang.reflect.InvocationTargetException>
####<Mar 29, 2024 10:20:47 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain AdminConsole>
####<Mar 29, 2024 10:20:47 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain CdiContainer>
####<Mar 29, 2024 10:20:47 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JMX>
####<Mar 29, 2024 10:20:48 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JPA>
####<Mar 29, 2024 10:20:48 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JTA>
####<Mar 29, 2024 10:20:48 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain Log>
####<Mar 29, 2024 10:20:49 AM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain RestfulManagementServices>
####<Mar 29, 2024 10:20:49 AM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06601> <Discovering 2 clusters>
####<Mar 29, 2024 10:20:49 AM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterA>
####<Mar 29, 2024 10:20:52 AM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterB>
####<Mar 29, 2024 10:20:54 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06603> <Discovering 5 servers>
####<Mar 29, 2024 10:20:54 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server AdminServer>
####<Mar 29, 2024 10:21:07 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA1>
####<Mar 29, 2024 10:21:19 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA2>
####<Mar 29, 2024 10:21:31 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB1>
####<Mar 29, 2024 10:21:43 AM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB2>
####<Mar 29, 2024 10:21:54 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06607> <Discovering 4 Migratable Targets>
####<Mar 29, 2024 10:21:54 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA1 (migratable)>
####<Mar 29, 2024 10:21:54 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA2 (migratable)>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB1 (migratable)>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB2 (migratable)>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_server_templates> <WLSDPLY-06605> <Discovering 0 server templates>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_unix_machines> <WLSDPLY-06609> <Discovering 2 Unix machines>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06611> <Discovering 2 machines>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineA>
####<Mar 29, 2024 10:21:55 AM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineB>
####<Mar 29, 2024 10:21:56 AM> <INFO> <TopologyDiscoverer> <discover_security_configuration> <WLSDPLY-06622> <Adding Security Configuration>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <get_embedded_ldap_configuration> <WLSDPLY-06639> <Skipping Embedded LDAP Server Configuration>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_log_filters> <WLSDPLY-06628> <Discovering 0 Log Filters>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_reliable_delivery_policies> <WLSDPLY-06630> <Discovering 0 Reliable Delivery Policies>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_virtual_hosts> <WLSDPLY-06647> <Discovering 0 Virtual Hosts>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_xml_entity_caches> <WLSDPLY-06632> <Discovering 0 XML Entity Caches>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_xml_registries> <WLSDPLY-06634> <Discovering 0 XML Registries>
####<Mar 29, 2024 10:21:58 AM> <INFO> <TopologyDiscoverer> <_get_ws_securities> <WLSDPLY-06649> <Discovering 0 Web Service Securities>
####<Mar 29, 2024 10:21:58 AM> <INFO> <ResourcesDiscoverer> <discover> <WLSDPLY-06300> <Discovering domain model resources>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_self_tuning> <WLSDPLY-06441> <Adding Self Tuning>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_startup_classes> <WLSDPLY-06442> <Discovering 0 Startup Classes>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_shutdown_classes> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <_get_webapp_container> <WLSDPLY-06615> <Cross Domain Security is enabled, do not remove SecurityConfiguration CredentialEncrypted>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_singleton_service> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_jolt_connection_pool> <WLSDPLY-06449> <Discovering 0 Jolt Connection Pools>
####<Mar 29, 2024 10:21:58 AM> <INFO> <GlobalResourcesDiscoverer> <get_wtc_servers> <WLSDPLY-06451> <Discovering 0 WTC Servers>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_datasources> <WLSDPLY-06340> <Discovering 0 JDBC System Resources>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_foreign_jndi_providers> <WLSDPLY-06342> <Discovering 0 Foreign JNDI Providers>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_mail_sessions> <WLSDPLY-06344> <Discovering 0 Mail Sessions>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_file_stores> <WLSDPLY-06346> <Discovering 0 File Stores>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_jdbc_stores> <WLSDPLY-06350> <Discovering 0 JDBC Stores>
####<Mar 29, 2024 10:21:58 AM> <INFO> <CommonResourcesDiscoverer> <get_path_services> <WLSDPLY-06355> <Discovering 0 Path Services>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_servers> <WLSDPLY-06470> <Discovering 0 JMS Servers>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_saf_agents> <WLSDPLY-06472> <Discovering 0 SAF Agents>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_system_resources> <WLSDPLY-06478> <Discovering 0 JMS System Resources>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridge_destinations> <WLSDPLY-06474> <Discovering 0 JMS Bridge Destinations>
####<Mar 29, 2024 10:21:58 AM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridges> <WLSDPLY-06476> <Discovering 0 JMS Messaging Bridges>
####<Mar 29, 2024 10:21:59 AM> <INFO> <CommonResourcesDiscoverer> <get_wldf_system_resources> <WLSDPLY-06357> <Discovering 0 WLDF System Resources>
####<Mar 29, 2024 10:21:59 AM> <INFO> <CommonResourcesDiscoverer> <_get_named_resources> <WLSDPLY-06364> <Discovering 0 SystemComponent elements>
####<Mar 29, 2024 10:21:59 AM> <INFO> <CoherenceResourcesDiscoverer> <_get_coherence_clusters> <WLSDPLY-06311> <Discovering 0 Coherence Cluster System Resources>
####<Mar 29, 2024 10:21:59 AM> <INFO> <DeploymentsDiscoverer> <discover> <WLSDPLY-06380> <Discovering domain model deployments>
####<Mar 29, 2024 10:21:59 AM> <INFO> <MultiTenantDiscoverer> <discover> <WLSDPLY-06700> <Discover Multi-tenant>
####<Mar 29, 2024 10:21:59 AM> <INFO> <MultiTenantTopologyDiscoverer> <discover> <WLSDPLY-06709> <Discover Multi-tenant Topology>
####<Mar 29, 2024 10:21:59 AM> <INFO> <MultiTenantResourcesDiscoverer> <discover> <WLSDPLY-06707> <Discover Multi-tenant Resources>
####<Mar 29, 2024 10:21:59 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20017> <No filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Mar 29, 2024 10:21:59 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type discover found in filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Mar 29, 2024 10:21:59 AM> <INFO> <variable_injector> <inject_variables_keyword_file> <WLSDPLY-19519> <No variables were inserted into the model during variable replacement>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST ONLINE mode>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDomain.yaml model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05005> <Performing archive validation on the /git/weblogic/wdt/DiscoveredABDomain.zip archive file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a resources section, validation of resources was skipped.>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Mar 29, 2024 10:21:59 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a appDeployments section, validation of appDeployments was skipped.>

Issue Log for discoverDomain version 3.5.4 running WebLogic version 14.1.1.0.0 online mode:

Total:   SEVERE :    0  WARNING :    0

discoverDomain.sh completed successfully (exit code = 0)


Created model 

$ cat /git/weblogic/wdt/DiscoveredABDomain.yaml
# This model was created using the WebLogic Deploy Tooling 3.5.4 discoverDomain tool
# running in ONLINE mode against a domain using WebLogic Server 14.1.1.0.0.
# 
domainInfo:
    AdminUserName: --FIX ME--
    AdminPassword: --FIX ME--
topology:
    Name: base_domain
    Cluster:
        ClusterA: {}
        ClusterB: {}
    Server:
        AdminServer:
            Machine: machineA
        ManagedServerA1:
            ListenPort: 7003
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA1
                Cluster: ClusterA
        ManagedServerA2:
            ListenPort: 7004
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA2
                Cluster: ClusterA
        ManagedServerB1:
            ListenPort: 7005
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB1
                Cluster: ClusterB
        ManagedServerB2:
            ListenPort: 7006
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB2
                Cluster: ClusterB
    MigratableTarget:
        ManagedServerA1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA1
            Cluster: ClusterA
        ManagedServerA2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA2
            Cluster: ClusterA
        ManagedServerB1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB1
            Cluster: ClusterB
        ManagedServerB2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB2
            Cluster: ClusterB
    Machine:
        machineA: {}
        machineB: {}
    SecurityConfiguration:
        NodeManagerPasswordEncrypted: --FIX ME--


Extract domain 

$ ./extractDomainResource.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file  /git/weblogic/wdt/DiscoveredABDomain.yaml  -output_dir  /git/weblogic/wdt/resource/k8s -target wko
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar
JAVA_PROPERTIES = -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console= 
/usr/java/jdk-11/bin/java -cp /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar           -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console=            -Dpython.path=/app/weblogic/wlserver/common/wlst/modules/jython-modules.jar/Lib           org.python.util.jython           /app/weblogic-deploy/lib/python/extract_resource.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file /git/weblogic/wdt/DiscoveredABDomain.yaml -output_dir /git/weblogic/wdt/resource/k8s -target wko
####<Mar 29, 2024 10:35:25 AM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling extractDomainResource version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Mar 29, 2024 10:35:25 AM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The extractDomainResource program will write its log to directory /app/weblogic-deploy/logs>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Mar 29, 2024 10:35:25 AM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Mar 29, 2024 10:35:26 AM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type extract found in filter configuration file /app/weblogic-deploy/lib/targets/wko/target.json>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST OFFLINE mode>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDomain.yaml model file>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Mar 29, 2024 10:35:26 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a resources section, validation of resources was skipped.>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Mar 29, 2024 10:35:27 AM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05009> <Model file /git/weblogic/wdt/DiscoveredABDomain.yaml does not contain a appDeployments section, validation of appDeployments was skipped.>
####<Mar 29, 2024 10:35:27 AM> <INFO> <vz_config_helper> <_create_file> <WLSDPLY-01662> <Creating target configuration file /git/weblogic/wdt/resource/k8s/wko-domain.yaml>
####<Mar 29, 2024 10:35:27 AM> <INFO> <crd_file_updater> <update_from_model> <WLSDPLY-01675> <Updating target output file "/git/weblogic/wdt/resource/k8s/wko-domain.yaml" from the kubernetes section of the model>

Issue Log for extractDomainResource version 3.5.4 running WebLogic version 14.1.1.0.0 offline mode:

Total:   SEVERE :    0  WARNING :    0

extractDomainResource.sh completed successfully (exit code = 0)


Generated domain resource
$ cat /git/weblogic/wdt/resource/k8s/wko-domain.yaml
apiVersion: weblogic.oracle/v8
kind: Domain
metadata:
    name: base-domain
    namespace: base-domain
    labels:
        weblogic.domainUID: base-domain
spec:
    domainHome: /app/weblogic/user_projects/domains/base_domain/
    domainHomeSourceType: FromModel
    image: '{{{imageName}}}'
    # Add any credential secrets that are required to pull the image
    imagePullSecrets: []
    webLogicCredentialsSecret:
        name: base-domain-weblogic-credentials
    serverPod:
        env:
          - name: JAVA_OPTIONS
            value: -Dweblogic.StdoutDebugEnabled=false
          - name: USER_MEM_ARGS
            value: '-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m '
    clusters:
      - clusterName: ClusterA
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
      - clusterName: ClusterB
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
    configuration:
        istio:
            enabled: false
        introspectorJobActiveDeadlineSeconds: 900
        model:
            domainType: WLS
            modelHome: '{{{modelHome}}}'
            runtimeEncryptionSecret: base-domain-runtime-encryption-secret

WDT - discover domain with 4 managed servers, DS and EAR

$
0
0

 HOWTO


GitHub


Deploy DS and EAR via Weblogic console 




Run discover.sh


dave@dave:/app/weblogic-deploy/bin$ ./discoverDomain.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml -admin_user weblogic -admin_url t3://dave:7001
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
WLST_EXT_CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar
WLST_PROPERTIES = -Dcom.oracle.cie.script.throwException=true -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig 
/app/weblogic/oracle_common/common/bin/wlst.sh /app/weblogic-deploy/lib/python/discover.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -archive_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip -model_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml -admin_user weblogic -admin_url t3://dave:7001

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

####<Apr 1, 2024 10:50:35 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling discoverDomain version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Apr 1, 2024 10:50:35 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The discoverDomain program will write its log to directory /app/weblogic-deploy/logs>
####<Apr 1, 2024 10:50:35 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:50:35 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
Please enter the WebLogic administrator password: 
####<Apr 1, 2024 10:50:40 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:50:40 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Apr 1, 2024 10:50:40 PM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Apr 1, 2024 10:50:40 PM> <INFO> <discover> <main> <WLSDPLY-06024> <No variable file provided. Model passwords will contain the token '-- FIX ME --'>

####<Apr 1, 2024 10:50:41 PM> <INFO> <discover> <_get_domain_name> <WLSDPLY-06022> <Discover domain base_domain>
####<Apr 1, 2024 10:50:42 PM> <INFO> <TopologyDiscoverer> <discover> <WLSDPLY-06600> <Discovering domain model topology>
####<Apr 1, 2024 10:50:43 PM> <INFO> <WlstHelper> <is_set> <WLSDPLY-00129> <Error calling isSet() for attribute ResourceManagement at location /: java.lang.AssertionError: java.lang.reflect.InvocationTargetException>
####<Apr 1, 2024 10:50:43 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain AdminConsole>
####<Apr 1, 2024 10:50:43 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain CdiContainer>
####<Apr 1, 2024 10:50:44 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JMX>
####<Apr 1, 2024 10:50:44 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JPA>
####<Apr 1, 2024 10:50:44 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain JTA>
####<Apr 1, 2024 10:50:45 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain Log>
####<Apr 1, 2024 10:50:45 PM> <INFO> <Discoverer> <discover_domain_mbean> <WLSDPLY-06644> <Adding Domain RestfulManagementServices>
####<Apr 1, 2024 10:50:45 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06601> <Discovering 2 clusters>
####<Apr 1, 2024 10:50:45 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterA>
####<Apr 1, 2024 10:50:48 PM> <INFO> <TopologyDiscoverer> <get_clusters> <WLSDPLY-06602> <Adding Cluster ClusterB>
####<Apr 1, 2024 10:50:50 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06603> <Discovering 5 servers>
####<Apr 1, 2024 10:50:50 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server AdminServer>
####<Apr 1, 2024 10:51:03 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA1>
####<Apr 1, 2024 10:51:15 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerA2>
####<Apr 1, 2024 10:51:27 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB1>
####<Apr 1, 2024 10:51:40 PM> <INFO> <TopologyDiscoverer> <get_servers> <WLSDPLY-06604> <Adding Server ManagedServerB2>
####<Apr 1, 2024 10:51:52 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06607> <Discovering 4 Migratable Targets>
####<Apr 1, 2024 10:51:52 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA1 (migratable)>
####<Apr 1, 2024 10:51:52 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerA2 (migratable)>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB1 (migratable)>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_migratable_targets> <WLSDPLY-06608> <Adding Migratable Target ManagedServerB2 (migratable)>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_server_templates> <WLSDPLY-06605> <Discovering 0 server templates>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_unix_machines> <WLSDPLY-06609> <Discovering 2 Unix machines>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06611> <Discovering 2 machines>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineA>
####<Apr 1, 2024 10:51:53 PM> <INFO> <TopologyDiscoverer> <get_machines> <WLSDPLY-06612> <Adding Machine machineB>
####<Apr 1, 2024 10:51:54 PM> <INFO> <TopologyDiscoverer> <discover_security_configuration> <WLSDPLY-06622> <Adding Security Configuration>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <get_embedded_ldap_configuration> <WLSDPLY-06639> <Skipping Embedded LDAP Server Configuration>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_log_filters> <WLSDPLY-06628> <Discovering 0 Log Filters>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_reliable_delivery_policies> <WLSDPLY-06630> <Discovering 0 Reliable Delivery Policies>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_virtual_hosts> <WLSDPLY-06647> <Discovering 0 Virtual Hosts>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_xml_entity_caches> <WLSDPLY-06632> <Discovering 0 XML Entity Caches>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_xml_registries> <WLSDPLY-06634> <Discovering 0 XML Registries>
####<Apr 1, 2024 10:51:56 PM> <INFO> <TopologyDiscoverer> <_get_ws_securities> <WLSDPLY-06649> <Discovering 0 Web Service Securities>
####<Apr 1, 2024 10:51:56 PM> <INFO> <ResourcesDiscoverer> <discover> <WLSDPLY-06300> <Discovering domain model resources>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_self_tuning> <WLSDPLY-06441> <Adding Self Tuning>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_startup_classes> <WLSDPLY-06442> <Discovering 0 Startup Classes>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_shutdown_classes> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <_get_webapp_container> <WLSDPLY-06615> <Cross Domain Security is enabled, do not remove SecurityConfiguration CredentialEncrypted>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_singleton_service> <WLSDPLY-06445> <Discovering 0 Shutdown Classes>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_jolt_connection_pool> <WLSDPLY-06449> <Discovering 0 Jolt Connection Pools>
####<Apr 1, 2024 10:51:56 PM> <INFO> <GlobalResourcesDiscoverer> <get_wtc_servers> <WLSDPLY-06451> <Discovering 0 WTC Servers>
####<Apr 1, 2024 10:51:56 PM> <INFO> <CommonResourcesDiscoverer> <get_datasources> <WLSDPLY-06340> <Discovering 1 JDBC System Resources>
####<Apr 1, 2024 10:51:56 PM> <INFO> <CommonResourcesDiscoverer> <get_datasources> <WLSDPLY-06341> <Adding JDBC System Resource JDBC-Data-Source-Oracle>
####<Apr 1, 2024 10:51:57 PM> <INFO> <CommonResourcesDiscoverer> <get_foreign_jndi_providers> <WLSDPLY-06342> <Discovering 0 Foreign JNDI Providers>
####<Apr 1, 2024 10:51:57 PM> <INFO> <CommonResourcesDiscoverer> <get_mail_sessions> <WLSDPLY-06344> <Discovering 0 Mail Sessions>
####<Apr 1, 2024 10:51:57 PM> <INFO> <CommonResourcesDiscoverer> <get_file_stores> <WLSDPLY-06346> <Discovering 0 File Stores>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <get_jdbc_stores> <WLSDPLY-06350> <Discovering 0 JDBC Stores>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <get_path_services> <WLSDPLY-06355> <Discovering 0 Path Services>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_servers> <WLSDPLY-06470> <Discovering 0 JMS Servers>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_saf_agents> <WLSDPLY-06472> <Discovering 0 SAF Agents>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_system_resources> <WLSDPLY-06478> <Discovering 0 JMS System Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridge_destinations> <WLSDPLY-06474> <Discovering 0 JMS Bridge Destinations>
####<Apr 1, 2024 10:51:58 PM> <INFO> <JmsResourcesDiscoverer> <get_jms_bridges> <WLSDPLY-06476> <Discovering 0 JMS Messaging Bridges>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <get_wldf_system_resources> <WLSDPLY-06357> <Discovering 0 WLDF System Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CommonResourcesDiscoverer> <_get_named_resources> <WLSDPLY-06364> <Discovering 0 SystemComponent elements>
####<Apr 1, 2024 10:51:58 PM> <INFO> <CoherenceResourcesDiscoverer> <_get_coherence_clusters> <WLSDPLY-06311> <Discovering 0 Coherence Cluster System Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <discover> <WLSDPLY-06380> <Discovering domain model deployments>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <get_applications> <WLSDPLY-06391> <Discovering 1 Applications>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <get_applications> <WLSDPLY-06392> <Adding Application basicWebapp>
####<Apr 1, 2024 10:51:58 PM> <INFO> <DeploymentsDiscoverer> <add_application_to_archive> <WLSDPLY-06394> <Add application basicWebapp binary /git/weblogic/dave-basic-project/dave-basic-webapp-project/target/basicWebapp.war to archive>
####<Apr 1, 2024 10:51:58 PM> <INFO> <MultiTenantDiscoverer> <discover> <WLSDPLY-06700> <Discover Multi-tenant>
####<Apr 1, 2024 10:51:58 PM> <INFO> <MultiTenantTopologyDiscoverer> <discover> <WLSDPLY-06709> <Discover Multi-tenant Topology>
####<Apr 1, 2024 10:51:58 PM> <INFO> <MultiTenantResourcesDiscoverer> <discover> <WLSDPLY-06707> <Discover Multi-tenant Resources>
####<Apr 1, 2024 10:51:58 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20017> <No filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Apr 1, 2024 10:51:58 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type discover found in filter configuration file /app/weblogic-deploy/lib/model_filters.json>
####<Apr 1, 2024 10:51:58 PM> <INFO> <variable_injector> <inject_variables_keyword_file> <WLSDPLY-19519> <No variables were inserted into the model during variable replacement>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST ONLINE mode>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05005> <Performing archive validation on the /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip archive file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Apr 1, 2024 10:51:58 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>

Issue Log for discoverDomain version 3.5.4 running WebLogic version 14.1.1.0.0 online mode:

Total:   SEVERE :    0  WARNING :    0

discoverDomain.sh completed successfully (exit code = 0)

Created model
$ cat /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml
# This model was created using the WebLogic Deploy Tooling 3.5.4 discoverDomain tool
# running in ONLINE mode against a domain using WebLogic Server 14.1.1.0.0.
# 
domainInfo:
    AdminUserName: --FIX ME--
    AdminPassword: --FIX ME--
topology:
    Name: base_domain
    Cluster:
        ClusterA: {}
        ClusterB: {}
    Server:
        AdminServer:
            Machine: machineA
        ManagedServerA1:
            ListenPort: 7003
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA1
                Cluster: ClusterA
        ManagedServerA2:
            ListenPort: 7004
            Machine: machineA
            Cluster: ClusterA
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerA2
                Cluster: ClusterA
        ManagedServerB1:
            ListenPort: 7005
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB1
                Cluster: ClusterB
        ManagedServerB2:
            ListenPort: 7006
            Machine: machineB
            Cluster: ClusterB
            JTAMigratableTarget:
                UserPreferredServer: ManagedServerB2
                Cluster: ClusterB
    MigratableTarget:
        ManagedServerA1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA1
            Cluster: ClusterA
        ManagedServerA2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerA2
            Cluster: ClusterA
        ManagedServerB1 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB1
            Cluster: ClusterB
        ManagedServerB2 (migratable):
            Notes: This is a system generated default migratable target for a server.
                Do not delete manually.
            UserPreferredServer: ManagedServerB2
            Cluster: ClusterB
    Machine:
        machineA: {}
        machineB: {}
    SecurityConfiguration:
        NodeManagerPasswordEncrypted: --FIX ME--
resources:
    JDBCSystemResource:
        JDBC-Data-Source-Oracle:
            Target: ClusterA,ClusterB
            JdbcResource:
                DatasourceType: GENERIC
                JDBCConnectionPoolParams:
                    TestTableName: SQL ISVALID
                JDBCDataSourceParams:
                    JNDIName: jdbc/DaveOracle
                JDBCDriverParams:
                    DriverName: oracle.jdbc.OracleDriver
                    PasswordEncrypted: --FIX ME--
                    URL: jdbc:oracle:thin:@//localhost:1521/DAVE_ORACLE
                    Properties:
                        user:
                            Value: weblogic
appDeployments:
    Application:
        basicWebapp:
            SourcePath: wlsdeploy/applications/basicWebapp.war
            ModuleType: war
            Target: ClusterA,ClusterB

Created archive
$ unzip -l /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip
Archive:  /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
    22119  04-01-2024 22:51   wlsdeploy/applications/basicWebapp.war
---------                     -------
    22119                     1 file

Extract domain
$ ./extractDomainResource.sh -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file  /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml  -output_dir  /git/weblogic/wdt/resource/k8s/domainABDSEAR -target wko
JDK version is 11.0.22+9-LTS-219
JAVA_HOME = /usr/java/jdk-11
CLASSPATH = /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar
JAVA_PROPERTIES = -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console= 
/usr/java/jdk-11/bin/java -cp /app/weblogic-deploy/lib/weblogic-deploy-core.jar:/app/weblogic/wlserver/server/lib/weblogic.jar           -Djava.util.logging.config.class=oracle.weblogic.deploy.logging.WLSDeployLoggingConfig -Dpython.cachedir.skip=true -Dpython.console=            -Dpython.path=/app/weblogic/wlserver/common/wlst/modules/jython-modules.jar/Lib           org.python.util.jython           /app/weblogic-deploy/lib/python/extract_resource.py -oracle_home /app/weblogic -domain_home /app/weblogic/user_projects/domains/base_domain/ -model_file /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml -output_dir /git/weblogic/wdt/resource/k8s/domainABDSEAR -target wko
####<Apr 1, 2024 10:57:26 PM> <INFO> <WebLogicDeployToolingVersion> <logVersionInfo> <WLSDPLY-01750> <The WebLogic Deploy Tooling extractDomainResource version is 3.5.4:.43d3afb:Mar 14, 2024 11:55 UTC>
####<Apr 1, 2024 10:57:26 PM> <INFO> <WLSDeployLoggingConfig> <logLoggingDirectory> <WLSDPLY-01755> <The extractDomainResource program will write its log to directory /app/weblogic-deploy/logs>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12328> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateRcuSchemasScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <DomainTypedef> <__init__> <WLSDPLY-12321> <Domain type WLS type definition file /app/weblogic-deploy/lib/typedefs/WLS.json version WLS_14 does not contain a postCreateDomainScript section>
####<Apr 1, 2024 10:57:26 PM> <INFO> <ModelContext> <__copy_from_args> <WLSDPLY-01050> <WebLogic version for aliases is 14.1.1.0.0>
####<Apr 1, 2024 10:57:26 PM> <INFO> <filter_helper> <apply_filters> <WLSDPLY-20016> <No filters of type extract found in filter configuration file /app/weblogic-deploy/lib/targets/wko/target.json>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05002> <Performing validation in TOOL mode for WebLogic Server version 14.1.1.0.0 and WLST OFFLINE mode>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_file> <WLSDPLY-05003> <Performing model validation on the /git/weblogic/wdt/DiscoveredABDataSourceEARDomain.yaml model file>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the domainInfo section of the model file>
####<Apr 1, 2024 10:57:26 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the topology section of the model file>
####<Apr 1, 2024 10:57:27 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the resources section of the model file>
####<Apr 1, 2024 10:57:27 PM> <INFO> <Validator> <__validate_model_section> <WLSDPLY-05008> <Validating the appDeployments section of the model file>
####<Apr 1, 2024 10:57:27 PM> <INFO> <Validator> <__validate_single_path_in_archive> <WLSDPLY-05025> <Attribute SourcePath in model location appDeployments:/Application/basicWebapp references archive entry wlsdeploy/applications/basicWebapp.war but the archive file was not provided>
####<Apr 1, 2024 10:57:27 PM> <INFO> <vz_config_helper> <_create_file> <WLSDPLY-01662> <Creating target configuration file /git/weblogic/wdt/resource/k8s/domainABDSEAR/wko-domain.yaml>
####<Apr 1, 2024 10:57:27 PM> <INFO> <crd_file_updater> <update_from_model> <WLSDPLY-01675> <Updating target output file "/git/weblogic/wdt/resource/k8s/domainABDSEAR/wko-domain.yaml" from the kubernetes section of the model>

Issue Log for extractDomainResource version 3.5.4 running WebLogic version 14.1.1.0.0 offline mode:

Total:   SEVERE :    0  WARNING :    0

extractDomainResource.sh completed successfully (exit code = 0)

Created domain resource
$ cat /git/weblogic/wdt/resource/k8s/domainABDSEAR/wko-domain.yaml
apiVersion: weblogic.oracle/v8
kind: Domain
metadata:
    name: base-domain
    namespace: base-domain
    labels:
        weblogic.domainUID: base-domain
spec:
    domainHome: /app/weblogic/user_projects/domains/base_domain/
    domainHomeSourceType: FromModel
    image: '{{{imageName}}}'
    # Add any credential secrets that are required to pull the image
    imagePullSecrets: []
    webLogicCredentialsSecret:
        name: base-domain-weblogic-credentials
    serverPod:
        env:
          - name: JAVA_OPTIONS
            value: -Dweblogic.StdoutDebugEnabled=false
          - name: USER_MEM_ARGS
            value: '-Djava.security.egd=file:/dev/./urandom -Xms64m -Xmx256m '
    clusters:
      - clusterName: ClusterA
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
      - clusterName: ClusterB
        # replicas: 99  # Set a specific replica count for this cluster
        serverPod:
            affinity:
                podAntiAffinity:
                    preferredDuringSchedulingIgnoredDuringExecution:
                      - weight: 100
                        podAffinityTerm:
                            labelSelector:
                                matchExpressions:
                                  - key: weblogic.clusterName
                                    operator: In
                                    values:
                                      - $(CLUSTER_NAME)
                            topologyKey: kubernetes.io/hostname
    configuration:
        istio:
            enabled: false
        introspectorJobActiveDeadlineSeconds: 900
        model:
            domainType: WLS
            modelHome: '{{{modelHome}}}'
            runtimeEncryptionSecret: base-domain-runtime-encryption-secret


Create Docker image with Java app running with Oracle JDK

$
0
0

 HOWTO


Create HelloWorld app


dave@dave:/git/devops-docker/docker-java$ vi HelloWorld.java
$ cat HelloWorld.java
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
dave@dave:/git/devops-docker/docker-java$  javac HelloWorld.java

dave@dave:/git/devops-docker/docker-java$ mkdir META-INF

$ cat META-INF/MANIFEST.MF 
Manifest-Version: 1.0
Created-By: 11.0.22 (Oracle Corporation)
Main-Class: HelloWorld
 

$ find
.
./HelloWorld.java
./HelloWorld.class
./META-INF
./META-INF/MANIFEST.MF
./HelloWorld.jar
./Dockerfile


dave@dave:/git/devops-docker/docker-java$ jar -cvfm HelloWorld.jar META-INF/MANIFEST.MF *.class
added manifest
adding: HelloWorld.class(in = 427) (out= 289)(deflated 32%)


Create Docker file
$ cat Dockerfile
FROM oracle/jdk:11-ol7
COPY *.jar /tmp
WORKDIR /tmp
ENTRYPOINT ["java","-jar","HelloWorld.jar"]

Build and run Docker image
$ docker build -t helloworld .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  7.168kB
Step 1/4 : FROM oracle/jdk:11-ol7
 ---> fea3c351284b
Step 2/4 : COPY *.jar /tmp
 ---> b71b147ea17b
Step 3/4 : WORKDIR /tmp
 ---> Running in b9b9ef2965ac
Removing intermediate container b9b9ef2965ac
 ---> 2520b41db41a
Step 4/4 : ENTRYPOINT ["java","-jar","HelloWorld.jar"]
 ---> Running in 5f728643508e
Removing intermediate container 5f728643508e
 ---> 562422b29f37
Successfully built 562422b29f37
Successfully tagged helloworld:latest
dave@dave:/git/devops-docker/docker-java$ docker run --name helloworld helloworld
Hello, World!

Install free Docker Oracle database

$
0
0
HOWTO
Login to Oracle Docker Registry (OCR)  web and create auth token 


Login to  OCR 
Use auth token created on OCR web 
$ docker login container-registry.oracle.com

Download Oracle free db image
$ docker pull container-registry.oracle.com/database/free:latest
latest: Pulling from database/free
089fdfcd47b7: Pull complete 
43c899d88edc: Pull complete 
47aa6f1886a1: Pull complete 
f8d07bb55995: Pull complete 
c31c8c658c1e: Pull complete 
b7d28faa08b4: Pull complete 
1d0d5c628f6f: Pull complete 
db82a695dad3: Pull complete 
25a185515793: Pull complete 
Digest: sha256:5ac0efa9896962f6e0e91c54e23c03ae8f140cf6ed43ca09ef4354268a942882
Status: Downloaded newer image for container-registry.oracle.com/database/free:latest
container-registry.oracle.com/database/free:latest

Start container
$ docker run -it  -d --name oracle  -e ORACLE_PWD=weblogic123 -p1521:1521 container-registry.oracle.com/database/free
6855a46bc9dab584a190950695866692a1d0b911876924b8f98ad48664de3845


$ docker ps
CONTAINER ID   IMAGE                                         COMMAND                  CREATED          STATUS                             PORTS                                       NAMES
93b8809b1204   container-registry.oracle.com/database/free   "/bin/bash -c $ORACL…"   41 seconds ago   Up 38 seconds (health: starting)   0.0.0.0:1521->1521/tcp, :::1521->1521/tcp   oracle




How to Use Custom Configuration Parameters for the Database on Docker

The Oracle Database Docker image enables you to customize the configuration of your database, and to provide initialization parameters for when the database starts.

Oracle Database server container also provides configuration parameters that can be used when starting the container. The following example provides the syntax for a detailed docker run command supporting all custom configurations, with variable values in Italics font, which you can replace with values for your deployment:

docker run -d --name container_name \ -p host_port:1521 -p host_port:5500 \ -e ORACLE_SID=cdb-system-identifer \ -e ORACLE_PDB=pdb-name \ -e ORACLE_PWD=oracle-user-password \ -e INIT_SGA_SIZE=cdb-database-sga-memory-in-mb \ -e INIT_PGA_SIZE=cdb-database-pga-memory-in-mb \ -e ORACLE_EDITION=ee-or-se-database-edition \ -e ORACLE_CHARACTERSET=character-set \ -e ENABLE_ARCHIVELOG=[true|false] -v [host-mount-point:]/opt/oracle/oradata \ container-registry.oracle.com/database/enterprise:21.3.0 Parameters: --name: The name of the container. (Default: auto-generated -p: The port mapping of the host port to the container port. Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express) -e ORACLE_SID: The Oracle Database SID that should be used.(Default:ORCLCDB) -e ORACLE_PDB: The Oracle Database PDB name that should be used. (Default: ORCLPDB1) -e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDBADMIN password. (Default: auto-generated) -e INIT_SGA_SIZE: The total memory in MB that should be used for all SGA components (Optional) -e INIT_PGA_SIZE: The target aggregate PGA memory in MB that should be used for all server processes attached to the instance (Optional) -e ORACLE_EDITION: The Oracle Database Edition [enterprise|standard]. (Default: enterprise) -e ORACLE_CHARACTERSET: The character set that you want used when creating the database. (Default: AL32UTF8) -e ENABLE_ARCHIVELOG The ARCHIVELOG mode. By default, set to false. If set to true, then ARCHIVLOG mode is enabled in the database (for fresh database creation only) -v /opt/oracle/oradata The data volume that you want used for the database. Must be writable by the oracle user (uid: 54321) inside the container If omitted, then the database will not be persisted over container recreation. -v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup Optional: A volume with custom scripts to be run after database startup. For further details see the section "Running scripts after setup and on startup" section below. -v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup Optional: A volume with custom scripts that you want run after database setup. For further details see the "Running scripts after setup and on startup" section below.

Install Oracle sqplus client
$ sudo dnf install oracle-instantclient-basic-21.13.0.0.0-1.el8.x86_64.rpm
  $ sudo dnf install oracle-instantclient-sqlplus-21.13.0.0.0-1.el8.x86_64.rpm 


Connect to Oracle Docker db
$ docker exec -it oracle sqlplus / as sysdba

SQL*Plus: Release 23.0.0.0.0 - Production on Wed Apr 3 10:28:37 2024
Version 23.3.0.23.09

Copyright (c) 1982, 2023, Oracle.  All rights reserved.


Connected to:
Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.3.0.23.09

SQL> 

Create Oracle db user
SQL> alter session set "_ORACLE_SCRIPT"=true;

Session altered.

SQL> CREATE USER dave IDENTIFIED BY weblogic123;

User created.

SQL> GRANT CONNECT, RESOURCE, DBA TO dave;

Grant succeeded.

Weblogic k8s - WIT - create auxiliary image

$
0
0

 Oracle HOWTO


See also 

Auxiliary images are the recommended best approach for including Model in Image model files, application archive files, and the WebLogic Deploy Tooling installation, in your pods. This feature eliminates the need to provide these files in the image specified in domain.spec.image.

Instead:

  • The domain resource’s domain.spec.image directly references a base image that needs to include only a WebLogic installation and a Java installation.
  • The domain resource’s auxiliary image related fields reference one or more smaller images that contain the desired Model in Image files.

References

  • Run the kubectl explain domain.spec.configuration.model.auxiliaryImages command.

  • See the model.auxiliaryImages section in the domain resource schema.








Weblogic k8s operator - cleanup

$
0
0

 HOWTO



Run delete


dave@dave:/git/weblogic-kubernetes-operator/kubernetes/samples/scripts$ ./delete-domain/delete-weblogic-domain-resources.sh -d sample-domain1
@@ Deleting kubernetes resources with label weblogic.domainUID 'sample-domain1'.
@@ 9 resources remaining after 0 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Setting serverStartPolicy to Never on each domain (this should cause operator(s) to initiate a controlled shutdown of the domain's pods.)
domain.weblogic.oracle/sample-domain1 patched
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 4 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 8 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 11 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 15 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 18 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 22 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 26 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 29 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 33 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 36 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 40 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 44 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 49 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 53 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 57 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Waiting for operator to shutdown pods (will wait for no more than half of max wait seconds before directly deleting them).
@@ 9 resources remaining after 62 seconds, including 3 WebLogic Server pods. Max wait is 120 seconds.
@@ Warning! 3 WebLogic Server pods remaining but wait time exceeds half of max wait seconds. About to directly delete all remaining resources, including the leftover pods.
pod "sample-domain1-admin-server" deleted
pod "sample-domain1-managed-server1" deleted
pod "sample-domain1-managed-server2" deleted
service "sample-domain1-admin-server" deleted
service "sample-domain1-cluster-cluster-1" deleted
service "sample-domain1-managed-server1" deleted
service "sample-domain1-managed-server2" deleted
configmap "sample-domain1-weblogic-domain-introspect-cm" deleted
domain.weblogic.oracle "sample-domain1" deleted
@@ 0 resources remaining after 77 seconds, including 0 WebLogic Server pods. Max wait is 120 seconds.
@@ Success.


Weblogic JNDI EJB names

$
0
0

 HOWTO

See also

 

GitHub

Java Naming and Directory Interface API

The naming environment provides four logical namespaces: java:comp, java:module, java:app, and java:global for objects available to components, modules, or applications or shared by all deployed applications. A Java EE component can access named system-provided and user-defined objects. The names of some system-provided objects, such as a default JDBC DataSource object, a default JMS connection factory, and a JTA UserTransaction object, are stored in the java:comp namespace. The Java EE platform allows a component to name user-defined objects, such as enterprise beans, environment entries, JDBC DataSource objects, and messaging destinations.

A Java EE component can also locate its environment naming context by using JNDI interfaces. A component can create a javax.naming.InitialContext object and look up the environment naming context in InitialContext under the name java:comp/env. A component’s naming environment is stored directly in the environment naming context or in any of its direct or indirect subcontexts.




JNDI names in deploy log

java:app/basicWebappEjb/AccountManagerImpl!dave.service.AccountManager.
java:module/AccountManagerImpl
java:module/AccountManagerImpl!dave.service.AccountManager
java:global/basicWebappEjb/AccountManagerImpl!dave.service.AccountManager 
java:app/basicWebappEjb/AccountManagerImpl
java:global/basicWebappEjb/AccountManagerImpl
<Creating application-scoped data source connection pool java:module/env/mavenArchetypeDataSource for Application basicWebappEjb, Module basicWebappEjb, URL = xxxxxx, Properties = xxxxxx.>
 


 Complete log

####<May 12, 2024, 5:09:42,007 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582007> <[severity-value: 64] [rid: 0] > <BEA-014021> <The EJB BankManagerImpl(Application: basicWebappEjb, EJBComponent: basicWebappEjb.war) has been successfully deployed. The following remote interfaces have been bound into JNDI with the specified JNDI names:>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.BankManager is bound with JNDI name java:module/BankManagerImpl.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.BankManager is bound with JNDI name java:app/basicWebappEjb/BankManagerImpl!dave.service.BankManager.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.BankManager is bound with JNDI name java:app/basicWebappEjb/BankManagerImpl.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.BankManager is bound with JNDI name java:global/basicWebappEjb/BankManagerImpl!dave.service.BankManager.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.BankManager is bound with JNDI name java:module/BankManagerImpl!dave.service.BankManager.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.BankManager is bound with JNDI name java:global/basicWebappEjb/BankManagerImpl.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014021> <The EJB AccountManagerImpl(Application: basicWebappEjb, EJBComponent: basicWebappEjb.war) has been successfully deployed. The following remote interfaces have been bound into JNDI with the specified JNDI names:>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.AccountManager is bound with JNDI name java:app/basicWebappEjb/AccountManagerImpl!dave.service.AccountManager.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.AccountManager is bound with JNDI name java:module/AccountManagerImpl.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.AccountManager is bound with JNDI name java:module/AccountManagerImpl!dave.service.AccountManager.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.AccountManager is bound with JNDI name java:global/basicWebappEjb/AccountManagerImpl!dave.service.AccountManager.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.AccountManager is bound with JNDI name java:app/basicWebappEjb/AccountManagerImpl.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-014022> <dave.service.AccountManager is bound with JNDI name java:global/basicWebappEjb/AccountManagerImpl.>
####<May 12, 2024, 5:09:42,008 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582008> <[severity-value: 64] [rid: 0] > <BEA-015075> <EJB deployment state ACTIVATED for [basicWebappEjb:basicWebappEjb, basicWebappEjb.war:basicWebappEjb:basicWebappEjb.war](BankManagerImpl, AccountManagerImpl) >
####<May 12, 2024, 5:09:42,009 PM Central European Summer Time> <Warning> <EclipseLink> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582009> <[severity-value: 16] [rid: 0] > <BEA-2005000> <2024-05-12 17:09:42.009--No partition instance associated with current SessionManager instance.>
####<May 12, 2024, 5:09:42,013 PM Central European Summer Time> <Info> <Deployer> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582013> <[severity-value: 64] [rid: 0] > <BEA-149060> <Module basicWebappEjb.war of application basicWebappEjb successfully transitioned from STATE_PREPARED to STATE_ADMIN on server AdminServer.>
####<May 12, 2024, 5:09:42,043 PM Central European Summer Time> <Info> <javax.enterprise.resource.webcontainer.jsf.config> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582043> <[severity-value: 64] [rid: 0] > <jsf.config.listener.version> <Initializing Mojarra |version.string| for context '/basicWebappEjb'>
####<May 12, 2024, 5:09:42,166 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582166> <[severity-value: 64] [rid: 0] > <BEA-015075> <EJB deployment state STARTED for [basicWebappEjb:basicWebappEjb, basicWebappEjb.war:basicWebappEjb:basicWebappEjb.war](BankManagerImpl, AccountManagerImpl) >
####<May 12, 2024, 5:09:42,166 PM Central European Summer Time> <Info> <Deployer> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582166> <[severity-value: 64] [rid: 0] > <BEA-149059> <Module basicWebappEjb.war of application basicWebappEjb is transitioning from STATE_ADMIN to STATE_ACTIVE on server AdminServer.>
####<May 12, 2024, 5:09:42,166 PM Central European Summer Time> <Info> <EJB> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582166> <[severity-value: 64] [rid: 0] > <BEA-015075> <EJB deployment state ADMIN-TO-PRODUCTION for [basicWebappEjb:basicWebappEjb, basicWebappEjb.war:basicWebappEjb:basicWebappEjb.war](BankManagerImpl, AccountManagerImpl) >
####<May 12, 2024, 5:09:42,166 PM Central European Summer Time> <Info> <Deployer> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dc> <1715526582166> <[severity-value: 64] [rid: 0] > <BEA-149060> <Module basicWebappEjb.war of application basicWebappEjb successfully transitioned from STATE_ADMIN to STATE_ACTIVE on server AdminServer.>
####<May 12, 2024, 5:09:42,194 PM Central European Summer Time> <Info> <Deployer> <fedora> <AdminServer> <[ACTIVE] ExecuteThread: '13' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <15110b61-5602-4852-9ea1-778bb0a83817-000008dd> <1715526582194> <[severity-value: 64] [rid: 0] > <BEA-149074> <Successfully completed deployment task: [Deployer:149026]deploy application basicWebappEjb on AdminServer..>

Java Microprofile GraphQL server using Open Liberty

$
0
0

 HOWTO

 

GitHub

 


 

Build models 

$ mvn -pl models install
[INFO] Scanning for projects...
[INFO] 
[INFO] ------< io.openliberty.guides:guide-microprofile-graphql-models >-------
[INFO] Building guide-microprofile-graphql-models 1.0-SNAPSHOT

[INFO] Installing /git/guide-microprofile-graphql/finish/models/target/guide-microprofile-graphql-models-1.0-SNAPSHOT.jar to /home/dave/.m2/repository/io/openliberty/guides/guide-microprofile-graphql-models/1.0-SNAPSHOT/guide-microprofile-graphql-models-1.0-SNAPSHOT.jar
[INFO] Installing /git/guide-microprofile-graphql/finish/models/pom.xml to /home/dave/.m2/repository/io/openliberty/guides/guide-microprofile-graphql-models/1.0-SNAPSHOT/guide-microprofile-graphql-models-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

 

Package WAR


$ mvn package


[INFO] Reactor Summary for guide-graphql-intro 1.0-SNAPSHOT:
[INFO] 
[INFO] guide-microprofile-graphql-models .................. SUCCESS [  0.794 s]
[INFO] guide-microprofile-graphql-system .................. SUCCESS [ 10.233 s]
[INFO] guide-microprofile-graphql-graphql ................. SUCCESS [  0.254 s]
[INFO] guide-graphql-intro ................................ SUCCESS [  0.001 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

 

Enable GraphQL UI  in server.xml

<server description="GraphQL service">
    <featureManager>
        <feature>restfulWS-3.1</feature>
        <feature>jsonb-3.0</feature>
        <feature>jsonp-2.1</feature>
        <feature>cdi-4.0</feature>
        <feature>mpConfig-3.1</feature>
        <feature>mpRestClient-3.0</feature>
        <feature>mpGraphQL-2.0</feature>
    </featureManager>

    <variable name="http.port" defaultValue="9082"/>
    <variable name="https.port" defaultValue="9445"/>

    <variable name="io.openliberty.enableGraphQLUI" value="true" />

    <webApplication location="guide-microprofile-graphql-graphql.war" contextRoot="/" />
    <httpEndpoint host="*" httpPort="${http.port}" 
        httpsPort="${https.port}" id="defaultHttpEndpoint"/>
</server>

 

GraphQL WAR

$ jar tvf ./graphql/target/guide-microprofile-graphql-graphql.war
     0 Sat May 25 07:38:34 CEST 2024 META-INF/
    81 Sat May 25 07:38:34 CEST 2024 META-INF/MANIFEST.MF
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/graphql/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/graphql/client/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/lib/
   433 Sat May 25 07:27:24 CEST 2024 WEB-INF/web.xml
  6366 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/graphql/GraphQLService.class
  1415 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/graphql/client/SystemClient.class
   568 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/graphql/client/UnknownUriException.class
  2268 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/graphql/client/UnknownUriExceptionMapper.class
  6693 Sat May 25 07:37:56 CEST 2024 WEB-INF/lib/guide-microprofile-graphql-models-1.0-SNAPSHOT.jar
 15086 Sat May 25 07:27:24 CEST 2024 favicon.ico
  3150 Sat May 25 07:27:24 CEST 2024 index.html
  4503 Sat May 25 07:27:24 CEST 2024 META-INF/maven/io.openliberty.guides/guide-microprofile-graphql-graphql/pom.xml
    97 Sat May 25 07:38:34 CEST 2024 META-INF/maven/io.openliberty.guides/guide-microprofile-graphql-graphql/pom.properties

 

SystemWAR

dave@fedora:/git/guide-microprofile-graphql/finish$ jar tvf ./system/target/guide-microprofile-graphql-system.war
     0 Sat May 25 07:38:34 CEST 2024 META-INF/
    81 Sat May 25 07:38:34 CEST 2024 META-INF/MANIFEST.MF
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/classes/io/openliberty/guides/system/
     0 Sat May 25 07:38:34 CEST 2024 WEB-INF/lib/
   432 Sat May 25 07:27:24 CEST 2024 WEB-INF/web.xml
  1942 Sat May 25 07:38:30 CEST 2024 WEB-INF/classes/io/openliberty/guides/system/SystemPropertiesResource.class
   444 Sat May 25 07:38:30 CEST 2024 WEB-INF/classes/io/openliberty/guides/system/SystemApplication.class
  2398 Sat May 25 07:38:30 CEST 2024 WEB-INF/classes/io/openliberty/guides/system/SystemMetricsResource.class
  6693 Sat May 25 07:37:56 CEST 2024 WEB-INF/lib/guide-microprofile-graphql-models-1.0-SNAPSHOT.jar
  2461 Sat May 25 07:27:24 CEST 2024 index.html
  4007 Sat May 25 07:27:24 CEST 2024 META-INF/maven/io.openliberty.guides/guide-microprofile-graphql-system/pom.xml
    96 Sat May 25 07:38:34 CEST 2024 META-INF/maven/io.openliberty.guides/guide-microprofile-graphql-system/pom.properties

 

Build Docker images

dave@fedora:/git/guide-microprofile-graphql/finish$ docker images
REPOSITORY                    TAG                   IMAGE ID       CREATED          SIZE
graphql                       1.0-SNAPSHOT          727f633aa833   19 seconds ago   753MB
system                        1.0-java17-SNAPSHOT   6812f8c9c7c0   45 seconds ago   765MB
system                        1.0-java11-SNAPSHOT   915f228505ad   2 minutes ago    747MB

 Start containers 

$ ./scripts/startContainers.sh
fec411c8ccc1e46a593b48399907c93284a2b4b2db82b027d876fd53b1bbf10d
53de0a3383d827a43f6bafe185143f92f885a8a99d36e9c60bb167730399b44e
d175e2f72bfd024c4179659893e92dd566b1120948de122fd7d714d668e403cc
1b7b58a43e02e84c750137e416e55b800b36acac4d6f0c481ccde5b184ef6d8f
dave@fedora:/git/guide-microprofile-graphql/finish$ docker ps 
CONTAINER ID   IMAGE                        COMMAND                  CREATED         STATUS         PORTS                                                           NAMES
d175e2f72bfd   graphql:1.0-SNAPSHOT         "/opt/ol/helpers/run…"   7 seconds ago   Up 6 seconds   9080/tcp, 9443/tcp, 0.0.0.0:9082->9082/tcp, :::9082->9082/tcp   graphql
53de0a3383d8   system:1.0-java17-SNAPSHOT   "/opt/ol/helpers/run…"   7 seconds ago   Up 6 seconds   9080/tcp, 9443/tcp                                              system-java17
1b7b58a43e02   system:1.0-java11-SNAPSHOT   "/opt/ol/helpers/run…"   7 seconds ago   Up 6 seconds   9080/tcp, 9443/tcp                                              system-java11

Call GraphQL endpoint http://localhost:9082/graphql/schema.graphql

"Mutation root"
type Mutation {
  "Changes the note set for the system"
  editNote(hostname: String, note: String): Boolean!
}

"Query root"
type Query {
  "Gets information about the system"
  system(hostname: String): system!
  "Gets system load data from the systems"
  systemLoad(hostnames: [String]): [systemLoad]
}

"Information about a Java installation"
type java {
  vendorName: String
  version: String!
}

"System usage data"
type loadData {
  heapUsed: BigInteger!
  loadAverage: Float!
  nonHeapUsed: BigInteger!
}

"Information about a single system"
type system {
  hostname: String!
  java: java!
  note: String
  osArch: String
  osName: String
  osVersion: String
  systemMetrics: systemMetrics!
  username: String!
}

"Information of system usage"
type systemLoad {
  hostname: String!
  loadData: loadData
}

"System metrics"
type systemMetrics {
  heapSize: BigInteger!
  nonHeapSize: BigInteger!
  processors: Int!
}

Access GraphiQL at the http://localhost:9082/graphql-ui 

 

Query structure

# An example GraphQL query might look like:
#
#     {
#       field(arg: "value") {
#         subField
#       }
#     }

 

Query

query {
  system(hostname: "system-java11") {
    hostname
    username
    osArch
    osName
    osVersion
    systemMetrics {
      processors
      heapSize
      nonHeapSize
    }
    java {
      vendorName
      version
    }
  }
}


Response

{
  "data": {
    "system": {
      "hostname": "system-java11",
      "username": "default",
      "osArch": "amd64",
      "osName": "Linux",
      "osVersion": "6.8.10-200.fc39.x86_64",
      "systemMetrics": {
        "processors": 12,
        "heapSize": 4110352384,
        "nonHeapSize": -1
      },
      "java": {
        "vendorName": "IBM Corporation",
        "version": "11.0.22"
      }
    }
  }
}


Java Microprofile GraphQL client using Open Liberty

$
0
0

 HOWTO

 GitHub

 


 

Build client 

[INFO] -------------&lt; io.openliberty.guides:guide-graphql-intro &gt;--------------
[INFO] Building guide-graphql-intro 1.0-SNAPSHOT                          [5/5]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for guide-graphql-intro 1.0-SNAPSHOT:
[INFO] 
[INFO] guide-graphql-client-models ........................ SUCCESS [  0.786 s]
[INFO] guide-graphql-client-query ......................... SUCCESS [  1.080 s]
[INFO] guide-graphql-client-graphql ....................... SUCCESS [  0.252 s]
[INFO] guide-graphql-client-system ........................ SUCCESS [  0.189 s]
[INFO] guide-graphql-intro ................................ SUCCESS [  0.001 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

 

Access client http://localhost:9084/openapi/ui/


 

Run query 


 

Convert Java properties file to sed commands using ant

$
0
0

 HOWTO

GitHub

Install antcontrib 

Get via Maven  https://github.com/dveselka/java-tutorial/blob/master/tools/pom.xml

To install ant-contrib:

  1. Copy ant-contrib-0.3.jar to the lib directory of your Ant installation. If you want to use one of the tasks in your own project, add the lines
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
    
    to your build file.
  2. Keep ant-contrib-0.3.jar in a separate location. You now have to tell Ant explicitly where to find it (say in /usr/share/java/lib):
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
      <classpath>
        <pathelement location="/usr/share/java/lib/ant-contrib-0.3.jar"/>
      </classpath>
    </taskdef>

 

Get antcontrib.jar via Maven
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>dave</groupId>
    <artifactId>tools</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>dave</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/ant-contrib/ant-contrib -->
        <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

$ mvn clean install


[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default) @ tools ---
[INFO] Copying ant-contrib-1.0b3.jar to /git/java-tutorial/tools/target/lib/ant-contrib-1.0b3.jar
[INFO] Copying ant-1.5.jar to /git/java-tutorial/tools/target/lib/ant-1.5.jar

 Properties file https://github.com/dveselka/java-tutorial/blob/master/tools/dave.properties

 a=1
jdbc.url=jdbc:oracle:thin:dave@dave:1521/DAVE_DB
url=https://dave.com/dave
date=Sun Sep 15 08:43:48 AM CEST 2024

 

Build.xml to produce sed file from properties file https://github.com/dveselka/java-tutorial/blob/master/tools/build.xml

Notice that @ gives value of for cycle variable , $ gives value of ant property
<project name="properties-to-sed">

    <taskdef resource="net/sf/antcontrib/antlib.xml">
        <classpath>
            <pathelement location="target/lib/ant-contrib-1.0b3.jar"/>
        </classpath>
    </taskdef>

    <target name="convert">
        
        <property file="dave.properties" prefix="dave."/>
        <propertyselector property="dave" match="dave\.(.*)" select="\1"/>
        
        <for param="key" list="${dave}">
            <sequential>
                <echo>@{key}=${dave.@{key}}</echo>
                <echo message="s#@{key}#${dave.@{key}}#g${line.separator}" file="replace-dave-props.sed" append="true"/>
            </sequential>
        </for>
    </target>
</project>
 

Run ant 

 
 $ ant convert
Buildfile: /git/java-tutorial/tools/build.xml

convert:
     [echo] url=https://dave.com/dave
     [echo] a=1
     [echo] date=Sun Sep 15 08:43:48 AM CEST 2024
     [echo] jdbc.url=jdbc:oracle:thin:dave@dave:1521/DAVE_DB

BUILD SUCCESSFUL
Total time: 0 seconds

Sed file produced from properties file

$ cat replace-dave-props.sed
s#url#https://dave.com/dave#g
s#a#1#g
s#date#Sun Sep 15 08:43:48 AM CEST 2024#g
s#jdbc.url#jdbc:oracle:thin:dave@dave:1521/DAVE_DB#g

 

 Asking Gemimi for hints - useful, provided idea with antcontrib for cycle, needs fixing - add antcontrib install, fix for cycle

 

Approach:

  1. Create a build.xml file:

    • Write the Ant build script in a build.xml file.
    • Define a target to perform the conversion.
  2. Load properties file:

    • Use the property task to load the properties file.
  3. Generate sed commands:

    • Use the for task to iterate over the properties entries.
    • For each entry, create a sed command using the echo task.
  4. Write sed commands to file:

    • Use the echo task to write the generated sed commands to a file.

build.xml example:

XML
<projectname="properties-to-sed"><targetname="convert"><propertyfile="replacements.properties"/><forparam="key"elements="${replacements.keys()}"><sequential><echomessage="s/${replacements.${key}}/${replacements.${key}}/g"file="sed_script.sed"append="true"/></sequential></for></target></project>

Explanation:

  • The replacements.properties file should contain key-value pairs where the key is the search pattern and the value is the replacement string. For example:
search1=replacement1
search2=replacement2
  • The build.xml file defines a convert target.
  • The property task loads the properties file.
  • The for task iterates over the keys in the properties file.
  • For each key, an echo task creates a sed command using the key and value as the search pattern and replacement string.
  • The echo task writes the sed command to the sed_script.sed file, appending it to the end of the file.

Additional considerations:

  • You can customize the sed command format based on your specific requirements.
  • If you need to escape special characters in the search patterns or replacement strings, use appropriate escape sequences.
  • For more complex scenarios or performance optimization, consider using a dedicated scripting language like Python or Perl.


 Asking ChatGPT for comparison


Daniel Veselka
convert properties file to sed commands using antcontrib for cycle
ChatGPT

To convert a properties file to sed commands using ant-contrib's for loop functionality, you'll need to follow a similar approach as previously mentioned, with some adjustments to implement the loop correctly. Below, I’ll provide a complete and detailed example, including how to set up your environment to use ant-contrib for iterating through properties.

Example Properties File

Assuming you have a properties file named config.properties:

properties
# config.propertiesapp.name=MyAppapp.version=1.0.0app.author=John Doe

Ant Build File
<project name="PropertiesToSed" default="convert" basedir=".">
    
    <property file="config.properties"/>
    
    <target name="convert">
        <echo message="Converting properties to sed commands..." />

        <!-- Loop through the properties defined in config.properties -->
        <property name="properties.list" value="app.name,app.version,app.author"/>

        <foreach list="${properties.list}" param="property">
            <sequential>
                <echo message="sed -i 's/${property}=.*/${property}=${property}:${property}/g' target_file.txt" />
            </sequential>
        </foreach>
        
    </target>
    
</project>

Explanation of the Ant Build File

  1. Task Definition for Ant-Contrib: The line <taskdef resource="antcontrib.properties" /> defines the ant-contrib functions so you can use them in your Ant script. Make sure you have the ant-contrib.jar in your Ant classpath.

  2. Loading Properties: The properties file is loaded into the project with <property file="config.properties"/>.

  3. Defining Properties List: A property properties.list is defined, listing all the keys in the properties file that you want to generate sed commands for.

  4. Using <for> Loop: The <for> loop is used to iterate over the properties list. Each property will be accessible via the variable ${property} in the loop.

  5. Generating sed Commands:

    • The echo command inside the loop outputs the sed command that will perform the desired replacement in target_file.txt.
    • If you want to replace the value of each property in the file, you can use ${property} to get the key and ${property.value} to retrieve the corresponding value.

Step to Execute the Ant Script

  1. Ensure you have ant-contrib: Download the ant-contrib.jar and place it in the lib directory of your Ant installation or add it to your classpath.

  2. Run the Ant command:

bash
ant convert

Final Notes

  • The generated sed command will replace the line in target_file.txt that matches the pattern property=, updating it with the value from config.properties.
  • Adjust the target_file.txt with your actual target file; this is the file where the properties should be replaced.
  • Remember that you can customize the sed command based on how you want to implement the replacements based on your specific requirements.

 

Viewing all 181 articles
Browse latest View live