Skip to Content
Node ManagementCustom Data and Initialization Scripts

Custom Data and Initialization Scripts

Custom Data

Custom data refers to a configuration script that the system automatically runs when the host is first started or each time it starts. This script can be passed to the metadata server via the console/API, etc., and retrieved by the cloud-init program in the host. The script follows standard CloudInit syntax and will block the UK8S installation script, meaning that the installation of K8S-related components (such as Kubelet and Scheduler) will only start after this script has finished executing.

Initialization Script

This script executes only once after UK8S starts, and runs after K8S-related components are successfully installed. Following standard shell syntax, execution results are stored in the /var/log/message/ directory.

Users can use custom data and initialization scripts to customize the installation of self-owned services (such as kernel modifications and disk monitoring) when creating clusters. Detailed usage methods

Precautions

When modifying /etc/sysctl.conf using an initialization script, do not modify the following parameters, as this will affect the normal use of the created cluster.

net.ipv4.tcp_tw_reuse = 1 net.ipv4.conf.eth0.proxy_arp = 1 net.ipv4.ip_forward = 1 vm.max_map_count = 262144 net.netfilter.nf_conntrack_max = 1048576 kernel.unknown_nmi_panic = 0 kernel.sysrq = 1 fs.file-max = 1000000 vm.swappiness = 10 fs.inotify.max_user_watches = 10000000 net.core.wmem_max = 327679 net.core.rmem_max = 327679 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 fs.inotify.max_queued_events = 327679 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 net.ipv4.neigh.default.gc_thresh1 = 2048 net.ipv4.neigh.default.gc_thresh2 = 4096 net.ipv4.neigh.default.gc_thresh3 = 8192 net.ipv6.conf.all.disable_ipv6 = 1 net.bridge.bridge-nf-call-iptables = 1 net.ipv4.conf.all.arp_ignore = 0 net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 6 kernel.pid_max = 1024000 net.ipv4.ip_local_port_range = 32768 60999 net.ipv4.tcp_tw_reuse = 1