Skip to content

Lab environment

Options

  1. If you brought your own Kubernetes cluster:

    • Kubernetes versions 1.16 through 1.23 should all work. For details, consult the Istio support status of Istio releases page for version 1.13.3.

    • Although we typically recommend a 3-worker node cluster of machine type "n1-standard-2" or similar, a smaller cluster will work just fine for the Istio lab.

  2. If you have your own public cloud account:

    • On GCP, the following command should provision a GKE cluster of adequate size for the workshop:

      gcloud container clusters create my-istio-cluster \
        --cluster-version latest \
        --machine-type "n1-standard-2" \
        --num-nodes "3" \
        --network "default"
      
    • Feel free to provision a K8S cluster on any infrastructure of your choosing.

    • Be sure to configure your ~/.kube/config file to point to your cluster.

  3. If you received Google credentials from the workshop instructors:

    • A Kubernetes cluster has already been provisioned for you.
    • Your instructor will demonstrate the process of accessing and configuring your environment, described below.
    • The instructions below explain in detail how to access your account, select your project, and launch the cloud shell.

If you are bringing your own Kubernetes cluster, you are ready to proceed with the Istio lab.

Log in to GCP

  1. Log in to GCP using credentials provided by your instructor.
  2. Agree to the terms
  3. You will be prompted to select your country, click "Agree and continue"

Select your project

Select the GCP project you have been assigned, as follows:

  1. Click the project selector "pulldown" menu from the top banner, which will open a popup dialog
  2. Make sure the Select from organization is set to tetratelabs.com
  3. Select the tab named All
  4. You will see your GCP project name (istio-0to60..) listed under the organization tetratelabs.com
  5. Select the project from the list

Verify that your project is selected:

  • If you look in the banner now, you will see your selected project displayed.

Launch the Cloud Shell

The Google Cloud Shell will serve as your terminal environment for these labs.

  • Click the Activate cloud shell icon (top right); the icon looks like this:
  • A dialog may pop up, click Continue
  • Your cloud shell terminal should appear at the bottom of the screen
  • Feel free to expand the size of the cloud shell, or even open it in a separate window (locate the icon button in the terminal header, on the right)

Warning

Your connection to the Cloud Shell gets severed after a period of inactivity. Click on the Reconnect button when this happens.

Configure cluster access

  1. Check that the kubectl CLI is installed

    kubectl version --short
    
  2. Generate a kubeconfig entry

    1. Activate the top navigation menu (Menu icon on the top left hand side of the page)
    2. Locate and click on the product Kubernetes Engine (you may have to scroll down until you see it)
    3. Your pre-provisioned 3-node Kubernetes cluster should appear in the main view
    4. Click on that row's "three dot" menu and select the Connect option
    5. A dialog prompt will appear with instructions
    6. Copy the gcloud command shown and paste it in your cloud shell
    gcloud container clusters get-credentials \
        $(gcloud container clusters list --format="value(name)") \
        --zone $(gcloud container clusters list --format="value(location)") \
        --project $(gcloud config get-value project)
    

    Click Authorize when prompted

    The console message will state that a kubeconfig entry [was] generated for [your project]

  3. Verify that your Kubernetes context is set for your cluster

    kubectl config get-contexts
    
  4. Run a token command such as kubectl get node or kubectl get ns to ensure that you can communicate with the Kubernetes API Server.

    kubectl get ns
    

All instructions in subsequent labs assume you will be working from the Google Cloud Shell.

Tip

This workshop makes extensive use of the kubectl CLI.

Consider configuring an alias to make typing a little easier.

cat << EOF >> ~/.bashrc

source <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k

EOF

source ~/.bashrc
Back to top