diff --git a/parts/k8s/kubernetesmastercustomdata.yml b/parts/k8s/kubernetesmastercustomdata.yml index fe139c44ba..1c17267478 100644 --- a/parts/k8s/kubernetesmastercustomdata.yml +++ b/parts/k8s/kubernetesmastercustomdata.yml @@ -366,6 +366,8 @@ runcmd: - sudo /bin/chown etcd:etcd {{WrapAsVariable "etcdServerKeyFilepath"}} - sudo /bin/chown etcd:etcd {{WrapAsVerbatim "variables('etcdPeerKeyFilepath')[copyIndex(variables('masterOffset'))]"}} - systemctl restart etcd +- MEMBER="$(sudo etcdctl member list | grep -E {{WrapAsVerbatim "variables('masterVMNames')[copyIndex(variables('masterOffset'))]"}} | cut -d{{WrapAsVariable "singleQuote"}}:{{WrapAsVariable "singleQuote"}} -f 1)" +- sudo etcdctl member update ${MEMBER} {{WrapAsVerbatim "variables('masterEtcdPeerURLs')[copyIndex(variables('masterOffset'))]"}} - for i in $(seq 1 20); do curl --cacert /etc/kubernetes/certs/ca.crt --cert /etc/kubernetes/certs/etcdclient.crt --key /etc/kubernetes/certs/etcdclient.key --max-time 60 "{{WrapAsVerbatim "variables('masterEtcdClientURLs')[copyIndex(variables('masterOffset'))]"}}"/v2/machines; [ $? -eq 0 ] && break || sleep 5; done - retrycmd_if_failure apt-get update - retrycmd_if_failure apt-get install -y apt-transport-https ca-certificates diff --git a/parts/k8s/kubernetesmastervars.t b/parts/k8s/kubernetesmastervars.t index bed18bb84b..ebcccef184 100644 --- a/parts/k8s/kubernetesmastervars.t +++ b/parts/k8s/kubernetesmastervars.t @@ -297,6 +297,7 @@ "scope": "[resourceGroup().id]", "tenantId": "[subscription().tenantId]", "targetEnvironment": "[parameters('targetEnvironment')]", + "singleQuote": "'", "dockerEngineDownloadRepo": "[parameters('dockerEngineDownloadRepo')]", "dockerEngineVersion": "[parameters('dockerEngineVersion')]" {{if .LinuxProfile.HasSecrets}} @@ -330,6 +331,5 @@ "agentWindowsOffer": "WindowsServerSemiAnnual", "agentWindowsSku": "Datacenter-Core-1709-with-Containers-smalldisk", "agentWindowsVersion": "[parameters('agentWindowsVersion')]", - "singleQuote": "'", "windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; Copy-Item $inputFile $outputFile ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; " {{end}}