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

Commit

Permalink
Merge branch 'feature/riaan' into 'master'
Browse files Browse the repository at this point in the history
update waypoint, boundary to work on arm64, update documentation and links

See merge request all-staff/hashiqube!106
  • Loading branch information
Riaan Nolan committed Jul 20, 2022
1 parent 098da37 commit 30ded50
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
* [Localstack](localstack/README.md)
* [Minikube](minikube/README.md)
* [Multi-cloud](multi-cloud/README.md)
* [Newrelic-kubernetes-monitoring](newrelic-kubernetes-monitoring/README.md)
14 changes: 12 additions & 2 deletions hashicorp/boundary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@ function boundary-install() {
sudo DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install curl unzip jq
yes | sudo docker system prune -a
yes | sudo docker system prune --volumes

arch=$(lscpu | grep "Architecture" | awk '{print $NF}')
if [[ $arch == x86_64* ]]; then
ARCH="amd64"
elif [[ $arch == aarch64 ]]; then
ARCH="arm64"
fi
echo -e '\e[38;5;198m'"CPU is $ARCH"

# check if waypoint is installed, start and exit
if [ -f /usr/local/bin/boundary ]; then
echo -e '\e[38;5;198m'"++++ Bundary already installed at /usr/local/bin/boundary"
echo -e '\e[38;5;198m'"++++ `/usr/local/bin/boundary version`"
else
# if boundary is not installed, download and install
echo -e '\e[38;5;198m'"++++ Boundary not installed, installing.."
LATEST_URL=$(curl -sL https://releases.hashicorp.com/boundary/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep 'linux.*amd64' | sort -V | tail -n 1)
LATEST_URL=$(curl -sL https://releases.hashicorp.com/boundary/index.json | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | egrep -v 'rc|beta' | egrep "linux.*$ARCH" | sort -V | tail -n 1)
wget -q $LATEST_URL -O /tmp/boundary.zip
mkdir -p /usr/local/bin
(cd /usr/local/bin && unzip /tmp/boundary.zip)
Expand All @@ -31,9 +40,10 @@ EOF
sleep 10
pkill boundary
nohup boundary dev -api-listen-address 0.0.0.0:19200 > /var/log/boundary.log 2>&1 &
sh -c 'sudo tail -f /var/log/boundary.log | { sed "/worker successfully authed/ q" && kill $$ ;}'
sh -c 'sudo tail -f /var/log/boundary.log | { sed "/Boundary server started/ q" && kill $$ ;}'
echo -e '\e[38;5;198m'"++++ Boundary Server started at https://localhost:19200"
echo -e '\e[38;5;198m'"++++ Login with admin:password"
echo -e '\e[38;5;198m'"++++ Boundary Documentation https://localhost:3333/#/hashicorp/README?id=boundary"
# TODO: read token and test login
# boundary authenticate password -login-name=admin -password password -auth-method-id=ampw_1234567890 -addr=https://127.0.0.1:19200
}
Expand Down
1 change: 1 addition & 0 deletions hashicorp/consul.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ EOF
host consul.service.consul

echo -e '\e[38;5;198m'"++++ Consul https://localhost:8500"
echo -e '\e[38;5;198m'"++++ Consul Documentation https://localhost:3333/#/hashicorp/README?id=consul"
}

consul-install
7 changes: 7 additions & 0 deletions hashicorp/nomad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ nomad plan --address=https://localhost:4646 traefik-whoami.nomad
nomad run --address=https://localhost:4646 traefik-whoami.nomad
# curl -v -H 'Host: fabio.service.consul' https://${VAGRANT_IP}:9999/
echo -e '\e[38;5;198m'"++++ Nomad https://localhost:4646"
echo -e '\e[38;5;198m'"++++ Nomad Documentation https://localhost:3333/#/hashicorp/README?id=nomad"
echo -e '\e[38;5;198m'"++++ Fabio Dashboard https://localhost:9998"
echo -e '\e[38;5;198m'"++++ Fabio Loadbalancer https://localhost:9998"
echo -e '\e[38;5;198m'"++++ Fabio Documentation https://localhost:3333/#/hashicorp/README?id=fabio-load-balancer-for-nomad"
echo -e '\e[38;5;198m'"++++ Treafik Dashboard https://localhost:8181"
echo -e '\e[38;5;198m'"++++ Traefik Loadbalancer: https://localhost:8080"
echo -e '\e[38;5;198m'"++++ Traefik Documentation: https://localhost:3333/#/hashicorp/README?id=traefik-load-balancer-for-nomad"
}

nomad-install
2 changes: 2 additions & 0 deletions hashicorp/vault.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ else
for i in `cat /etc/vault/init.file | grep Unseal | cut -d " " -f4 | head -n 3`; do vault operator unseal $i; done
vault status
cat /etc/vault/init.file
echo -e '\e[38;5;198m'"++++ Vault https://localhost:8200/ui and enter the Root Token displayed above"
echo -e '\e[38;5;198m'"++++ Vault Documentation https://localhost:3333/#/hashicorp/README?id=vault"
fi

# TODO: FIXME
Expand Down
3 changes: 2 additions & 1 deletion hashicorp/waypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function waypoint-all() {
if [[ $arch == x86_64* ]]; then
ARCH="amd64"
elif [[ $arch == aarch64 ]]; then
ARCH="arm64"
ARCH="arm"
fi
echo -e '\e[38;5;198m'"CPU is $ARCH"

Expand Down Expand Up @@ -217,6 +217,7 @@ EOF
sudo --preserve-env=PATH -u vagrant waypoint deploy
echo -e '\e[38;5;198m'"++++ Waypoint Server https://localhost:9702 and enter the following Token displayed below"
echo $WAYPOINT_TOKEN_NOMAD
echo -e '\e[38;5;198m'"++++ Waypoint Documentation https://localhost:3333/#/hashicorp/README?id=waypoint"
echo -e '\e[38;5;198m'"++++ Nomad https://localhost:4646"
}

Expand Down
4 changes: 3 additions & 1 deletion minikube/minikube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,12 @@ function minikube-install() {
echo -e '\e[38;5;198m'"++++ Docker stats"
sudo --preserve-env=PATH -u vagrant docker stats --no-stream -a

echo -e '\e[38;5;198m'"++++ Minikube dashboard: https://localhost:10888"
echo -e '\e[38;5;198m'"++++ Minikube Dashboard: https://localhost:10888"
echo -e '\e[38;5;198m'"++++ Minikube Documentation: https://localhost:3333/#/minikube/README"
echo -e '\e[38;5;198m'"++++ Hello Minikube application: https://localhost:18888"
echo -e '\e[38;5;198m'"++++ Traefik Dashboard: https://localhost:18181/dashboard/"
echo -e '\e[38;5;198m'"++++ Traefik Loadbalancer: https://localhost:18080"
echo -e '\e[38;5;198m'"++++ Traefik Documentation: https://localhost:3333/#/minikube/README?id=traefik-on-minikube"
}

minikube-install

0 comments on commit 30ded50

Please sign in to comment.