Project

General

Profile

The ungleich kubernetes infrastructure » History » Version 28

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