dodas.kubernetes

Kubernetes Role

This Ansible role sets up a Kubernetes cluster.

Role Variables

Here are the variables you can use with this role, along with simple explanations:

  • kube_version: The version of Kubernetes to install (default is 1.28.7).
  • kube_type_of_node: Type of node (either 'front' or 'wn').
  • kube_server: IP address or name of the main Kube node (default is the server's IP).
  • kube_token: Security token for Kubernetes.
  • kube_token_ttl: Token expiration time (0 means it doesn’t expire).
  • kube_pod_network_cidr: CIDR for the POD network (default is 10.244.0.0/16).
  • kubelet_extra_args: Additional arguments for Kubelet.
  • kube_install_helm: Set to true if you want to install Helm.
  • etcd_in_RAM: Set to true if you want etcd to run in RAM.
  • kube_deploy_dashboard: Set to true if you want to deploy the Dashboard.
  • kube_api_server: Address for the API server (default is 0.0.0.0).
  • kube_apply_repos: List of git repositories to apply in the cluster.
  • kube_install_metrics: Set to true if you want to install Metrics-Server.
  • enable_gpu: Set to true if you want to enable GPU support.
  • gpu_support_role: Name and version of the role to include for GPU support if enabled.

Dependencies

  • ansible-role-gpu-support (if GPU support is enabled)
  • ansible-role-containerd (by geerlingguy)

ETCD in RAM

Requirements

The cluster should use containerd as the container runtime, and etcd must run as a pod in the Kubernetes cluster set up with kubeadm.

Manual setup for an existing cluster

  1. Download nerdctl from here and move it to /usr/local/bin.
  2. Copy the files from the files_etcdRAM folder as follows:
files_etcdRAM/usr/lib/systemd/system/kubelet.service.d ---> /usr/lib/systemd/system/kubelet.service.d
files_etcdRAM/etc/cron.d ---> /etc/cron.d
files_etcdRAM/opt/etcdRAM/bin ---> /opt/etcdRAM/bin
  1. Restart the daemon and update crontab:
systemctl daemon-reload
crontab /etc/cron.d/etcdRAM-etcd
  1. To set up the storage directory /var/lib/etcd as a ramdisk, add this line to /etc/fstab:
tmpfs                       /var/lib/etcd        tmpfs   defaults,noatime,size=2g  0 0
  1. Clear the /var/lib/etcd directory and mount the ramdisk:
rm -rf /var/lib/etcd/*
mount -a

Credits

For more information, check out the post and the original repository where this setup was documented.

Informazioni sul progetto

Install Kubernetes cluster

Installa
ansible-galaxy install dodas.kubernetes
Licenza
apache-2.0
Download
1.5k
Proprietario
Dynamic On Demand Analysis Service DODAS is a Platform as a Service tool built combining several solutions and products