After you complete the prerequisite steps described in Prerequisites, deploy your MCP Kubernetes cluster manually using the procedure below.
To deploy the Kubernetes cluster:
Log in to the Salt Master node.
Update modules and states on all Minions:
salt '*' saltutil.sync_all
If you use autoregistration for the compute nodes, register all discovered compute nodes. Run the following command on every compute node:
salt-call event.send "reclass/minion/classify" \
"{\"node_master_ip\": \"<config_host>\", \
\"node_os\": \"<os_codename>\", \
\"node_deploy_ip\": \"<node_deploy_network_ip>\", \
\"node_deploy_iface\": \"<node_deploy_network_iface>\", \
\"node_control_ip\": \"<node_control_network_ip>\", \
\"node_control_iface\": \"<node_control_network_iface>\", \
\"node_sriov_ip\": \"<node_sriov_ip>\", \
\"node_sriov_iface\": \"<node_sriov_iface>\", \
\"node_tenant_ip\": \"<node_tenant_network_ip>\", \
\"node_tenant_iface\": \"<node_tenant_network_iface>\", \
\"node_external_ip\": \"<node_external_network_ip>\", \
\"node_external_iface\": \"<node_external_network_iface>\", \
\"node_baremetal_ip\": \"<node_baremetal_network_ip>\", \
\"node_baremetal_iface\": \"<node_baremetal_network_iface>\", \
\"node_domain\": \"<node_domain>\", \
\"node_cluster\": \"<cluster_name>\", \
\"node_hostname\": \"<node_hostname>\"}"
Modify the parameters passed with the command above as required. The table below provides the description of the parameters required for a compute node registration.
Parameter | Description |
---|---|
config_host |
IP of the Salt Master node |
os_codename |
Operating system code name. Check the system response of lsb_release -c for it |
node_deploy_network_ip |
Minion deploy network IP address |
node_deploy_network_iface |
Minion deploy network interface |
node_control_network_ip |
Minion control network IP address |
node_control_network_iface |
Minion control network interface |
node_sriov_ip |
Minion SR-IOV IP address |
node_sriov_iface |
Minion SR-IOV interface |
node_tenant_network_ip |
Minion tenant network IP address |
node_tenant_network_iface |
Minion tenant network interface |
node_external_network_ip |
Minion external network IP address |
node_external_network_iface |
Minion external network interface |
node_baremetal_network_ip |
Minion baremetal network IP address |
node_baremetal_network_iface |
Minion baremetal network interface |
node_domain |
Domain of a minion. Check the system response of hostname -d for it |
cluster_name |
Value of the cluster_name variable specified in the Reclass model. See Basic deployment parameters for details |
node_hostname |
Short hostname without a domain part. Check the system response of hostname -s for it |
Log in to the Salt Master node.
Perform Linux system configuration to synchronize repositories and execute outstanding system maintenance tasks:
salt '*' state.sls linux.system
Install the Kubernetes control plane:
Bootstrap the Kubernetes Master nodes:
salt -C 'I@kubernetes:master' state.sls linux
salt -C 'I@kubernetes:master' state.sls salt.minion
salt -C 'I@kubernetes:master' state.sls openssh,ntp
Create and distribute SSL certificates for services using the salt state and install etcd with the SSL support:
salt -C 'I@kubernetes:master' state.sls salt.minion.cert,etcd.server.service
salt -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
Install Keepalived:
salt -C 'I@keepalived:cluster' state.sls keepalived -b 1
Install HAProxy:
salt -C 'I@haproxy:proxy' state.sls haproxy
salt -C 'I@haproxy:proxy' service.status haproxy
Install Kubernetes:
salt -C 'I@kubernetes:master' state.sls kubernetes.master.kube-addons
salt -C 'I@kubernetes:master' state.sls kubernetes.pool
For the Calico setup:
Verify the Calico nodes status:
salt -C 'I@kubernetes:pool' cmd.run "calicoctl node status"
Set up NAT for Calico:
salt -C 'I@kubernetes:master' state.sls etcd.server.setup
Apply the following state to simplify namespaces creation:
salt -C 'I@kubernetes:master and *01*' state.sls kubernetes.master \
exclude=kubernetes.master.setup
Apply the following state:
salt -C 'I@kubernetes:master' state.sls kubernetes exclude=kubernetes.master.setup
Run the Kubernetes Master nodes setup:
salt -C 'I@kubernetes:master' state.sls kubernetes.master.setup
Restart kubelet
:
salt -C 'I@kubernetes:master' service.restart kubelet
Log in to any Kubernetes Master node and verify that all nodes have been registered successfully:
kubectl get nodes
Deploy the Kubernetes Nodes:
Log in to the Salt Master node.
Bootstrap all compute nodes:
salt -C 'I@kubernetes:pool and not I@kubernetes:master' state.sls linux
salt -C 'I@kubernetes:pool and not I@kubernetes:master' state.sls salt.minion
salt -C 'I@kubernetes:pool and not I@kubernetes:master' state.sls openssh,ntp
Create and distribute SSL certificates for services and install etcd with the SSL support:
salt -C 'I@kubernetes:pool and not I@kubernetes:master' state.sls salt.minion.cert,etcd.server.service
salt -C 'I@etcd:server' cmd.run '. /var/lib/etcd/configenv && etcdctl cluster-health'
Install Kubernetes:
salt -C 'I@kubernetes:pool and not I@kubernetes:master' state.sls kubernetes.pool
Restart kubelet
:
salt -C 'I@kubernetes:pool and not I@kubernetes:master' service.restart kubelet
After you deploy Kubernetes, deploy StackLight LMA to your cluster as described in Deploy StackLight LMA.