The ungleich kubernetes infrastructure » History » Version 15
Nico Schottelius, 07/14/2021 09:53 AM
1 | 1 | Nico Schottelius | h1. The ungleich kubernetes infrastructure |
---|---|---|---|
2 | |||
3 | 3 | Nico Schottelius | {{toc}} |
4 | |||
5 | 1 | Nico Schottelius | h2. Status |
6 | |||
7 | This document is **pre-production** |
||
8 | |||
9 | 10 | Nico Schottelius | h2. k8s clusters |
10 | |||
11 | 13 | Nico Schottelius | | Cluster | Purpose | Init/Notes | |
12 | | c0.k8s.ooo | Dev | @kubeadm init --config k8s/c0/kubeadm.yaml --upload-certs@ | |
||
13 | 15 | Nico Schottelius | | c1.k8s.ooo | undef | Dev | | |
14 | 13 | Nico Schottelius | | c2.k8s.ooo | Demo/Semiprod | @kubeadm init --config k8s/c2/kubeadm.yaml --upload-certs@ | |
15 | 14 | Nico Schottelius | | p5.k8s.ooo | Prod | Place5 | |
16 | 15 | Nico Schottelius | | p6.k8s.ooo | Prod | Place6 | |
17 | 10 | Nico Schottelius | |
18 | 1 | Nico Schottelius | h2. General architecture and components overview |
19 | |||
20 | * All k8s clusters are IPv6 only |
||
21 | * We use BGP peering to propagate podcidr and serviceCidr networks to our infrastructure |
||
22 | 2 | Nico Schottelius | * The main / public repository is "ungleich-k8s":https://code.ungleich.ch/ungleich-public/ungleich-k8s |
23 | 1 | Nico Schottelius | |
24 | h2. ungleich kubernetes infrastructure v1 |
||
25 | |||
26 | We are using the following components: |
||
27 | |||
28 | 6 | Nico Schottelius | * "Calico as a CNI":https://www.projectcalico.org/ with BGP, IPv6 only, no encapsulation |
29 | 1 | Nico Schottelius | * "kubernetes-secret-generator":https://github.com/mittwald/kubernetes-secret-generator for creating secrets |
30 | * "ungleich-certbot":https://hub.docker.com/repository/docker/ungleich/ungleich-certbot to get certificates |
||
31 | 2 | Nico Schottelius | * "rook with ceph rbd + cephfs":https://rook.io/ for storage |
32 | ** rbd for almost everything, *ReadWriteOnce* |
||
33 | ** cephfs for smaller things, multi access *ReadWriteMany* |
||
34 | 3 | Nico Schottelius | |
35 | 8 | Nico Schottelius | h3. Persistent storage setup |
36 | |||
37 | * 3 or 5 monitors |
||
38 | |||
39 | 9 | Nico Schottelius | h3. Cluster types |
40 | 1 | Nico Schottelius | |
41 | 9 | Nico Schottelius | | **Type/Feature** | **Development** | **Production** | |
42 | | Min No. nodes | 3 (1 master, 3 worker) | 5 (3 master, 3 worker) | |
||
43 | | Recommended minimum | 4 (dedicated master, 3 worker) | 8 (3 master, 5 worker) | |
||
44 | | Separation of control plane | optional | recommended | |
||
45 | | Persistent storage | required | required | |
||
46 | | Number of storage monitors | 3 | 5 | |
||
47 | 10 | Nico Schottelius | |
48 | h2. Operations |
||
49 | |||
50 | h3. Installing a new k8s cluster |
||
51 | |||
52 | * Decide on the cluster name (usually *cX.k8s.ooo*), X counting upwards |
||
53 | * Use cdist to configure the nodes with requirements like crio |
||
54 | * Decide between single or multi node control plane setups (see below) |
||
55 | * Setup DNS delegation and glue records: |
||
56 | ** kube-dns.kube-system.svc.cX AAAA ... |
||
57 | ** kube-dns.kube-system.svc.cX A ... |
||
58 | ** cX NS kube-dns.kube-system.svc.cX |
||
59 | |||
60 | 9 | Nico Schottelius | |
61 | 8 | Nico Schottelius | |
62 | 3 | Nico Schottelius | h2. Open Issues / To be discussed |
63 | |||
64 | * "Maybe add Autoscaling support?":https://github.com/kubernetes-sigs/metrics-server |
||
65 | ** https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ |
||
66 | ** https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/ |
||
67 | * Certainly deploy in-cluster monitoring |
||
68 | ** "prometheus-operator":https://github.com/prometheus-operator/prometheus-operator CR |
||
69 | ** "kube-prometheus":https://github.com/prometheus-operator/kube-prometheus complete example, based on prometheus-operator |
||
70 | 4 | Nico Schottelius | ** "kubernetes dashboard":https://github.com/kubernetes/dashboard generic cluster overview, basically kubectl for a broswer + graphs |
71 | 5 | Nico Schottelius | ** "kube-prometheus-stack via helm":https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#kube-prometheus-stack |
72 | *** Looks most fitting, testing it in #9468 |
||
73 | 7 | Nico Schottelius | * Matrix/Notification bot |
74 | ** Informing about changes in the cluster |