MARP - Markdown Presentations

Create complete presentations using only markdown and VSCode.



marp: true


# Malmal and Kubernetes

by Lucas Meurer


# Kubernetes Intro

> Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation.

- Basically a very complex way to run docker containers


# Main Components

- pods
 - group of one or more containers
 - temporary
- deployments
 - declare the desired state for a pod
 - scale pods
 - roll out new versions and pod updates
- services
 - define a logical set of pods
 - exposes them to other pods or the outside world


# A sample Deployment

apiVersion: apps/v1
kind: Deployment
 name: nginx-deployment
   app: nginx
 replicas: 3
     app: nginx
       app: nginx
     - name: nginx
       image: nginx:1.14.2
       - containerPort: 80```

# A sample Service

apiVersion: v1
kind: Service
 name: nginx-service
   app: nginx
   - name: http
     protocol: TCP
     port: 80
     targetPort: 80```
`curl http://my-service` should now work inside the cluster
- will be load balanced between pods


# Digital Ocean Kuberntes (DOKS)

- managed k8s cluster on digitalocean
- malmal previously ran on google cloud
 - that was too expensive
 - when doks had the cluster-autoscaler I finally switched


# Helm

- package manager for kubernetes
- a package is called "chart"
- automatically creates deployments, services, etc..
- charts can have dependencies so an app chart could have a dependency to the postgres chart

```$ helm repo add bitnami
$ helm install my-rabbitmq bitnami/rabbitmq --values values.yaml```
replicas: 1

   cpu: 50m
   memory: 200Mi```

# Deployment?

- in the beginning I managed all the kubernetes resources myself
- very tedious and a lot of copy & paste and `kubectl apply -f`


# GitOps!

- infrastructure as code
- git is the single source of truth for infrastructure
- changes are automatically applied when a branch is merged


# flux

> Flux is a tool for keeping Kubernetes clusters in sync with sources of configuration (like Git repositories), and automating updates to configuration when there is new code to deploy.

- dedicated infrastructure repo
- it "just works" (no complicated ci pipelines)
- can add things to the cluster from
 - other git repos
 - helm charts
 - kubernetes yaml files
- used to set up kubernetes tools like cert-manager



Werf implements GitOps using helm templates

- werf
 - automatically builds and publishes docker images
 - applies the current helm chart
 - tracks the current deployment
 - allows quick rollbacks
 - works with GitLab CI, Github Actions and more
 - can easily spin up review environments


#  Lets have a look at some of malmals infrastructure!

Wir freuen uns Sie kennen zu lernen

Hat Sie unser Angebot überzeugt? Dann freuen wir uns, Sie kennen zu lernen. Kontaktieren Sie uns gerne für ein unverbindliches Erstgespräch.

newcubator GmbH
Freie-Vogel-Straße 369
44269 Dortmund
+49 231/586 873 80
newcubator GmbH
Bödekerstraße 22
30161 Hannover
+49 511/957 313 00