To build and run the sample, you must have the done the following:
- Obtain this repository's contents, either use
git
or just download the samples as a ZIP - Install the IBM Cloud CLI
- Install the Kubernetes CLI
- Provision an Event Streams Service Instance in IBM Cloud®
- Provision a Kubernetes Service instance in IBM Cloud®
-
From the Event Streams for IBM Cloud instance dashboard, click
Service Credentials
and select or create a new one. Copy its content, create a filecredentials.json
and paste the content. -
To deploy the application you first need to bind the Event Streams for IBM Cloud service instance to the cluster. Create a secret using the content from the file
credentials.json
kubectl create secret generic eventstreams-binding --from-file=binding=credentials.json
The command above creates a secret in your cluster named
eventstreams-binding
. -
Deploy the application in the cluster:
kubectl apply -f kafka-java-liberty-sample.yaml
-
Access the application:
kubectl wait pod kafka-java-liberty-sample --for=condition=Ready kubectl port-forward kafka-java-liberty-sample 9080:9080
Point your browser to http://localhost:9080
If you want find out more about IBM Cloud Kubernetes Service or Kubernetes then check the following documents: