Skip to content

deck15/kubernetes-introduction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Kubernetes

Links and resources used by the Introduction to Kubernetes DevOps Learning Journey course.

@Todo: Windows users: Please fill in the Windows installation prerequisites.

Table of Contents

To generate Table of contents, do:

	npm update
	./node_modules/markdown-toc/cli.js --no-firsth1 README.md

Notes

If you have VPN connected, you may encounter problems with your local docker connecting to a remote registry. Disconnect from VPN and then restart your terminal before continuing.

  • Mac users should be able to download most tools and utilities using brew.
  • Windows users may be able to download many tools and utilities using Chocolatey.

Mac: Install Prerequisites

  1. Install Xcode from the App Store, or from Apple Developer Downloads

  2. Install Homebrew using the following command:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Install Tools and Utilities:

    brew cask install docker
    brew cask install minikube
    brew cask install vagrant
    brew cask install virtualbox
    brew install kubernetes-cli
    brew install docker-compose
    brew install docker-completion
    brew install docker-compose-completion
    brew install docker-machine-driver-xhyve
    brew install azure-cli
    brew install nodejs
  4. Set the preferences for the docker machine driver:

    sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
    sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

Windows: Install Prerequisites

...

Classroom

What is Kubernetes

Introduction reading and video:

Get Started: Local Kubernetes

  1. Minikube Tutorial
  2. Install Hypervisor (Virtualbox, etc)
  3. Stand up minikube and test

Azure Kubernetes Connect

  1. Deploy an Azure Container Service (AKS) cluster - Will not currently work for connected cloud subscriptions.
  2. Login to Azure
  3. Download CLI and Login with CLI

Kubernetes Connect

  1. Create a cluster or use existing cluster created earlier.
  2. Execute the nginx example.

(Azure) Kubernetes Connect 101

  1. Tutorial: Prepare application for Azure Container Service (AKS)
  2. Tutorial: Deploy and use Azure Container Registry
    • Note: If creating a registry in Azure is not possible, consider using your own public registry/repos in Docker Hub.
  3. Create container images and run voting app locally. -- requires docker compose.
  4. Upload voting app images to container registry created in step 2.

Go, gRPC and Kubernetes (Optional)

  1. Define Simple Services
    1. Comm protocol
    2. Common Divisor Services
    3. Frontend API Service
  2. Build Docker Images
  3. Deploy to K8s Cluster

Kubernetes 101 (1st section)

  1. Kubernetes 101 Tutorial

  2. Clone workshop Repo

    git clone https://github.com/gravitational/workshop.git
  3. Classroom work: Running Nginx

    1. Standup Nginx
    2. Curl service from Tutum container
    3. Explore within the container
  4. Follow sections:

    1. Running nginx
    2. Pod IPs
    3. Pod Containers

Kubernetes 101 (2nd section)

  1. Kubernetes 101 Tutorial

  2. Clone workshop Repo

    git clone https://github.com/gravitational/workshop.git
  3. Classroom work sections:

    1. Deployments and Replicasets
    2. Services
    3. Back to Deployments
    4. Configuration management basics

Kubernetes 101 (3rd section - Optional/extra credit)

  1. Kubernetes 101 Tutorial

  2. Clone workshop Repo

    git clone https://github.com/gravitational/workshop.git
  3. Sections: Connecting Services

Note: Requires a private registry locally or use of cloud registry, such as Docker Hub.

Azure Kubernetes 201

  1. Tutorials #3-5, Run and scale application exercises.
  2. Tutorials 6 and 7 require docker-compose.

Kubernetes Dashboard

  1. Tunnel to a local version of the kubernetes dashboard
  2. Expose and edit two services within the kubernetes dashboard

Wordpress on Kubernetes

  1. Create persistent volume
  2. Create secret for MySQL password
  3. Launch Wordpress

Elastic Search on K8s

  1. Clonse the examples repo

  2. Deploy elasticsearch

  3. Verify functionality

  4. Clone Kubernetes Examples repo

    git clone [email protected]:kubernetes/examples.git
  5. Follow Elastic Search Tutorial

    Bonus:

  6. Deploy production ready cluster

    git clone [email protected]:pires/kubernetes-elasticsearch-cluster.git
  7. Bonus #2: Expose Kibana

Kubernetes Stateful Application

  1. Stand up and watch stateful mysql instances
  2. Query and verify connectivity

Kubernetes Configmap

  1. Create Configmap
  2. Consume Configmap in environment variables
  3. Set command line using Configmap
  4. Consume Configmap in Volume
  • ConfigMap Tutorial

  • Use wget to get the files for the exercise...

     wget http://pwittrock.github.io/docs/user-guide/configmap/configmap.yaml
     wget http://pwittrock.github.io/docs/user-guide/configmap/env-pod.yaml
     wget http://pwittrock.github.io/docs/user-guide/configmap/command-pod.yaml
     wget http://pwittrock.github.io/docs/user-guide/configmap/volume-pod.yaml
     wget http://pwittrock.github.io/docs/user-guide/configmap/mount-file-pod.yaml
  • Then apply using: (for example...)

     kubectl create -f configmap.yaml

Kubernetes & Prometheus (Metrics)

  1. Stand up Prometheus
  2. Gather and monitor metrics

SPIFFE Secure Certificate Example (Optional)

  1. Install Virtual Box & Vagrant
  2. Standup K8s vagrant machines
  3. Run demo

Kubernetes Secrets

  1. Create Secret config file and pods
  2. Install and Launch Vault
  3. (Optional) Challenge: Replicate Vault Secrets into Kubernetes

K8s Networking Explained (Optional)

  1. Docker Networking Example
  2. CNI Basics
    1. Requires access to Kubernetes host if not using minikube

Minikube CICD on Jenkins

  1. Install Prerequisites (Node, etc)
  2. Setup Jenkins
  3. (Optional) Puzzle App Part 1
  4. (Optional) Puzzle App Part 2

Artifactory on Kubernetes

Deploy Cassandra with Stateful Sets

  1. Create Cassandra Headless Service
  2. Create a Cassandra Ring
  3. Validate the Stateful Set
  4. Modify the Stateful Set

Helm (Package manager) on Kubernetes

  1. Verify Helm is working
  2. Install nginx-ingress

Additional Resources

Reference Docs

Kubernetes in Azure