Project

General

Profile

The ungleich kubernetes infrastructure » History » Version 39

Nico Schottelius, 10/04/2021 05:33 AM

1 22 Nico Schottelius
h1. The ungleich kubernetes infrastructure and ungleich kubernetes manual
2 1 Nico Schottelius
3 3 Nico Schottelius
{{toc}}
4
5 1 Nico Schottelius
h2. Status
6
7 28 Nico Schottelius
This document is **pre-production**.
8
This document is to become the ungleich kubernetes infrastructure overview as well as the ungleich kubernetes manual.
9 1 Nico Schottelius
10 10 Nico Schottelius
h2. k8s clusters
11
12 39 Nico Schottelius
| Cluster     | Purpose/Setup    | Master(s)                                                |
13
| c0.k8s.ooo  | Dev              | UNUSED                                                   |
14
| c1.k8s.ooo  | Dev p6 VM        | 2a0a-e5c0-2-11-0-62ff-fe0b-1a3d.k8s-1.place6.ungleich.ch |
15
| c2.k8s.ooo  | Dev p7 HW        | server47 server53 server54                               |
16
| c3.k8s.ooo  | Test p7 PI       | UNUSED                                                   |
17
| c4.k8s.ooo  | Dev2 p7 HW       | server52 server53 server54                               |
18
| c5.k8s.ooo  | Dev p6 VM Amal   | 2a0a-e5c0-2-11-0-62ff-fe0b-1a46.k8s-1.place6.ungleich.ch |
19
| p6.k8s.ooo  | production       |                                                          |
20
| p10.k8s.ooo | production       | server63 server65 server83                               |
21
22 21 Nico Schottelius
23 1 Nico Schottelius
h2. General architecture and components overview
24
25
* All k8s clusters are IPv6 only
26
* We use BGP peering to propagate podcidr and serviceCidr networks to our infrastructure
27
* The main public testing repository is "ungleich-k8s":https://code.ungleich.ch/ungleich-public/ungleich-k8s
28 18 Nico Schottelius
** Private configurations are found in the **k8s-config** repository
29 1 Nico Schottelius
30
h3. Cluster types
31
32 28 Nico Schottelius
| **Type/Feature**            | **Development**                | **Production**         |
33
| Min No. nodes               | 3 (1 master, 3 worker)         | 5 (3 master, 3 worker) |
34
| Recommended minimum         | 4 (dedicated master, 3 worker) | 8 (3 master, 5 worker) |
35
| Separation of control plane | optional                       | recommended            |
36
| Persistent storage          | required                       | required               |
37
| Number of storage monitors  | 3                              | 5                      |
38 1 Nico Schottelius
39
h2. Operations
40
41 36 Nico Schottelius
h3. Get the argocd credentials
42
43
<pre>
44 37 Nico Schottelius
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo ""
45 36 Nico Schottelius
</pre>
46
47 18 Nico Schottelius
h3. Installing a new k8s cluster
48 8 Nico Schottelius
49 9 Nico Schottelius
* Decide on the cluster name (usually *cX.k8s.ooo*), X counting upwards
50 28 Nico Schottelius
** Using pXX.k8s.ooo for production clusters of placeXX
51 9 Nico Schottelius
* Use cdist to configure the nodes with requirements like crio
52
* Decide between single or multi node control plane setups (see below)
53 28 Nico Schottelius
** Single control plane suitable for development clusters
54 9 Nico Schottelius
55 28 Nico Schottelius
Typical init procedure:
56 9 Nico Schottelius
57 28 Nico Schottelius
* Single control plane: @kubeadm init --config bootstrap/XXX/kubeadm.yaml@
58
* Multi control plane (HA): @kubeadm init --config bootstrap/XXX/kubeadm.yaml --upload-certs@
59 10 Nico Schottelius
60 29 Nico Schottelius
h3. Deleting a pod that is hanging in terminating state
61
62
<pre>
63
kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE>
64
</pre>
65
66
(from https://stackoverflow.com/questions/35453792/pods-stuck-in-terminating-status)
67
68 1 Nico Schottelius
h2. Infrastructure versions
69 35 Nico Schottelius
70
h3. ungleich kubernetes infrastructure v3
71
72
* rook is now installed via helm via argocd instead of directly via manifests
73 10 Nico Schottelius
74 28 Nico Schottelius
h3. ungleich kubernetes infrastructure v2
75
76
* Replaced fluxv2 from ungleich k8s v1 with argocd
77
** argocd can apply helm templates directly without needing to go through Chart releases
78
* We are also using argoflow for build flows
79
* Planned to add "kaniko":https://github.com/GoogleContainerTools/kaniko for image building
80
81
h3. ungleich kubernetes infrastructure v1
82
83
We are using the following components:
84
85
* "Calico as a CNI":https://www.projectcalico.org/ with BGP, IPv6 only, no encapsulation
86
** Needed for basic networking
87
* "kubernetes-secret-generator":https://github.com/mittwald/kubernetes-secret-generator for creating secrets
88
** Needed so that secrets are not stored in the git repository, but only in the cluster
89
* "ungleich-certbot":https://hub.docker.com/repository/docker/ungleich/ungleich-certbot
90
** Needed to get letsencrypt certificates for services
91
* "rook with ceph rbd + cephfs":https://rook.io/ for storage
92
** rbd for almost everything, *ReadWriteOnce*
93
** cephfs for smaller things, multi access *ReadWriteMany*
94
** Needed for providing persistent storage
95
* "flux v2":https://fluxcd.io/
96
** Needed to manage resources automatically