for kubernetes objects in detail read
- https://trainingportal.linuxfoundation.org/learn/course/introduction-to-kubernetes
- https://kubernetes.io/docs/concepts/
namespaces isolate/partition kubernetes entities into parts
which are from a kubernetes view to be managed seperately
which does not mean pods in different namespaces can't communicate but
e.g. that they are not using the same config maps, secrets though
kubectl get namespace
lists all namespaces
kubectl create namespace konoha_ns
creates a namespace
configmaps of a namespace can point to an address in another
namespace thus contacting services in other namespaces.
Access and resource limitation works via namespaces.
volumes and nodes are not namespaced.
for something that comes close to the hints of a language server
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#container-v1-core
pod service secret
▲
│
│has one or more configmap
│
replicaset
▲ volume
│
│has
│
deployment daemonset
# text listed in a box is a listing of so called "node agents"
┌─────────────┐
│control plane│
├─────────────┴────────────────────────────┐
│ ┌────┐ │
│ │node│ │
│ ├────┴───────────────────────────┐ │
│ │ api-server ◄─────────────────┼────┼───────┐
│ │ controller-manager │ │ │
│ │ scheduler │ │ │
│ │ etcd │ │ │
│ │ kubelet │ │ │
│ │ kubeproxy │ │ │
│ │ container runtime │ │ │
│ │ addons │ │ │
│ └────────────────────────────────┘ │ │
└──────────────────────────────────────────┘ │
│
┌────┐ │
│node│ │
├────┴────────────────────┐ │
│ kubelet───────────────┼──┤
│ kubeproxy─────────────┼──┘
│ container runtime │
│ addons │
└─────────────────────────┘
for a test environment on one machine I use minikube
getting kubernetes on my servers I would use kubeadm
command cache:
kubectl apply
-f ./service.yaml
-f ./secret.yaml
-f ./deployment.yaml
-f ./configmap.yaml
-f ./mongo-express/service.yaml
-f ./mongo-express/deployment.yaml
clear; kubectl get all
kubectl delete deployment mongodb-d mongodb-express-d;
kubectl delete configmap mongodb-c;
kubectl delete service mongodb-s mongodb-express-s;
kubectl delete secret mongodb-sec;
to run kubernetes in a docker container
docker run --privileged --name k3s -d -e K3S_TOKEN=mynodetoken rancher/k3s:v1.27.9-k3s1 server
read https://kubernetes.io/docs/setup/production-environment/tools/