Merge heat-kubernetes pull request 14

Pull request 14 changes the start order of Kubernetes.  The master
now starts first, and the minion starts after the master completes.

This prevents flanneld in the minions from timing out and failing to
start the kubernetes services on the minions.

See:
https://github.com/larsks/heat-kubernetes/pull/14/

Change-Id: Ia823fd3593dc7c5d9d9c6327e009b833ad586a5c
Closes-bug: #1434468
changes/61/166661/1
Steven Dake 8 years ago
parent 657adca543
commit e6e86f7163
  1. 2
      magnum/templates/heat-kubernetes/fragments/configure-kubernetes-master.sh
  2. 8
      magnum/templates/heat-kubernetes/fragments/configure-kubernetes-minion.sh
  3. 1
      magnum/templates/heat-kubernetes/fragments/write-heat-params-master.yaml
  4. 2
      magnum/templates/heat-kubernetes/kubecluster.yaml

@ -14,6 +14,6 @@ sed -i '
' /etc/kubernetes/apiserver
sed -i '
/^KUBELET_ADDRESSES=/ s/=.*/="--machines='"$MINION_ADDRESSES"'"/
/^KUBELET_ADDRESSES=/ s/=.*/="--machines='""'"/
' /etc/kubernetes/controller-manager

@ -29,3 +29,11 @@ sed -i '
cat >> /etc/environment <<EOF
KUBERNETES_MASTER=http://$KUBE_MASTER_IP:8080
EOF
cpu=$(expr $(nproc) \* 1000)
memory_kb=$(cat /proc/meminfo | awk '/MemTotal: /{print $2}')
memory=$(expr $memory_kb \* 1024)
curl -sf -X POST -H 'Content-Type: application/json' \
--data-binary "{'kind':'Minion','id':'$myip','apiVersion':'v1beta1',
'resources':{'capacity':{'cpu':$cpu,'memory':$memory}}}" \
http://$KUBE_MASTER_IP:8080/api/v1beta1/minions

@ -5,7 +5,6 @@ write_files:
owner: "root:root"
permissions: "0644"
content: |
MINION_ADDRESSES="$MINION_ADDRESSES"
KUBE_ALLOW_PRIV="$KUBE_ALLOW_PRIV"
WAIT_HANDLE="$WAIT_HANDLE"
FLANNEL_NETWORK_CIDR="$FLANNEL_NETWORK_CIDR"

@ -193,7 +193,6 @@ resources:
str_replace:
template: {get_file: fragments/write-heat-params-master.yaml}
params:
"$MINION_ADDRESSES": {"Fn::Join": [",", {get_attr: [kube_minions, kube_node_ip]}]}
"$KUBE_ALLOW_PRIV": {get_param: kube_allow_priv}
"$WAIT_HANDLE": {get_resource: master_wait_handle}
"$FLANNEL_NETWORK_CIDR": {get_param: flannel_network_cidr}
@ -311,6 +310,7 @@ resources:
type: "OS::Heat::ResourceGroup"
depends_on:
- extrouter_inside
- master_wait_condition
properties:
count: {get_param: number_of_minions}
resource_def:

Loading…
Cancel
Save