Test Your Application in the Kubernetes Setup on the Google Cloud Platform
Before you begin
- Google cloud account with a project and cluster.
- Google Cloud SDK
- Kubectl
- Procedure
- From a terminal, follow these steps:
gcloud auth login gcloud config set project <your project name> gcloud config set container/cluster <your cluster name> gcloud container clusters get-credentials <your cluster name> --zone <your cluster zone name> kubectl get nodes
- Tag the service application image created in the previous step.
docker tag bwce-service-discovery-service-app gcr.io/<your project name>/bwce-service-discovery-service-app
- Push your application image to Google Container Registry.
gcloud docker push gcr.io/<your project name>/bwce-service-discovery-service-app
- Confirm that the image is present in the Google Container Registry.
- Open
manifest-service.yml
file and update application image name, the Consul server URL, and the service name. Ensure the image name follows the format:gcr.io/<your gcloud project name>/<image name>
- Run the following command to create the service:
kubectl create -f manifest-service.yml
- Tag the service application image created in the previous step.
docker tag bwce-service-discovery-client-app gcr.io/<your project name>/bwce-service-discovery-clien-app
- Push your application image to Google Container Registry.
gcloud docker push gcr.io/<your project name>/bwce-service-discovery-client-app
- Confirm that the image is present in the Google Container Registry.
- Open
manifest-client.yml
file and update application image name, Consul server URL, and the service name. Ensure the image name follows the format:gcr.io/<your gcloud project name>/<image name>
- Run the following command to create the service:
kubectl create -f manifest-client.yml
- To check that the service and client applications have started successfully, run the command:
kubectl logs pod-name
- The external IP address is available in a few minutes.
Check for this using the following command:
kubectl get services
- Using a browser, send a request to the client application by using it's external IP address.
http://<EXTERNAL-IP>:80
Result
The following output should be seen in the browser:
Hello from TIBCO"