Skip to content

Instantly share code, notes, and snippets.

@LawAbidingNinja
Last active April 24, 2018 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LawAbidingNinja/70fe6ef949f34a4046d245b9273f64e5 to your computer and use it in GitHub Desktop.
Save LawAbidingNinja/70fe6ef949f34a4046d245b9273f64e5 to your computer and use it in GitHub Desktop.
The Setup instructions for your K8s Cluster

Local GCloud SDK setup:

  1. Download, install and run the interactive installer specific to your platform (Linux, Windows, or Mac) https://cloud.google.com/sdk/downloads#interactive

  2. Make sure to run gcloud init once setup, this will log into your gcloud account.

    1. When gcloud prompts you to 'Pick cloud project to use', Make sure to select the dojo project assigned to your Google account (usually the first option).
  3. Install Kubectl (command line tool for interacting with K8s Cluster): gcloud components install kubectl

Note: Whilst gcloud/kubectl are installing head over to: console.cloud.google.com and start with either the Create kubernetes Cluster section and/or the Connect to Kubernetes Cluster section depending if you are using the free account assigned or your own.

Create Kubernetes Cluster

Note: This step is only necessary if you choose to use your own GCloud account.

  1. Login to console.cloud.google.com with your Google Account
  2. Click the Burger menu on the top left and navigate to Kubernetes Engine.
  3. Click create cluster
  4. Make sure to change:
    1. the zone to any of the europe-west zones.
    2. Size from 3 to 2 (all of the premade clusters for this dojo are all 2 node clusters)

Connect to Kubernetes Cluster

Prerequites:

  • Ensure that you have run gcloud init and gcloud is logged into your Google account (gcloud init will run you through the login procedure).
  • Ensure you have a K8s Cluster created/assigned to you.

Instructions:

  1. Login to console.cloud.google.com with your Google Account
  2. Click the Burger menu on the top left and navigate to Kubernetes Engine.
  3. Click the connect button on the kubernetes cluster (you either had created or had assigned to you.)
  4. Copy the command under Command-line access
  5. Open terminal/powershell.
    1. Paste and run the copied command.
    2. Run kubectl cluster-info to test if you can connect to the cluster. This will return information about where various cluster services are running.
    3. Run kubectl config view
    4. Copy down the value of 'access-token'
      1. Note: If for whatever reason you have connected to other kubernetes clusters in the past, there will be multiple access tokens, you'll need to find the correct access token. Look under 'name' for the name of the project-cluster you created/or had assigned. It should contain dojo near the end. e.g. gke_eco-league-201419_europe-west1-b_dojo1
    5. Run kubectl proxy
    6. Go to localhost:8001/ui in your web browser, you should be presented with a sign in page.
    7. Select the token radio button and paste in the access token you copied earlier.
    8. Click Sign in and you should have access to your Kubernetes Dashboard!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment