kubernetes-training
Versions
- Kubernetes: v1.21.2 (released on 2021-06-18)
- kustomize: v4.2.0 (released on 2021-07-02)
- Helm: 3.6.3 (released on 2021-07-15)
- Traefik: v2.9.0
- ArgoCD: v2.2.3 (released on 2022-01-19)
- Prometheus-Operator: v0.53.1 (released on 2021-12-20)
- Prometheus: Latest
- Grafana: Latest
- Strimzi: 0.24.0 (released on 2021-06-24)
- Kind: v0.11.1 (released on 2021-05-28)
- Ingress Nginx Controller: v0.48.0 (released on 2021-07-15)
- Conftest: 0.25.0 (released on 2021-05-08)
- Istio: 1.12.2 (released on 2022-01-19)
- PostgresOperator: v1.7.1 (released on 2021-11-04)
- Cert Manager: v1.7.1 (released on 2022-02-05)
Contents
- Kubernetes Cluster
- Kubernetes Features
- Kubernetes Components
- kubernetes-scheduler
- etcd
- kube-apiserver
- kube-controller-manager
- kube-proxy
- kubelet
- Kubernetes Extensions
- Namespaces
- Deloyment Managemet
- Networking
- Kubernetes Gateway API
- Envoy Gateway
- Istio
- Kong
- NGINX Kubernetes Gateway
- traefik
- Ingress
- Kubernetes Gateway API
- Middleware (Operator)
- Service Proxy, Discovery, and, Mesh
- Monitoring
- Prometheus
- Prometheus Operator
- [Thanos (todo)] https://thanos.io/
- Grafana
- Grafana Operator
- Grafana Loki
- Grafana Tempo
- [Jaeger (todo)] https://www.jaegertracing.io/
- Security
- Yaml Management
- CI/CD
- Conftest
- ArgoCD
- Kyverno https://kyverno.io/
- Polaris https://www.fairwinds.com/polaris
- Machine Learning
- Databases
Cloud Native Trail Map
- https://github.com/cncf/trailmap
- https://www.cncf.io/blog/2018/03/08/introducing-the-cloud-native-landscape-2-0-interactive-edition/
1. CONTAINERIZATION
2. CI/CD
2.1 ArgoCD
3. ORCHESTRATION & APPLICATION DEFINITION
3.1 Kubernetes
Useful Commands
- DNS
kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml kubectl exec -i -t dnsutils -- nslookup kubernetes.default
- Debug with ephemeral containers (alpha in 1.22, beta in 1.23)
kubectl run ephemeral-demo --image=k8s.gcr.io/pause:3.1 --restart=Never kubectl debug -it ephemeral-demo --image=busybox --target=ephemeral-demo
- Create pod with busyboxy-curl
kubectl run -it --rm=true busybox --image=yauritux/busybox-curl --restart=Never
Set up Kubernetes Cluster with kubeadm (local)
Set up Kubernetes Cluster on GCP (kubernetes-the-hard-way)
Kubernetes Components
- kubernetes-scheduler
- etcd
- kube-apiserver
- kube-controller-manager
- kube-proxy
- kubelet
More Practices of Applications on Kubernetes
3.2 Helm
-
Create Helm chart.
helm create <chart-name e.g. helm-example>
-
Update files under
templates
andvalues.yaml
-
Test apply.
helm install helm-example --debug ./helm-example
-
Make a package.
helm package helm-example
-
Create repository and set index.
helm repo index ./ --url https://nakamasato.github.io/helm-charts-repo
-
Install a chart.
helm repo add nakamasato https://nakamasato.github.io/helm-charts-repo helm repo update # update the repository info helm install example-from-my-repo nakamasato/helm-example
4. OBSERVABILITY & ANALYTICS
4.1. Prometheus
4.2. Prometheus Operator
4.3. Opentelemetry & Jaeger
TBD
- fluentd
5. SERVICE PROXY, DISCOVERY & MESH
5.1. Istio
5.2. Envoy
TBD
- CoreDNS
- Linkerd
6. NETWORKING, POLICY & SECURITY
6.1 Open Policy Agent
gatekeeper
-
Install gatekeeper
kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper/master/deploy/gatekeeper.yaml
-
Create
ConstraintTemplate
- Create custom policy defined in the previous step.
conftest
-
Write policy in
policy
directory.deny[msg] { input.kind = "Deployment" not input.spec.template.spec.nodeSelector msg = "Deployment must have nodeSelector" }
-
Write tests in the same directory.
test_no_nodeSelector { deny["Deployment must have nodeSelector"] with input as { "kind": "Deployment", "spec": { "template": { "spec": { "containers": [ ], } } } } }
-
Run test.
conftest verify 1 tests, 1 passed, 0 warnings, 0 failures, 0 exceptions
-
Validate a manifest file.
conftest test manifests/valid/deployment.yaml 1 tests, 1 passed, 0 warnings, 0 failures, 0 exceptions
TBD
- CNI
- falco
7. DISTRIBUTED DATABASE & STORAGE
7.1. etcd
TBD
- Vitess
- Rook
- TiDB
- TimescaleDB
8. STREAMING & MESSAGING
TBD
- gRPC
- NATS
- cloudevents
9. CONTAINER REGISTRY & RUNTIME
TBD
- containerd
- harbor
- cri-o
10. SOFTWARE DISTRIBUTION
TBD
- TUF
- notaru