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

Commit

Permalink
Add more etcd setup visibility (#2214)
Browse files Browse the repository at this point in the history
* add etcd setup log to artifacts

* remove hiding useradd output

* show output of user add

* add check for etcd user
  • Loading branch information
Cecile Robert-Michon authored and jackfrancis committed Feb 7, 2018
1 parent 5268a10 commit a138e69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions parts/k8s/kubernetesmastercustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions parts/k8s/kubernetesmastercustomscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,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}"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/runner/cli_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a138e69

Please sign in to comment.