Skip to content

Instantly share code, notes, and snippets.

View LawAbidingNinja's full-sized avatar

Lawrence Puttergill LawAbidingNinja

  • Sporting Solutions
  • London, UK
View GitHub Profile
@LawAbidingNinja
LawAbidingNinja / Managing-k8s.md
Last active April 24, 2018 14:40
Managing Kubernetes

Create Deployment

We're going to deploy a basic nginx docker container to the cluster.

  • Create a new directory called K8s
  • Copy the following into a file called my-nginx-deployment.yaml
apiVersion: apps/v1beta1
kind: Deployment
@LawAbidingNinja
LawAbidingNinja / K8s-Cluster-Setup.md
Last active April 24, 2018 13:57
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.

@LawAbidingNinja
LawAbidingNinja / Docker-HandsOn.md
Last active April 24, 2018 13:57
Instructions for the Docker Hands on section in the Kubernetes Dojo

Prerequisites:

  • Docker is installed and set up on your machine
  • You are connected to the Wi-Fi (ask for details if not)

Building the Image

  • Create a new directory called DockerNginx, this is the staging ground for our new docker image.
  • In this directory create a directory called ‘my-website’.
  • Within the my-website directory create a file called index.html
    • Edit index.html to create a basic static website (template code below). Feel free to customise and edit this page to your heart's content (anything you place in the 'my-website' folder will be made available to nginx):