Deploy 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.
Steps
- Create a container application image.
- Create a CR file that specifies parameters for the application image deployment.
- 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
- For .metadata.name, replace my-app with a name for your CR.
- 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 we 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.
- For .spec.applicationImage, replace quay.io/my-repo/my-app:1.0 with a path for the 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, we can use the full image reference as docker.io/my-company/my-app.
- Start with the following WebSphereLibertyApplication CR file, which specifies minimal
parameters to deploy an application image to a Kubernetes environment.
- Deploy your CR to a running cluster in a Kubernetes environment.
What to do next
Check the status of the deployed application.
See Viewing application status.
By default, .spec.manageTLS is set to true and does not need to be specified in the CR. If we deployed the CR to a Kubernetes cluster, we must have certificate manager installed on the Kubernetes cluster. If we deployed to an Red Hat OpenShift cluster, then the certificate manager installation is not required.