Register kube minions through load balancers

In k8s bay, each minion node communicate with master node to register
itself. To enable HA mode, we needs to have multiple master nodes and
registration needs to be done through load balancers to avoid single
point of failure.

Change-Id: I828e40b56e9b38d61bc381caf080f0bd42c698b3
Partially-Implements: blueprint make-master-ha
changes/07/202307/6
Hongbin Lu 7 years ago
parent bccd681de7
commit 24b0eaf7b5
  1. 6
      magnum/templates/heat-kubernetes/fragments/configure-kubernetes-minion.sh
  2. 1
      magnum/templates/heat-kubernetes/fragments/write-heat-params.yaml
  3. 3
      magnum/templates/heat-kubernetes/kubecluster.yaml
  4. 4
      magnum/templates/heat-kubernetes/kubeminion.yaml

@ -8,9 +8,11 @@ myip=$(ip addr show eth0 |
awk '$1 == "inet" {print $2}' | cut -f1 -d/)
myip_last_octet=${myip##*.}
ETCD_SERVER_IP=${ETCD_SERVER_IP:-$KUBE_MASTER_IP}
sed -i '
/^KUBE_ALLOW_PRIV=/ s/=.*/="--allow_privileged='"$KUBE_ALLOW_PRIV"'"/
/^KUBE_ETCD_SERVERS=/ s|=.*|="--etcd_servers=http://'"$KUBE_MASTER_IP"':4001"|
/^KUBE_ETCD_SERVERS=/ s|=.*|="--etcd_servers=http://'"$ETCD_SERVER_IP"':4001"|
' /etc/kubernetes/config
sed -i '
@ -25,7 +27,7 @@ sed -i '
' /etc/kubernetes/apiserver
sed -i '
/^FLANNEL_ETCD=/ s|=.*|="http://'"$KUBE_MASTER_IP"':4001"|
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':4001"|
' /etc/sysconfig/flanneld
cat >> /etc/environment <<EOF

@ -7,5 +7,6 @@ write_files:
content: |
KUBE_ALLOW_PRIV="$KUBE_ALLOW_PRIV"
KUBE_MASTER_IP="$KUBE_MASTER_IP"
ETCD_SERVER_IP="$ETCD_SERVER_IP"
DOCKER_VOLUME="$DOCKER_VOLUME"

@ -386,7 +386,8 @@ resources:
minion_flavor: {get_param: minion_flavor}
fixed_network: {get_resource: fixed_network}
fixed_subnet: {get_resource: fixed_subnet}
kube_master_ip: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]}
kube_master_ip: {get_attr: [api_pool, vip, address]}
etcd_server_ip: {get_attr: [etcd_pool, vip, address]}
external_network: {get_param: external_network}
kube_allow_priv: {get_param: kube_allow_priv}
docker_volume_size: {get_param: docker_volume_size}

@ -44,6 +44,9 @@ parameters:
kube_master_ip:
type: string
description: IP address of the Kubernetes master server.
etcd_server_ip:
type: string
description: IP address of the Etcd server.
fixed_network:
type: string
description: Network from which to allocate fixed addresses.
@ -91,6 +94,7 @@ resources:
params:
$KUBE_ALLOW_PRIV: {get_param: kube_allow_priv}
$KUBE_MASTER_IP: {get_param: kube_master_ip}
$ETCD_SERVER_IP: {get_param: etcd_server_ip}
$DOCKER_VOLUME: {get_resource: docker_volume}
configure_docker_storage:

Loading…
Cancel
Save