Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit b874ae8

Browse files
Cecile Robert-Michonjackfrancis
Cecile Robert-Michon
authored andcommitted
Add member update after restarting etcd (#2118)
1 parent f7f155f commit b874ae8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

parts/k8s/kubernetesmastercustomdata.yml

+2
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ runcmd:
359359
- sudo /bin/chown etcd:etcd {{WrapAsVariable "etcdServerKeyFilepath"}}
360360
- sudo /bin/chown etcd:etcd {{WrapAsVerbatim "variables('etcdPeerKeyFilepath')[copyIndex(variables('masterOffset'))]"}}
361361
- systemctl restart etcd
362+
- MEMBER="$(sudo etcdctl member list | grep -E {{WrapAsVerbatim "variables('masterVMNames')[copyIndex(variables('masterOffset'))]"}} | cut -d{{WrapAsVariable "singleQuote"}}:{{WrapAsVariable "singleQuote"}} -f 1)"
363+
- sudo etcdctl member update ${MEMBER} {{WrapAsVerbatim "variables('masterEtcdPeerURLs')[copyIndex(variables('masterOffset'))]"}}
362364
- 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
363365
- retrycmd_if_failure apt-get update
364366
- retrycmd_if_failure apt-get install -y apt-transport-https ca-certificates

parts/k8s/kubernetesmastervars.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@
301301
"readerRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')]",
302302
"scope": "[resourceGroup().id]",
303303
"tenantId": "[subscription().tenantId]",
304+
"singleQuote": "'",
304305
"targetEnvironment": "[parameters('targetEnvironment')]",
305306
"dockerEngineDownloadRepo": "[parameters('dockerEngineDownloadRepo')]",
306307
"dockerEngineVersion": "[parameters('dockerEngineVersion')]"
@@ -335,6 +336,5 @@
335336
"agentWindowsOffer": "WindowsServerSemiAnnual",
336337
"agentWindowsSku": "Datacenter-Core-1709-with-Containers-smalldisk",
337338
"agentWindowsVersion": "[parameters('agentWindowsVersion')]",
338-
"singleQuote": "'",
339339
"windowsCustomScriptSuffix": " $inputFile = '%SYSTEMDRIVE%\\AzureData\\CustomData.bin' ; $outputFile = '%SYSTEMDRIVE%\\AzureData\\CustomDataSetupScript.ps1' ; Copy-Item $inputFile $outputFile ; Invoke-Expression('{0} {1}' -f $outputFile, $arguments) ; "
340340
{{end}}

0 commit comments

Comments
 (0)