mirror of https://github.com/easzlab/kubeasz.git
feat: add support to set nodename, part3
parent
3069704f6c
commit
a28a3f7172
|
@ -27,8 +27,11 @@ CONTEXT_NAME: "context-{{ CLUSTER_NAME }}"
|
||||||
K8S_VER: "__k8s_ver__"
|
K8S_VER: "__k8s_ver__"
|
||||||
|
|
||||||
# set unique 'k8s_nodename' for each node, if not set(default:'') ip add will be used
|
# set unique 'k8s_nodename' for each node, if not set(default:'') ip add will be used
|
||||||
|
# CAUTION: 'k8s_nodename' must consist of lower case alphanumeric characters, '-' or '.',
|
||||||
|
# and must start and end with an alphanumeric character (e.g. 'example.com'),
|
||||||
|
# regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
|
||||||
K8S_NODENAME: "{%- if k8s_nodename != '' -%} \
|
K8S_NODENAME: "{%- if k8s_nodename != '' -%} \
|
||||||
{{ k8s_nodename }} \
|
{{ k8s_nodename|replace('_', '-')|lower }} \
|
||||||
{%- else -%} \
|
{%- else -%} \
|
||||||
{{ inventory_hostname }} \
|
{{ inventory_hostname }} \
|
||||||
{%- endif -%}"
|
{%- endif -%}"
|
||||||
|
|
|
@ -3,10 +3,14 @@
|
||||||
192.168.1.1
|
192.168.1.1
|
||||||
|
|
||||||
# master node(s), set unique 'k8s_nodename' for each node
|
# master node(s), set unique 'k8s_nodename' for each node
|
||||||
|
# CAUTION: 'k8s_nodename' must consist of lower case alphanumeric characters, '-' or '.',
|
||||||
|
# and must start and end with an alphanumeric character
|
||||||
[kube_master]
|
[kube_master]
|
||||||
192.168.1.1 k8s_nodename=''
|
192.168.1.1 k8s_nodename=''
|
||||||
|
|
||||||
# work node(s), set unique 'k8s_nodename' for each node
|
# work node(s), set unique 'k8s_nodename' for each node
|
||||||
|
# CAUTION: 'k8s_nodename' must consist of lower case alphanumeric characters, '-' or '.',
|
||||||
|
# and must start and end with an alphanumeric character
|
||||||
[kube_node]
|
[kube_node]
|
||||||
192.168.1.1 k8s_nodename=''
|
192.168.1.1 k8s_nodename=''
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,19 @@
|
||||||
192.168.1.3
|
192.168.1.3
|
||||||
|
|
||||||
# master node(s), set unique 'k8s_nodename' for each node
|
# master node(s), set unique 'k8s_nodename' for each node
|
||||||
|
# CAUTION: 'k8s_nodename' must consist of lower case alphanumeric characters, '-' or '.',
|
||||||
|
# and must start and end with an alphanumeric character
|
||||||
[kube_master]
|
[kube_master]
|
||||||
192.168.1.1 k8s_nodename=''
|
192.168.1.1 k8s_nodename='master-01'
|
||||||
192.168.1.2 k8s_nodename=''
|
192.168.1.2 k8s_nodename='master-02'
|
||||||
|
192.168.1.3 k8s_nodename='master-03'
|
||||||
|
|
||||||
# work node(s), set unique 'k8s_nodename' for each node
|
# work node(s), set unique 'k8s_nodename' for each node
|
||||||
|
# CAUTION: 'k8s_nodename' must consist of lower case alphanumeric characters, '-' or '.',
|
||||||
|
# and must start and end with an alphanumeric character
|
||||||
[kube_node]
|
[kube_node]
|
||||||
192.168.1.3 k8s_nodename=''
|
192.168.1.4 k8s_nodename='worker-01'
|
||||||
192.168.1.4 k8s_nodename=''
|
192.168.1.5 k8s_nodename='worker-02'
|
||||||
|
|
||||||
# [optional] harbor server, a private docker registry
|
# [optional] harbor server, a private docker registry
|
||||||
# 'NEW_INSTALL': 'true' to install a harbor server; 'false' to integrate with existed one
|
# 'NEW_INSTALL': 'true' to install a harbor server; 'false' to integrate with existed one
|
||||||
|
|
Loading…
Reference in New Issue