Skip to content

aghonys/k8s-workshop

Repository files navigation

Workshop with Kubernetes

Welcome to this workshop.

Material used in the workshop is based on different examples from github, articles and kubernetes.io

Agenda

  • Introduction to Cloud Native - what it is and what it is not

    • What is Cloud Native and what is Cloud
    • Cloud deployment models (hybrid, cross, multi)
    • Cloud Native deployment models
      • Public Cloud,
      • Private Cloud,
      • someones datacenter(s),
      • your own datacenter(s),
      • a set of servers,
      • a server,
      • a workstation,
      • a device,
      • a car
      • and more
  • Cloud Native (Computing Foundation) is often seen as the biggest unifier and abstraction seen so far

    • A little more info about what Cloud native is and is not

    • Why must you know about Cloud Native What does it mean for you and your career? The broadest and most practical and coolest abstraction sofar! Covering everything from:

      • embedded to,
      • your machine, to
      • your data centers, to
      • other data centers,
      • private cloud and
      • public cloud(s)

      Covering every programming language using containerisation.

  • Why do you want to work with Cloud Native?

    First and foremost: You will be working with Cloud Native.

    Regardless of what you will be doing:

    • developer
    • designer
    • relliability engineer
    • data scientist
    • electronics engineeer There will be Cloud Native Technology in code close to you.
  • Where can you learn more about Cloud Native?

    • Cloud Native Meetup Community (Copenhagen, Aarhus, Aalborg) and in other Scandivian Countries or anywhere in the world
    • Experiment with it yourself on your laptop using e.g. kind (Kubernetes in Docker)
    • Work someplace where they work with Kubernetes and other Cloud Native technologies are used for real (and secure) applications
    • Come join us, join us on our mission to make Kubernetes and Cloud Native available in a secure and easy manner for real applications

Prerequisites

These are the things that you would have to install on your machine to run the examples. If you find errors things that are difficult to understand please say to the instructors, they will make a note of that and improve the workshop.

Install a local package manager

Dependent on which operating system you use, the easiest way to install the workshop tooling is by using the package manager which is most suitable to your operating system, on windows that would typically be choco, on MacOs brew and on linux it could be snap, however it is up to you what you prefer. If you happen to have some of the tools installed already, you may want to write upgrade instead of ìnstall`in the commands below. If you do not have one of these package managers installed, it is highly recommended that you install that.

  • Please install [choco](https://chocolatey.org/install) on Windows, if you do not already have iyt installed.
  • Please install [brew](https://brew.sh/) on Mac, if you do not already have iyt installed.
  • May install what you like on Linux (You probably already did), however [brew](https://docs.brew.sh/Homebrew-on-Linux) could work for you on linux, if you are not already familiar with another package setup.

Docker Desktop

As we will be working with a local Kubernetes installation based on Docker a Docker Desktop distribution needs to be installed.

See Install Docker Engine. Be sure to find your Operating system and follow the instruictions for that.

Git CLI

We will be collecting workshop from github, which is why you need a git client.

brew

$ brew install git

choco

$ choco install git

Curl

We will be testing our deployments, which is why you need curl.

brew

$ brew install curl

choco

$ choco install curl

Kubernetes CLI

The kubectl cli allows access to interact with the Kubernetes cluster. This can be installed from package managers.

Conventions

The $at the start of the command line is only there to illustrate that this is a command line command, the command you write is the not including the $. If you see commands like cat, they will only work on Mac, Linux, and in the windows linux subsystem, if you are on native windows you can try type, if you see curl

brew

$ brew install kubernetes-cli

choco

$ choco install kubernetes-cli

For other ways of installing kubectl in Windows see Install and Set Up kubectl on Windows

Kubernetes in Docker (kind)

We will be running a local Kubernetes cluster based on the Kubernetes distribution called kind - which is short for Kubernetes in Docker. This can be installed using most package managers.

brew

$ brew install kind

choco

$ choco install kind

Other

For other install options see Quick Start

k9s

Oprinally the k9s utility can help browsing and managing the Kubernetes cluster providing a layer on top of the standard kubectl cli.

brew

$ brew install k9s

choco

$ choco install k9s

Helm

A few of the examples require the Helm tool to install packages into the Kubernetes cluster.

brew

$ brew install helm

choco

$ choco install kubernetes-helm

In the same way install curl, docker and gitif you do not have these installed already

Alternate Installing Helm

Checking your install

You can check that you have the tools available running. You need to be administrator of your machine, and please check the session about Windows if you are using a Windows machine. And please observe if you are using a corporate controlled machine, that may include blocking software. Which may make it difficult to get a successful check.

$ docker version 
$ git version
$ kind version
$ helm version
$ k9s version
$ curl version

This should inform you about the docker and kind versions, furthermore you may check if any clusters are already running.

Make sure you have started the installed docker desktop.

Please remember the purpose of the workshop

Please remember this is created for you to learn basic suff about kubernetes and to have an environment set up on you local workstation or laptop. When you work through the workshops, by all means copy and paste commands, to avoid being stuck in misspelled commands. Please do reflect over each thing you do and try to deduct, what you did and and what was the result.

Excercises

  • Lets start with what you can do in this room today
    • please sign up for a Cloud Native local chapter in: Copenhagen, Aarhus or Aalborg and join
    • and perhaps signup for Cloud Native Nordics Slack, which grants you access to a clack channel.
    • Experiment with it yourself on your laptop ifo Kubernetes (there are a number of distributions and also some for you laptop). The recommendation is to start in the sequence below based on the install above.

If you are using Windows on your laptop

There are some few thing that may work in a different way under windows.

You may want to copy the lines from the shell scripts under each folder instead using the scripts:

  • create_cluster.sh which would be e.g. kind create cluster --name workshop --config=kind-config.yaml
  • delete_cluster.sh which would be e.g. kind delete cluster --name workshop when creating and deleting local clusters.

The gatering of metrics in the observability workshop may not work for you, as grafana does not pick up the metrics.

If you experience an older kind kubernetes version

You can add to the config yaml file, under nodes:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  image: kindest/node:v1.25.3

If you want to play more with Kubernetes

Kubernetes Playground

There are some articles that you can follow if you want to do more:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published