github.com/verrazzano/verrazzano@v1.7.1/tests/testdata/test-applications/weblogic/hello-weblogic/README.md (about) 1 ## WebLogic Application 2 3 Sample WebLogic application, for testing the VerrazzanoWebLogicWorkload. 4 5 ## Requires 6 7 [Maven](https://maven.apache.org/download.cgi) 8 9 ## Steps to build the application 10 The bash script setup/build.sh creates the auxiliary image for model in image deployment, by including the sample application under wlsdeploy/applications. 11 12 $ cd <application root directory> 13 $ mvn clean package 14 $ cd setup; ./build.sh <container registry>/<image>:<version> 15 $ docker image push <image registry>/<image>:<version> 16 17 ## Deploy the sample application to Verrazzano 18 19 Create a namespace for the sample application and add a label identifying the namespace as managed by Verrazzano. To run this application in the default namespace, skip creating the namespace and do not specify the namespace in all the kubectl commands below. 20 21 $ kubectl create namespace hello-wls 22 $ kubectl label namespace hello-wls verrazzano-managed=true istio-injection=enabled 23 24 Create a docker-registry secret to enable pulling the example image from the registry. 25 26 $ kubectl create secret docker-registry hellodomain-repo-credentials \ 27 --docker-server=container-registry.oracle.com \ 28 --docker-username=YOUR_REGISTRY_USERNAME \ 29 --docker-password=YOUR_REGISTRY_PASSWORD \ 30 --docker-email=YOUR_REGISTRY_EMAIL \ 31 -n hello-wls 32 Replace YOUR_REGISTRY_USERNAME, YOUR_REGISTRY_PASSWORD, and YOUR_REGISTRY_EMAIL with the values you use to access the registry. 33 34 Create the secrets for the WebLogic domain: 35 36 $ Replace the values of the WLS_USERNAME and WLS_PASSWORD environment variables as appropriate. 37 $ export WLS_USERNAME=<username> 38 $ export WLS_PASSWORD=<password, must be at least 8 alphanumeric characters with at least one number or special character> 39 $ kubectl create secret generic hellodomain-weblogic-credentials --from-literal=password=$WLS_PASSWORD --from-literal=username=$WLS_USERNAME -n hello-wls 40 41 42 Deploy the application, by applying the sample resource 43 44 $ Set the registry URL for the sample application in hello-wls-comp.yaml 45 $ kubectl apply -f <application directory>/hello-wls-comp.yaml -n hello-wls 46 $ kubectl apply -f <application directory>/hello-wls-app.yaml -n hello-wls 47 48 Wait for the sample application to be ready. 49 50 $ kubectl get pods -n hello-wls 51 $ or using 52 $ kubectl wait pod --for=condition=Ready hellodomain-adminserver -n hello-wls 53 54 Get the generated host name for the application. 55 56 $ ADDRESS=$(kubectl get service -n istio-system \ 57 istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}') 58 59 Get the EXTERNAL_IP address of the istio-ingressgateway service. 60 61 $ HOST=$(kubectl get gateways.networking.istio.io \ 62 -n hello-wls \ 63 -o jsonpath='{.items[0].spec.servers[0].hosts[0]}') 64 65 Access the application 66 67 $ curl -sk https://${HOST}/hello/weblogic/greetings/message --resolve ${HOST}:443:${ADDRESS} 68 69 If you are using nip.io, then you do not need to include --resolve. 70 71 72 Undeploy the application 73 To undeploy the application, delete the OAM resources for the sample 74 75 $ kubectl delete -f <application directory>/hello-wls-app.yaml -n hello-wls 76 $ kubectl delete -f <application directory>/hello-wls-comp.yaml -n hello-wls 77 78 Delete the namespace hello-wls after the application pods are terminated. The secrets created for the WebLogic domain also will be deleted. 79 80 $ kubectl delete namespace hello-wls 81 82 Copyright (c) 2022, Oracle and/or its affiliates.