ToDo List

ToDo List is an example application containing a WebLogic component. For more information and the source code of this application, see the Verrazzano Examples.

Before you begin

  • Set up a multicluster Verrazzano environment following the installation instructions.
  • The example assumes that there is a managed cluster named managed1 associated with the multicluster environment. If your environment does not have a cluster of that name, then you should edit the deployment files and change the cluster name listed in the placement section.
  • To download the example application image, you must first accept the license agreement.
    • In a browser, navigate to and sign in.
    • Search for example-todo and weblogic.
    • For each one:
      • Select the image name in the results.
      • From the drop-down menu, select your language and click Continue.
      • Then read and accept the license agreement.

Set up the following environment variables to point to the kubeconfig for the admin and managed clusters.

$ export KUBECONFIG_ADMIN=/path/to/your/adminclusterkubeconfig
$ export KUBECONFIG_MANAGED1=/path/to/your/managedclusterkubeconfig

NOTE: The ToDo List application deployment files are contained in the Verrazzano project located at <VERRAZZANO_HOME>/examples/multicluster/todo-list, where <VERRAZZANO_HOME> is the root of the Verrazzano project.

Deploy the ToDo List example application

  1. Create a namespace for the multicluster ToDo List example by applying the Verrazzano project file.

    $ kubectl --kubeconfig $KUBECONFIG_ADMIN apply \
  2. Create a docker-registry secret to enable pulling the ToDo List example image from the registry.

    $ kubectl --kubeconfig $KUBECONFIG_ADMIN create secret docker-registry tododomain-repo-credentials \
            --docker-username=YOUR_REGISTRY_USERNAME \
            --docker-password=YOUR_REGISTRY_PASSWORD \
            --docker-email=YOUR_REGISTRY_EMAIL \
            -n mc-todo-list

    Replace YOUR_REGISTRY_USERNAME, YOUR_REGISTRY_PASSWORD, and YOUR_REGISTRY_EMAIL with the values you use to access the registry.

  3. Create and label secrets for the WebLogic domain:

    # Replace the values of the WLS_USERNAME and WLS_PASSWORD environment variables as appropriate.
    $ export WLS_USERNAME=<username>
    $ export WLS_PASSWORD=<password>
    $ kubectl --kubeconfig $KUBECONFIG_ADMIN create secret generic tododomain-weblogic-credentials \
        --from-literal=password=$WLS_PASSWORD \
        --from-literal=username=$WLS_USERNAME \
        -n mc-todo-list
    $ kubectl --kubeconfig $KUBECONFIG_ADMIN create secret generic tododomain-jdbc-tododb \
        --from-literal=username=$WLS_USERNAME \
        --from-literal=password=$WLS_PASSWORD \
        -n mc-todo-list
    $ kubectl --kubeconfig $KUBECONFIG_ADMIN -n mc-todo-list label secret tododomain-jdbc-tododb weblogic.domainUID=tododomain

    Note that the ToDo List example application is preconfigured to use specific secret names. For the source code of this application, see the Verrazzano Examples.

  4. Apply the component and multicluster application resources to deploy the ToDo List application.

    $ kubectl --kubeconfig $KUBECONFIG_ADMIN apply \
    $ kubectl --kubeconfig $KUBECONFIG_ADMIN apply \
  5. Wait for the ToDo List example application to be ready. The tododomain-adminserver pod may take several minutes to be created and Ready.

    $ kubectl --kubeconfig $KUBECONFIG_MANAGED1 wait pod \
        --for=condition=Ready tododomain-adminserver \
        -n mc-todo-list \
  6. Get the generated host name for the application.

    $ HOST=$(kubectl --kubeconfig $KUBECONFIG_MANAGED1 get gateway \
          -n mc-todo-list \
          -o jsonpath='{.items[0].spec.servers[0].hosts[0]}')
    $ echo $HOST
    # Sample output
  7. Get the EXTERNAL_IP address of the istio-ingressgateway service.

    $ ADDRESS=$(kubectl --kubeconfig $KUBECONFIG_MANAGED1 get service \
         -n istio-system istio-ingressgateway \
         -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
    $ echo $ADDRESS
    # Sample output
  8. Access the ToDo List example application:

    • Using the command line

      # The expected response of this query is the HTML of a web page
      $ curl -sk https://${HOST}/todo/ \
          --resolve ${HOST}:443:${ADDRESS}

      If you are using, then you do not need to include --resolve.

    • Local testing with a browser

      Temporarily, modify the /etc/hosts file (on Mac or Linux) or c:\Windows\System32\Drivers\etc\hosts file (on Windows 10), to add an entry mapping the host name to the ingress gateway’s EXTERNAL-IP address. For example:

      Then, you can access the application in a browser at

    • Using your own DNS name

      • Point your own DNS name to the ingress gateway’s EXTERNAL-IP address.
      • In this case, you would need to have edited the todo-list-application.yaml file to use the appropriate value under the hosts section (such as yourhost.your.domain), before deploying the ToDo List application.
      • Then, you can use a browser to access the application at https://<yourhost.your.domain>/todo/.

      Accessing the application in a browser will open a page, “Derek’s ToDo List”, with an edit field and an Add button that lets add tasks.

  9. A variety of endpoints associated with the deployed ToDo List application, are available to further explore the logs, metrics, and such. You can access them according to the directions here.


  1. Verify that the application configuration, domain, and ingress trait all exist.

    $ kubectl --kubeconfig $KUBECONFIG_MANAGED1 get ApplicationConfiguration -n mc-todo-list
    # Sample output
    NAME           AGE
    todo-appconf   19h
    $ kubectl --kubeconfig $KUBECONFIG_MANAGED1 get Domain -n mc-todo-list
    # Sample output
    NAME          AGE
    todo-domain   19h
    $ kubectl --kubeconfig $KUBECONFIG_MANAGED1 get IngressTrait -n mc-todo-list
    # Sample output
    NAME                           AGE
    todo-domain-trait-7cbd798c96   19h
  2. Verify that the WebLogic Administration Server and MySQL pods have been created and are running. Note that this will take several minutes.

    $ kubectl --kubeconfig $KUBECONFIG_MANAGED1 get pods -n mc-todo-list
    # Sample output
    NAME                     READY   STATUS    RESTARTS   AGE
    mysql-5c75c8b7f-vlhck    2/2     Running   0          19h
    tododomain-adminserver   4/4     Running   0          19h

Undeploy the ToDo List application

Regardless of its location, to undeploy the application, delete the application resources and the project from the admin cluster. Undeploy affects all clusters in which the application is located.

  1. To undeploy the application, delete the ToDo List OAM resources.

    $ kubectl --kubeconfig $KUBECONFIG_ADMIN delete \
    $ kubectl --kubeconfig $KUBECONFIG_ADMIN delete \
  2. Delete the project.

    $ kubectl --kubeconfig $KUBECONFIG_ADMIN delete \
  3. Delete the namespace mc-todo-list after the application pods are terminated. The secrets created for the WebLogic domain also will be deleted.

    $ kubectl --kubeconfig $KUBECONFIG_ADMIN delete namespace mc-todo-list
    $ kubectl --kubeconfig $KUBECONFIG_MANAGED1 delete namespace mc-todo-list