Deploying a custom WebSphere Liberty application configuration

An application administrator can create an application image and deploy it to a Kubernetes environment. Use a WebSphereLibertyApplication custom resource (CR) file with a YAML structure to set parameter values for the application image deployment.

Procedure

  1. Create an application image. See Moving applications to containers.
  2. Create a CR file that specifies parameters for the application image deployment.
    1. Start with the following WebSphereLibertyApplication CR file, which specifies minimal parameters to deploy an application image to a Kubernetes environment.
      apiVersion: liberty.websphere.ibm.com/v1
      kind: WebSphereLibertyApplication
      metadata:
        name: my-app
      spec:
        license:
          accept: false
          edition: IBM WebSphere Application Server
          productEntitlementSource: Standalone
        applicationImage: quay.io/my-repo/my-app:1.0
    2. For .metadata.name, replace my-app with a name for your CR.
    3. For .spec.license, replace its parameter values as needed.

      For accept, specify true. To deploy the application, the accept parameter must be set to true.

      For edition, specify the WebSphere Liberty edition. The default is IBM WebSphere Application Server (base). Other available values are IBM WebSphere Application Server Liberty Core and IBM WebSphere Application Server Network Deployment.

      For productEntitlementSource, specify the entitlement source for the product, or the product for which you have a license. The default is Standalone, which includes WebSphere Application Server products such as Liberty. Other available values are IBM Cloud Pak for Applications, IBM WebSphere Application Server Family Edition, and IBM WebSphere Hybrid Edition.

    4. For .spec.applicationImage, replace quay.io/my-repo/my-app:1.0 with a path for your application image. Specify a value that is the absolute name of the image to be deployed, containing the registry and the tag. The applicationImage value must be defined in the WebSphereLibertyApplication CR.

      On Red Hat® OpenShift®, the operator tries to find an image stream name with the applicationImage value. If the operator is not able to find any image stream that matches the value, it falls back to the registry lookup.

      To distinguish an image stream called my-company/my-app (my-company is the project and my-app is the image stream name) from the Docker Hub my-company/my-app image, you can use the full image reference as docker.io/my-company/my-app.

  3. Deploy your CR to a running cluster in a Kubernetes environment.

What to do next

Check the status of your deployed application. For more information, see Viewing application status.

By default, .spec.manageTLS is set to true and does not need to be specified in the CR. If you deployed the CR to a Kubernetes cluster, you must have certificate manager installed on the Kubernetes cluster. If you deployed to an Red Hat OpenShift cluster, then the certificate manager installation is not required.