Common Configurations

Edit

This tutorial explains how to customize KubeSphere configurations in conf/common.yaml. You can reference the following section to understand each parameter.

  1. ######################### Kubernetes #########################
  2. # The default k8s version will be installed
  3. kube_version: v1.16.7
  4. # The default etcd version will be installed
  5. etcd_version: v3.2.18
  6. # Configure a cron job to backup etcd data, which is running on etcd machines.
  7. # Period of running backup etcd job, the unit is minutes.
  8. # The default value 30 means backup etcd every 30 minutes.
  9. etcd_backup_period: 30
  10. # How many backup replicas to keep.
  11. # The default value5 means to keep latest 5 backups, older ones will be deleted by order.
  12. keep_backup_number: 5
  13. # The location to store etcd backups files on etcd machines.
  14. etcd_backup_dir: "/var/backups/kube_etcd"
  15. # Add other registry. (For users who need to accelerate image download)
  16. docker_registry_mirrors:
  17. - https://docker.mirrors.ustc.edu.cn
  18. - https://registry.docker-cn.com
  19. - https://mirror.aliyuncs.com
  20. # Kubernetes network plugin, Calico will be installed by default. Note that Calico and flannel are recommended, which are tested and verified by KubeSphere.
  21. kube_network_plugin: calico
  22. # A valid CIDR range for Kubernetes services,
  23. # 1. should not overlap with node subnet
  24. # 2. should not overlap with Kubernetes pod subnet
  25. kube_service_addresses: 10.233.0.0/18
  26. # A valid CIDR range for Kubernetes pod subnet,
  27. # 1. should not overlap with node subnet
  28. # 2. should not overlap with Kubernetes services subnet
  29. kube_pods_subnet: 10.233.64.0/18
  30. # Kube-proxy proxyMode configuration, either ipvs, or iptables
  31. kube_proxy_mode: ipvs
  32. # Maximum pods allowed to run on every node.
  33. kubelet_max_pods: 110
  34. # Enable nodelocal dns cache, see https://github.com/kubernetes-sigs/kubespray/blob/master/docs/dns-stack.md#nodelocal-dns-cache for further information
  35. enable_nodelocaldns: true
  36. # Highly Available loadbalancer example config
  37. # apiserver_loadbalancer_domain_name: "lb.kubesphere.local" # Loadbalancer domain name
  38. # loadbalancer_apiserver: # Loadbalancer apiserver configuration, please uncomment this line when you prepare HA install
  39. # address: 192.168.0.10 # Loadbalancer apiserver IP address
  40. # port: 6443 # apiserver port
  41. ######################### KubeSphere #########################
  42. # Version of KubeSphere
  43. ks_version: v2.1.0
  44. # KubeSphere console port, range 30000-32767,
  45. # but 30180/30280/30380 are reserved for internal service
  46. console_port: 30880 # KubeSphere console nodeport
  47. #CommonComponent
  48. mysql_volume_size: 20Gi # MySQL PVC size
  49. minio_volume_size: 20Gi # Minio PVC size
  50. etcd_volume_size: 20Gi # etcd PVC size
  51. openldap_volume_size: 2Gi # openldap PVC size
  52. redis_volume_size: 2Gi # Redis PVC size
  53. # Monitoring
  54. prometheus_replica: 2 # Prometheus replicas with 2 by default which are responsible for monitoring different segments of data source and provide high availability as well.
  55. prometheus_memory_request: 400Mi # Prometheus request memory
  56. prometheus_volume_size: 20Gi # Prometheus PVC size
  57. grafana_enabled: true # enable grafana or not
  58. ## Container Engine Acceleration
  59. ## Use nvidia gpu acceleration in containers
  60. # nvidia_accelerator_enabled: true # enable Nvidia GPU accelerator or not. It supports hybrid node with GPU and CPU installed.
  61. # nvidia_gpu_nodes: # The GPU nodes specified in hosts.ini. FOr now we only support Ubuntu 16.04
  62. # - kube-gpu-001 # The host name of the GPU node specified in hosts.ini

How to Configure a GPU Node

You may want to use GPU nodes for special purpose such as machine learning. Let’s say you have a GPU node called node2 in hosts.ini, then in the file common.yaml specify the following configuration. Please be aware the - node2 has two spaces indent.

  1. nvidia_accelerator_enabled: true
  2. nvidia_gpu_nodes:
  3. - node2

Note: The GPU node now only supports Ubuntu 16.04.