From 32bff2c6b2ca975cf8437ca02eb0788ed36ed347 Mon Sep 17 00:00:00 2001 From: fals4 Date: Sat, 16 Aug 2025 13:44:43 +0200 Subject: [PATCH] vault backup: 2025-08-16 13:44:43 --- temporary.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/temporary.md b/temporary.md index 3bd57f7..30db977 100644 --- a/temporary.md +++ b/temporary.md @@ -20,7 +20,21 @@ For a weak, dont do things you know are vad and do things you know are good for Learn traffic rules Earn IBM Fullstack developer certificate (but afte) +- Suggested IDE: vscode + - YAML extension by Red Hat, configure in the extension settings the YAML schema and set this in the settings.json: `"yaml.schemas": { +        "kubernetes": "*.yaml" + +    }` + - restart the IDE afterwards +- kubectl + - `kubectl run nginx --image=nginx` will fetch the nginx image from docker hub and create a pod + - `kubectl create deployment nginx --image=nginx` creates a deployment + - `kubectl create -f pod-definition.yml` create from file (`kubectl apply -f file.yml` works too?) + - `kubectl get pods` + - `kubectl describe pod myapp-pod` +- scaling: we create additional pods. a pod can contain multiple containers but one pod shall only contain what is necessary for one instance of the application. we do NOT create additional containers in the same pod +- minikube: bundles master node programs and node programs on one machine. requires virtualization (via hypervisor KVM, VirtualBox... or docker but latter is not recommended) - ctr: CLI for containerD, not very user friendly and mostly for debugging - It is advised to use nerdctl instead - nerdctl: provides docker-like CLI for containerd, supports docker compose, supports newest features in containerD (encrypted container images, lazy pulling...) @@ -28,6 +42,21 @@ Earn IBM Fullstack developer certificate (but afte) - `crictl pods` shows pods - `crictl --runtime endpoint` enables you to specify a runtime endpoint (or use CONTAINER_RUNTIME_ENDPOINT env var) - other commands are similar to docker + +Kubernetes definition file: +```yml +apiVersion: v1 +kind: Pod +metadata: //dictionary, can only have name and labels + name: myapp-pod + labels: // can have any sub-attributes + app: myapp +spec: //individual for all deployments + containers: + - name: nginx-container + image: nginx +``` + ## Glossary - CRI: Container Runtime Interface - Kubernetes originally only worked for Docker but then introduced the CRI to be more abstract and allow all sorts of container runtimes