diff --git a/parts/k8s/kubernetesmastercustomdata.yml b/parts/k8s/kubernetesmastercustomdata.yml index 16cdaf0b7b..92d2aa6bfe 100644 --- a/parts/k8s/kubernetesmastercustomdata.yml +++ b/parts/k8s/kubernetesmastercustomdata.yml @@ -297,10 +297,10 @@ MASTER_ARTIFACTS_CONFIG_PLACEHOLDER DOWNLOAD_URL={{WrapAsVariable "etcdDownloadURLBase"}} retrycmd_if_failure 5 5 curl --retry 5 --retry-delay 10 --retry-max-time 30 -L ${DOWNLOAD_URL}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /usr/bin/ --strip-components=1 - useradd -U "etcd" > /dev/null 2>&1 - usermod -p "$(head -c 32 /dev/urandom | base64)" "etcd" > /dev/null 2>&1 - passwd -u "etcd" > /dev/null 2>&1 - systemctl daemon-reload + useradd -U "etcd" + usermod -p "$(head -c 32 /dev/urandom | base64)" "etcd" + passwd -u "etcd" + systemctl daemon-reload sudo sed -i "1iETCDCTL_ENDPOINTS=https://127.0.0.1:2379" /etc/environment sudo sed -i "1iETCDCTL_CA_FILE={{WrapAsVariable "etcdCaFilepath"}}" /etc/environment sudo sed -i "1iETCDCTL_KEY_FILE={{WrapAsVariable "etcdClientKeyFilepath"}}" /etc/environment diff --git a/parts/k8s/kubernetesmastercustomscript.sh b/parts/k8s/kubernetesmastercustomscript.sh index b9ec48e457..c3fb2fb504 100644 --- a/parts/k8s/kubernetesmastercustomscript.sh +++ b/parts/k8s/kubernetesmastercustomscript.sh @@ -78,6 +78,12 @@ if [[ ! -z "${MASTER_NODE}" ]]; then echo "executing master node provision operations" useradd -U "etcd" + id "etcd" + if [[ $? -eq 1 ]]; then + echo "failed to add user etcd" + else + echo "etcd user exists" + fi APISERVER_PRIVATE_KEY_PATH="/etc/kubernetes/certs/apiserver.key" touch "${APISERVER_PRIVATE_KEY_PATH}" diff --git a/test/e2e/runner/cli_provisioner.go b/test/e2e/runner/cli_provisioner.go index c05ca9ef5c..f093e44128 100644 --- a/test/e2e/runner/cli_provisioner.go +++ b/test/e2e/runner/cli_provisioner.go @@ -219,7 +219,7 @@ func (cli *CLIProvisioner) FetchProvisioningMetrics(path string, cfg *config.Con "/opt/m", "/opt/azure/containers/kubelet.sh", "/opt/azure/containers/provision.sh", "/opt/azure/provision-ps.log", "/var/log/azure/dnsdump.pcap"} masterFiles := agentFiles - masterFiles = append(masterFiles, "/opt/azure/containers/mountetcd.sh", "/opt/azure/containers/setup-etcd.sh") + masterFiles = append(masterFiles, "/opt/azure/containers/mountetcd.sh", "/opt/azure/containers/setup-etcd.sh", "/opt/azure/containers/setup-etcd.log") hostname := fmt.Sprintf("%s.%s.cloudapp.azure.com", cli.Config.Name, cli.Config.Location) conn, err := remote.NewConnection(hostname, "22", cli.Engine.ClusterDefinition.Properties.LinuxProfile.AdminUsername, cli.Config.GetSSHKeyPath()) if err != nil {