|
| 1 | +[](){#ref-kubernetes-clusters} |
| 2 | +# CSCS Kubernetes clusters |
| 3 | + |
| 4 | +This document provides an overview of the Kubernetes clusters maintained by CSCS and offers step-by-step instructions for accessing and interacting with them. |
| 5 | + |
| 6 | +## Architecture |
| 7 | + |
| 8 | +All Kubernetes clusters at CSCS are: |
| 9 | + |
| 10 | +- Managed using **[Rancher](https://www.rancher.com)** |
| 11 | +- Running **[RKE2 (Rancher Kubernetes Engine 2)](https://github.com/rancher/rke2)** |
| 12 | + |
| 13 | +CSCS offers two types of Kubernetes clusters for partners: |
| 14 | + |
| 15 | +- **Harvester-only clusters**: These clusters run exclusively on virtual machines provisioned by Harvester (SUSE Virtualization), providing a flexible and isolated environment suitable for most workloads. |
| 16 | +- **Alpernetes clusters**: These clusters combine Harvester VMs with compute nodes from the Alps supercomputer. This hybrid setup, called *Alpernetes*, enables workloads to leverage both virtualized infrastructure and high-performance computing resources within the same Kubernetes environment. |
| 17 | + |
| 18 | +## Cluster Environments |
| 19 | + |
| 20 | +Clusters are grouped into two main environments: |
| 21 | + |
| 22 | +- **TDS** – Test and Development Systems |
| 23 | +- **PROD** – Production |
| 24 | + |
| 25 | +See [Kubernetes upgrades][ref-kubernetes-clusters-upgrades] for detailed upgrade policy. |
| 26 | + |
| 27 | +## Kubernetes API Access |
| 28 | + |
| 29 | +You can access the Kubernetes API in two main ways: |
| 30 | + |
| 31 | +### Direct Internet Access |
| 32 | + |
| 33 | +- A Virtual IP is exposed for the API server. |
| 34 | +- Access is restricted by source IP addresses of the partner. |
| 35 | + |
| 36 | +### Access via CSCS Jump Host |
| 37 | + |
| 38 | +- Connect through a jump host (e.g., `ela.cscs.ch`). |
| 39 | +- API calls are securely proxied through Rancher. |
| 40 | + |
| 41 | +To check which method you are using, examine the `current-context` in your `kubeconfig` file. |
| 42 | + |
| 43 | +## Cluster Access |
| 44 | + |
| 45 | +To interact with the cluster, you need the `kubectl` CLI: |
| 46 | +🔗 [Install kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) |
| 47 | +??? Note "`kubectl` is pre-installed on the CSCS jump host." |
| 48 | + |
| 49 | + |
| 50 | +### Retrieve your kubeconfig file |
| 51 | + |
| 52 | +#### Internal CSCS Users |
| 53 | +Access [Rancher](https://rancher.cscs.ch) and download the kubeconfig for your cluster. |
| 54 | + |
| 55 | +#### External Users |
| 56 | +A specific Rancher user and password should have been provided to the partner. |
| 57 | + |
| 58 | +Use the `kcscs` tool installed on `ela.cscs.ch` to obtain the kubeconfig by following the next steps. |
| 59 | + |
| 60 | +Download your SSH keys from [SSH Service](https://sshservice.cscs.ch) (and add them to the SSH agent). |
| 61 | + |
| 62 | +SSH to the jump host using the downloaded SSH keys |
| 63 | +```bash |
| 64 | +ssh ela.cscs.ch |
| 65 | +``` |
| 66 | + |
| 67 | +Login with `kcscs` with the provided Rancher credentials |
| 68 | +```bash |
| 69 | +kcscs login |
| 70 | +``` |
| 71 | + |
| 72 | +List the accessible clusters |
| 73 | +```bash |
| 74 | +kcscs list |
| 75 | +``` |
| 76 | + |
| 77 | +Retrieve the kubeconfig file for a specific cluster |
| 78 | +```bash |
| 79 | +kcscs get |
| 80 | +``` |
| 81 | + |
| 82 | + |
| 83 | +### Store the kubeconfig file |
| 84 | + |
| 85 | +```bash |
| 86 | +mv mykubeconfig.yaml ~/.kube/config |
| 87 | +``` |
| 88 | +or |
| 89 | +```bash |
| 90 | +export KUBECONFIG=/home/user/kubeconfig.yaml |
| 91 | +``` |
| 92 | + |
| 93 | +### Test connectivity |
| 94 | + ```bash |
| 95 | + kubectl get nodes |
| 96 | + ``` |
| 97 | + |
| 98 | +!!! warning |
| 99 | + The kubeconfig file contains credentials. Keep it secure. |
| 100 | + |
| 101 | +## Pre-installed Applications |
| 102 | + |
| 103 | +All CSCS-provided clusters include a set of pre-installed tools and components, described below: |
| 104 | + |
| 105 | +### `ceph-csi` |
| 106 | + |
| 107 | +Provides dynamic persistent volume provisioning via the Ceph Container Storage Interface (CEPH CSI). |
| 108 | + |
| 109 | +#### Storage Classes |
| 110 | + |
| 111 | +- `cephfs` – ReadWriteMany (RWX), backed by HDD (large data volumes) |
| 112 | +- `rbd-hdd` – ReadWriteOnce (RWO), backed by HDD |
| 113 | +- `rbd-nvme` – RWO, backed by NVMe (high-performance workloads like databases) |
| 114 | +- `*-retain` – Same classes, but retain the volume after PVC deletion |
| 115 | + |
| 116 | +### `external-dns` |
| 117 | + |
| 118 | +Automatically manages DNS entries for: |
| 119 | + |
| 120 | +- Ingress resources |
| 121 | +- Services of type `LoadBalancer` (when annotated) |
| 122 | + |
| 123 | +#### Example |
| 124 | +```bash |
| 125 | +kubectl annotate service nginx "external-dns.alpha.kubernetes.io/hostname=nginx.mycluster.tds.cscs.ch." |
| 126 | +``` |
| 127 | + |
| 128 | +!!! Note "Use a valid name under the configured subdomain" |
| 129 | + |
| 130 | +🔗 [external-dns documentation](https://github.com/kubernetes-sigs/external-dns) |
| 131 | + |
| 132 | +### `cert-manager` |
| 133 | + |
| 134 | +Handles automatic issuance of TLS certificates from Let's Encrypt. |
| 135 | + |
| 136 | +#### Example |
| 137 | +```yaml |
| 138 | +apiVersion: cert-manager.io/v1 |
| 139 | +kind: Certificate |
| 140 | +metadata: |
| 141 | + name: echo |
| 142 | +spec: |
| 143 | + secretName: echo |
| 144 | + commonName: echo.mycluster.tds.cscs.ch |
| 145 | + dnsNames: |
| 146 | + - echo.mycluster.tds.cscs.ch |
| 147 | + issuerRef: |
| 148 | + kind: ClusterIssuer |
| 149 | + name: letsencrypt |
| 150 | +``` |
| 151 | +
|
| 152 | +You can also issue certificates automatically via Ingress annotations (see `ingress-nginx` section). |
| 153 | + |
| 154 | +🔗 [cert-manager documentation](https://cert-manager.io) |
| 155 | + |
| 156 | +### `metallb` |
| 157 | + |
| 158 | +Enables `LoadBalancer` service types by assigning public IPs. |
| 159 | + |
| 160 | +!!! Warning "The public IP pool is limited. Prefer using `Ingress` unless you specifically need a `LoadBalancer` Service for TCP traffic." |
| 161 | + |
| 162 | +🔗 [MetalLB documentation](https://metallb.universe.tf) |
| 163 | + |
| 164 | +### `ingress-nginx` |
| 165 | + |
| 166 | +Default Ingress controller with class `nginx`. |
| 167 | +Supports automatic TLS via cert-manager annotations. |
| 168 | + |
| 169 | +Example: |
| 170 | + |
| 171 | +```yaml |
| 172 | +apiVersion: networking.k8s.io/v1 |
| 173 | +kind: Ingress |
| 174 | +metadata: |
| 175 | + name: myIngress |
| 176 | + namespace: myIngress |
| 177 | + annotations: |
| 178 | + cert-manager.io/cluster-issuer: letsencrypt |
| 179 | +spec: |
| 180 | + rules: |
| 181 | + - host: example.tds.cscs.ch |
| 182 | + http: |
| 183 | + paths: |
| 184 | + - pathType: Prefix |
| 185 | + path: / |
| 186 | + backend: |
| 187 | + service: |
| 188 | + name: myservice |
| 189 | + port: |
| 190 | + number: 80 |
| 191 | + tls: |
| 192 | + - hosts: |
| 193 | + - example.tds.cscs.ch |
| 194 | + secretName: myingress-cert |
| 195 | +``` |
| 196 | + |
| 197 | +🔗 [NGINX Ingress Docs](https://docs.nginx.com/nginx-ingress-controller) |
| 198 | +🔗 [cert-manager Ingress Usage](https://cert-manager.io/docs/usage/ingress/) |
| 199 | + |
| 200 | +### `external-secrets` |
| 201 | + |
| 202 | +Integrates with secret management tools like **HashiCorp Vault**. |
| 203 | + |
| 204 | +Enables the usage of `ExternalSecret` resources to fetch secrets from `SecreStore` or `ClusterSecretStore` resources to fetch secrets and store them into `Secrets` inside the cluster. |
| 205 | + |
| 206 | +It helps to avoid storing secrets in the deployment manifests, especially in GitOps environments. |
| 207 | + |
| 208 | +🔗 [external-secrets documentation](https://external-secrets.io/) |
| 209 | + |
| 210 | +### `kured` |
| 211 | + |
| 212 | +Responsible for automatic node reboots (e.g., after kernel updates). |
| 213 | + |
| 214 | +🔗 [kured documentation](https://kured.dev/) |
| 215 | + |
| 216 | +### Observability |
| 217 | + |
| 218 | +Includes: |
| 219 | + |
| 220 | +- **Beats agents** – Export logs and metrics to CSCS’s central log system |
| 221 | +- **Prometheus** – Scrapes metrics and exports them to CSCS's central monitoring cluster |
0 commit comments