Skip to content

Commit 20f48b3

Browse files
committed
Fixes after 20231018
1 parent 8d21c44 commit 20f48b3

File tree

7 files changed

+83
-38
lines changed

7 files changed

+83
-38
lines changed

120_kubernetes/ci_cd/slides.md

+42-1
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,30 @@ Force pods onto specific nodes
166166

167167
Force pods on the same node or on different nodes
168168

169-
### Tains / tolerations
169+
### Taints / tolerations
170170

171171
Reserve nodes for specific pods (taints)
172172

173173
Pods must accept taints (tolerations)
174174

175175
---
176176

177+
## Custom scheduling and autoscaling
178+
179+
### Autoscaling
180+
181+
Using custom metrics for HPA [](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics)
182+
183+
NodeAffinity can use labels provided by cloud / hosting provider
184+
185+
Kubernetes-based Event Driven Autoscaling (KEDA) [](https://github.com/kedacore/keda)
186+
187+
### Scheduling
188+
189+
Power Efficiency Aware Kubernetes Scheduler (PEAKS) [](https://github.com/sustainable-computing-io/peaks)
190+
191+
---
192+
177193
## Lessons Learnt 1/
178194

179195
### Avoid `kubectl create <resource>`
@@ -283,6 +299,8 @@ kubectl delete pod \
283299

284300
### Use plaintext in `Secret`
285301

302+
Secret expect base64-encoded fields under `data`
303+
286304
Templating becomes easier when inserting plaintext
287305

288306
```yaml
@@ -317,6 +335,29 @@ Let bots do the work for you
317335

318336
Doing updates regularly is easier
319337

338+
Pull/merge requests for every updates
339+
320340
Automerge for patches can help stay on top of things
321341

322342
Automated tests help decide whether an update is safe
343+
344+
---
345+
346+
## Lessons Learnt 7/7
347+
348+
### Deployment history
349+
350+
Deployments keep history of changes
351+
352+
```bash
353+
kubectl rollout history deployment/my-nginx
354+
```
355+
356+
### Populating `CHANGE-CAUSE`
357+
358+
Add annotation `kubernetes.io/change-cause` before the change [](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#checking-rollout-history-of-a-deployment)
359+
360+
```bash
361+
kubectl annotate deployment/my-nginx \
362+
kubernetes.io/change-cause="image updated to 1.24.0"
363+
```

120_kubernetes/helm/helm.demo

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ kubectl get deployments.apps my-nginx -o yaml | grep image:
3434
helm get values my-nginx
3535

3636
# Display release history
37-
helm history my-nginx
37+
helm history my-nginx
38+
39+
# Check templated resources
40+
helm template my-nginx bitnami/nginx

120_kubernetes/helm/slides.md

+33-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Package manager for Kubernetes [](https://helm.sh/)
66

77
Separation of templates (called chart) and values
88

9-
Supports install/upgrade/uninstall and upgrade/rollback
9+
Supports install/uninstall and upgrade/rollback
1010

1111
Based on go templates [](https://godoc.org/text/template) and sprig library [](https://masterminds.github.io/sprig/)
1212

@@ -54,14 +54,14 @@ Many charts from the community on ArtifactHub [](https://artifacthub.io/)
5454
```bash
5555
helm upgrade my-nginx bitnami/nginx --set service.type=ClusterIP
5656
```
57-
<!-- .element: style="width: 35em;" -->
57+
<!-- .element: style="width: 43em;" -->
5858

5959
1. Use nginx stable release [](https://hub.docker.com/r/bitnami/nginx/tags)
6060

6161
```bash
6262
helm upgrade my-nginx bitnami/nginx --reuse-values --set image.tag=1.24.0
6363
```
64-
<!-- .element: style="width: 35em;" -->
64+
<!-- .element: style="width: 43em;" -->
6565

6666
When setting very few fields, use `--set`
6767

@@ -81,10 +81,33 @@ Time drift can cause authentication issues
8181

8282
### Helm chart for ntp
8383

84-
| File | Description |
85-
| -------------------------- | -------------- |
86-
| `Chart.yaml` | Metadata |
87-
| `values.yaml` | Default values |
88-
| `templates/` | Templates |
89-
| `templates/daemonset.yaml` | Daemonset |
90-
| `templates/_helpers.tpl` | Variables |
84+
| File | Description |
85+
| -------------------------- | ---------------------- |
86+
| `Chart.yaml` | Metadata |
87+
| `values.yaml` | Default values |
88+
| `templates/daemonset.yaml` | Template for Daemonset |
89+
| `templates/_helpers.tpl` | Template variables |
90+
91+
Test chart using `helm test` [](https://helm.sh/docs/topics/chart_tests/)...
92+
93+
...or `chart-testing` [](https://github.com/helm/chart-testing)
94+
95+
---
96+
97+
## Where Helm stores its data
98+
99+
Release and revision information is stored per namespace
100+
101+
Helm creates a secret for each release and revision
102+
103+
### Decoding the contents
104+
105+
```bash
106+
helm upgrade --install my-nginx bitnami/nginx \
107+
--set service.type=ClusterIP
108+
kubectl get secrets sh.helm.release.v1.my-nginx.v1 --output json \
109+
| jq --raw-output .data.release \
110+
| base64 -d \
111+
| base64 -d \
112+
| gzip -d
113+
```

120_kubernetes/kustomize/service.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ metadata:
55
name: my-service
66
spec:
77
selector:
8-
matchLabels:
98
type: LoadBalancer
109
ports:
1110
- protocol: TCP

120_kubernetes/kustomize/slides.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Official project [](https://github.com/kubernetes-sigs/kustomize) by Kubernetes
66

77
Official documentation [](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/)
88

9+
Run `kustomize` as part of `kubectl`: `kubectl apply -k .`
10+
911
### Demo
1012

1113
Create final resource descriptions from YAML [](https://github.com/nicholasdille/container-slides/blob/master/120_kubernetes/kustomize/kustomize.demo)

140_gitops/projects.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
The GitOps reference project
66

7-
Created by [WeaveWorks](https://www.weave.works/), CNCF [sandbox project](https://www.cncf.io/sandbox-projects/)
7+
Created by WeaveWorks []](https://www.weave.works/), CNCF graduated project [](https://www.cncf.io/sandbox-projects/)
88

99
### [ArgoCD](https://argoproj.github.io/argo-cd/)
1010

@@ -18,4 +18,4 @@ Kubernetes native CI/CD (Jenkins X builds on top)
1818

1919
Part of the [cd.foundation](https://cd.foundation/)
2020

21-
CNCF graduated project [](https://www.cncf.io/projects/flux/)
21+
cd.foundation graduated project [](https://www.cncf.io/projects/flux/)

2023-10-18_heise-Kubernetes-automatisieren.md

-23
This file was deleted.

0 commit comments

Comments
 (0)