docs

a slatepencil documentail site

View on GitHub

Kubenete Concepts

k8s

Concept Description
Control Plane Responsible for the state of the cluster
Worker node run the containerized application workloads
Pod the smallest deployable units in Kubernetes
  A pod hosts one or more containers,
  and provides shared storage and networking for them
Control Plane Description
Controller Manager running controllers that manage the state of the cluster
  ReplicationController, DeploymentController
Scheduler Scheduling pods onto the worker nodes in the cluster
etcd a distributed key-value store, stores the cluster’s persistent state
API Server primary interface between control plane & the rest of the cluster
Worker node Description
kubelet a daemon runs on each worker node, communicating with the control plane
  receives the control plane about which pods to run on the node
  and ensures that the desired state of the pods is maintained
kube-proxy network proxy runs on each worker node, routing traffic to the correct
  pods. provides load balancing for the pods & ensures the traffic is distributed
  evenly across the pods
container runtime runs the containers on the worker node, pulling image form registry,
  start & stops a container & manage the container’s resources

Configuration Type

Container Images

Container Image Supported Architectures
registry.k8s.io/kube-apiserver:v1.27.1 amd64, arm, arm64, ppc64le, s390x
registry.k8s.io/kube-controller-manager:v1.27.1 amd64, arm, arm64, ppc64le, s390x
registry.k8s.io/kube-proxy:v1.27.1 amd64, arm, arm64, ppc64le, s390x
registry.k8s.io/kube-scheduler:v1.27.1 amd64, arm, arm64, ppc64le, s390x
registry.k8s.io/conformance:v1.27.1 amd64, arm, arm64, ppc64le, s390x

Workloads

Create ConfigMap

kubectl create configmap <map-name> <data-source>
## Create the local directory:
mkdir -p configure-pod-container/configmap/
# Download the sample files into `configure-pod-container/configmap/` directory
wget https://kubernetes.io/examples/configmap/game.properties -O configure-pod-container/configmap/game.properties
wget https://kubernetes.io/examples/configmap/ui.properties -O configure-pod-container/configmap/ui.properties
# use properties
kubectl create configmap game-config --from-file=configure-pod-container/configmap/
kubectl describe configmaps game-config
kubectl get configmaps game-config -o yaml
# use env file
kubectl create configmap game-config-env-file --from-env-file=kube/configmap/game-env-file.properties

## literal values
kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm

## delete
kubectl delete configmap

## Define container environment variables with data from multiple ConfigMaps
kubectl create -f https://kubernetes.io/examples/configmap/configmaps.yaml

Create Secret

# use raw data
kubectl create secret generic db-user-pass \
    --from-literal=username=admin \
    --from-literal=password='S!B\*d$zDsb='
# use source files
kubectl create secret generic db-user-pass \
    --from-file=./username.txt \
    --from-file=./password.txt

kubectl get secret db-user-pass -o jsonpath='{.data}'

echo 'UyFCXCpkJHpEc2I9' | base64 --decode

# create a TLS Secret
kubectl create secret tls my-tls-secret \
  --cert=path/to/cert/file \
  --key=path/to/key/file

QoS class

accessModes