From 2aa23e5f01165f1e3f416a7a407534916f158405 Mon Sep 17 00:00:00 2001 From: saffronjam Date: Sat, 4 May 2024 12:37:26 +0200 Subject: [PATCH] Upgrade install Kubernetes cluster guide --- .../maintenance/installKubernetesCluster.md | 238 +++++++++++++++--- 1 file changed, 198 insertions(+), 40 deletions(-) diff --git a/hugo/content/maintenance/installKubernetesCluster.md b/hugo/content/maintenance/installKubernetesCluster.md index 0dca698..561282a 100644 --- a/hugo/content/maintenance/installKubernetesCluster.md +++ b/hugo/content/maintenance/installKubernetesCluster.md @@ -18,18 +18,29 @@ This guide is only required if you are setting up a new sys-cluster. If you are ### 1. Setup Rancher and dependencies You should SSH into a master node of the sys-cluster to run the following commands. -1. Install `MetalLB` +1. Set envs: + ```bash + # The root domain for your certificates. + # This will make rancher available at mgmt.${DOMAIN} and other sys-cluster services available at *.${DOMAIN} + export DOMAIN= + # API URL to the PDNS instance http://172.31.1.68:8081 + export PDNS_API_URL= + # API key for the PDNS instance (base64 encoded) + export PDNS_API_KEY= + # IP_POOL for MetalLB, for example 172.31.100.100-172.31.100.150 + export IP_POOL= + ``` + +2. Install `MetalLB` ```bash kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.4/config/manifests/metallb-native.yaml ``` -2. Configure IP range for MetalLB +3. Configure IP range for MetalLB Edit the `POOL` variable to match the IP range you want to use. The IP range should be within the subnet of the sys-cluster. ```bash - POOL="172.31.100.100-172.31.100.200" - kubectl apply -f - < `Settings` and edit both `auth-token-max-ttl-minutes` and `kubeconfig-default-token-ttl-minutes` to `0` to disable token expiration. @@ -156,14 +278,13 @@ Make sure that the cluster you are deploying have atleast one node for each role export PDNS_API_URL= # API key for the PDNS instance (base64 encoded) export PDNS_API_KEY= - # IP_POOL for MetalLB, e.g. 172.31.50.100-172.31.50.150 + # IP_POOL for MetalLB, for example 172.31.50.100-172.31.50.150 export IP_POOL= # NFS server for the storage classes, for example nfs.cloud.cbh.kth.se export NFS_SERVER= # Base path for the different kind of storages that are used: disks, scratch and user storage export NFS_BASE_PATH= ``` - ``` 2. Install `Ingress-NGINX` ```bash @@ -171,16 +292,30 @@ Make sure that the cluster you are deploying have atleast one node for each role --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx \ --create-namespace \ - --set controller.ingressClassResource.default=true - ``` - - Edit the created config map and add the following to the `data` section: - ```yaml - data: - allow-snippet-annotations: "true" - proxy-buffering: "on" - proxy-buffers: 4 "512k" - proxy-buffer-size: "256k" + --values - <