Skip to content

Instantly share code, notes, and snippets.

@crazytaxii
Created January 10, 2022 06:09
Show Gist options
  • Save crazytaxii/d460e3cfc4c46b7a8793e067eef09c24 to your computer and use it in GitHub Desktop.
Save crazytaxii/d460e3cfc4c46b7a8793e067eef09c24 to your computer and use it in GitHub Desktop.
Install etcd
#!/bin/bash
set -e
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}
main() {
os=linux
if [[ "$(uname -s)" == "Darwin" ]]; then
os=darwin
fi
arch=amd64
if [[ "$(uname -m)" == "aarch64" ]]; then
arch=arm64
fi
etcd_ver=$1
rm -f /tmp/etcd-${etcd_ver}-${os}-${arch}.tar.gz
rm -rf /tmp/etcd-download-test && mkdir -p /tmp/etcd-download-test
curl -L ${DOWNLOAD_URL}/${etcd_ver}/etcd-${etcd_ver}-${os}-${arch}.tar.gz -o /tmp/etcd-${etcd_ver}-${os}-${arch}.tar.gz
tar -xzvf /tmp/etcd-${etcd_ver}-${os}-${arch}.tar.gz -C /tmp/etcd-download-test --strip-components=1
mv /tmp/etcd-download-test/etcd /usr/local/bin/etcd && chmod +x /usr/local/bin/etcd
mv /tmp/etcd-download-test/etcdctl /usr/local/bin/etcdctl && chmod +x /usr/local/bin/etcdctl
rm -f /tmp/etcd-${etcd_ver}-${os}-${arch}.tar.gz
rm -rf /tmp/etcd-download-test
}
main "$@"
@crazytaxii
Copy link
Author

sh -c "$(curl -fssL https://gist.githubusercontent.com/crazytaxii/802a5dc93d6a0cc2cb606709b2ac0d16/raw/40febedde7c6f2a5d1e183f5ce08171524b5e747/kubeadm-prerequisites.sh)" v3.4.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment