Project

General

Profile

The ungleich kubernetes infrastructure » History » Version 30

Nico Schottelius, 08/19/2021 08:12 PM

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