Video: https://www.youtube.com/watch?v=CXOPwtJ7qDI&list=PLZLVmS9rf3nN1Rj-TAqFEzFM22Y1kJmvn
The goal of this lesson is to have a crash course of kubernetes, so that someone (who knows a bit about kubernetes already) can deploy a simple app to k8s cluster. We probably won't say everything that someone needs, but hopefully you will know where to start reading to accomplish your need.
We can consider two kinds of services:
What you want out of this:
???
https://kubernetes.io/docs/tutorials/
Kubernetes is a container orchestration system. In short, it runs containers and provides a coherent way to manage them that scales to extremely large deployments. The most important part is how it provides high-level declarative management.
An example of a deployment would be 50 web server containers, 10 caches, 5 memcachd servers, 3 database replicas all working together. When you need to update the web servers, you decleare the change it kubernetes will automatically roll out the change, making sure that there are enough running at any time to serve incoming requests.
Of course, this power comes at a cost. There are a lot of concepts to learn, for example, for small deployments. It can be hard to figure out what you need to do.
For example, instead of having this:
docker run --volume= container-name:version
You create this kubernetes yaml:
---
apiVersion: v1
kind: Pod
metadata:
name: csit-bot
labels:
app: zulip-bot
spec:
containers: # There can be multiple containers
- name: bot
image: zulip-bot
imagePullPolicy: ifNotPresent
volumeMounts: # What to mount inside.
# Note the indirection, volumes definitions
# separate from volume monuts
- name: zuliprc-mount
mountPath: /config
readOnly: true
volumes:
- name: zuliprc-mount
secret:
secretName: zuliprc-csit
Kubernetes is organized into objects (Example: deployment, pod volume). These is a uniform representation of each type of object, as seen in:
You can read about each of these type of objects via the API docs, which I have found to be the best place to look:
https://kubernetes.io/docs/reference/kubernetes-api/
… though you have to know what kind of objects you need for a certain task, and tutorials to connect things together.
Additionally, list of all objects and their fields on a single page in https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/
Below, you should learn how to go from the API definition of an object to something usable.
Example deployment: https://github.com/AaltoSciComp/zulip-bots/
Question: what do you think so far?
Questions-comments:
API reference: https://kubernetes.io/docs/tutorials/