Anthos clusters on Azure is available for customers with an existing support relationship with Google Cloud. Contact your account representative for access.

Quickstart

This page shows you how to deploy a sample application on Anthos clusters on Azure.

Before you begin

To perform the steps on this page, first complete the following:

Deploy a sample application

In this section, you deploy a sample multi-tier application to your Anthos clusters on Azure. After you deploy the application, you can expose it as a load balancer with a public IP address.

For more information about the sample application, see Deploying PHP Guestbook application with Redis in the Kubernetes documentation.

To deploy the application, perform the following steps:

  1. If you need to connect to the cluster's control plane through a bastion host, make sure that you have created the bastion host and started an SSH tunnel at port 8118, and then prepend the command with HTTPS_PROXY=http://localhost:8118. If you used a different port when starting the SSH tunnel, make sure that you replace 8118 with your selected port.

  2. Apply the application's manifests by using the kubectl command-line tool:

    kubectl --kubeconfig=ADMIN_KUBECONFIG apply -f \
      https://k8s.io/examples/application/guestbook/redis-leader-deployment.yaml
    kubectl --kubeconfig=ADMIN_KUBECONFIG apply -f \
      https://k8s.io/examples/application/guestbook/redis-leader-service.yaml
    kubectl --kubeconfig=ADMIN_KUBECONFIG apply -f \
      https://k8s.io/examples/application/guestbook/redis-follower-deployment.yaml
    kubectl --kubeconfig=ADMIN_KUBECONFIG apply -f \
      https://k8s.io/examples/application/guestbook/redis-follower-service.yaml
    kubectl --kubeconfig=ADMIN_KUBECONFIG apply -f \
      https://k8s.io/examples/application/guestbook/frontend-deployment.yaml
    kubectl --kubeconfig=ADMIN_KUBECONFIG apply -f \
      https://k8s.io/examples/application/guestbook/frontend-service.yaml
    

    Your cluster deploys the application, including a service that exposes the application within the cluster on a ClusterIP.

  3. Access the application from outside the cluster by using the kubectl patch command to modify the frontend service from ClusterIP to LoadBalancer:

    kubectl --kubeconfig=ADMIN_KUBECONFIG patch service frontend  \
      --patch  '{"spec": {"type": "LoadBalancer"}}'
    
  4. Get the external IP address for the application by using the kubectl get service command:

    kubectl --kubeconfig=ADMIN_KUBECONFIG get service frontend
    

    The output includes the external IP address for the load balancer.

  5. Open the link with your web browser. The Guestbook application appears.

Clean up

To remove the application, run the following commands:

kubectl --kubeconfig=ADMIN_KUBECONFIG delete deployment -l app=redis
kubectl --kubeconfig=ADMIN_KUBECONFIG delete service -l app=redis
kubectl --kubeconfig=ADMIN_KUBECONFIG delete deployment frontend
kubectl --kubeconfig=ADMIN_KUBECONFIG delete service frontend

After you run these commands, Anthos clusters on Azure removes the external IP address, Service, and application data.