In this step we would deploy a sample application to our Anthos clusters on Bare metal.
Follow the steps below to deploy a sample hello world image and create a service endpoint for invocation.
- Create a deployment from hello app image by executing the following command
> kubectl create deployment hello-world –image=gcr.io/google-samples/hello-app:2.0
- Next, view the status of deployments. You should see the hello-world deployment
> kubectl get deployments
- Next , expose the hello-world workload using Load balancer
> kubectl expose deployment hello-world –type=LoadBalancer –port=80 –target-port=8080
- Next, get list of services exposed and copy the external IP next to hello-world service
> kubectl get services
- Invoke the hello-world service using the following command
> curl -I http://10.200.0.51
You should see hello world message being printed. Thus we have successfully deployed and tested our sample application on the Anthos on bare metal cluster.