Skip to content

Commit

Permalink
a bit of cleanup/finesse
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Feb 28, 2024
1 parent f8a0434 commit 152d923
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ The _brilliant_ `consul-template` will be used as "glue" between `consul` and `c
## Setup and run
This will "bootstrap" your cluster with a private, unique `NOMAD_TOKEN`,
and `sudo podman run` a new container with the hind service into the background.
((source))[https://raw.githubusercontent.com/internetarchive/hind/podman/bin/install-hind.sh]
((source))[https://raw.githubusercontent.com/internetarchive/hind/main/install.sh]

```bash
curl -sS https://internetarchive.github.io/hind/bin/install-hind.sh | sudo sh
curl -sS https://internetarchive.github.io/hind/install.sh | sudo sh
```

## Minimal requirements:
Expand Down Expand Up @@ -104,9 +104,9 @@ nomad run https://internetarchive.github.io/hind/etc/hello-world.hcl
```

## Optional ways to extend your setup
Here are a few environment variables you can pass in to your intitial `install-hind.sh run` above, eg:
Here are a few environment variables you can pass in to your intitial `install.sh` run above, eg:
```sh
curl -sS https://internetarchive.github.io/hind/bin/install-hind.sh | sudo sh -s -- -e NFSHOME=1 -e REVERSE_PROXY=...
curl -sS https://internetarchive.github.io/hind/install.sh | sudo sh -s -- -e NFSHOME=1 -e REVERSE_PROXY=...
```

- `-e NFSHOME=1`
Expand Down Expand Up @@ -158,11 +158,11 @@ and run the shell commands below on your 2nd (or 3rd, etc.) VM.
```sh
FIRST=vm1.example.com
set -u
TOK_C=$(ssh $FIRST "sudo podman exec hindup zsh -c 'grep -E ^encrypt.= /etc/consul.d/consul.hcl'" |cut -f2- -d= |tr -d '\t "{}')
TOK_N=$(ssh $FIRST "sudo podman exec hindup zsh -c 'grep -E encrypt.= /etc/nomad.d/nomad.hcl'" |cut -f2- -d= |tr -d '\t "{}' )
TOK_C=$(ssh $FIRST "sudo podman exec hind zsh -c 'grep -E ^encrypt.= /etc/consul.d/consul.hcl'" |cut -f2- -d= |tr -d '\t "{}')
TOK_N=$(ssh $FIRST "sudo podman exec hind zsh -c 'grep -E encrypt.= /etc/nomad.d/nomad.hcl'" |cut -f2- -d= |tr -d '\t "{}' )


curl -sS https://internetarchive.github.io/hind/bin/install-hind.sh | \
curl -sS https://internetarchive.github.io/hind/install.sh | \
sudo sh -s -- -e FIRST=$FIRST -e TOK_C=$TOK_C -e TOK_N=$TOK_N
```

Expand All @@ -188,7 +188,7 @@ Here are a few helpful admin scripts we use at archive.org


## Problems?
- If the main `podman run` is not completing, check your `podman` version to see how recent it is. The `nomad` binary inside the setup container can segfault due to a perms change. You can either _upgrade your podman version_ or try adding this `install-hind.sh` CLI option:
- If the main `podman run` is not completing, check your `podman` version to see how recent it is. The `nomad` binary inside the setup container can segfault due to a perms change. You can either _upgrade your podman version_ or try adding this `install.sh` CLI option:
```sh
--security-opt seccomp=unconfined
```
2 changes: 1 addition & 1 deletion bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [ ! -e $CONFIG ]; then
# create a new docker image with the bootstrapped version of your cluster
./bin/spinner "Bootstrapping your hind cluster..." /app/bin/bootstrap.sh
./bin/spinner 'cleanly shutting down' /app/bin/shutdown.sh
./bin/spinner 'committing bootstrapped image' podman commit hind hind
./bin/spinner 'committing bootstrapped image' podman commit hind-init hind

else

Expand Down
6 changes: 3 additions & 3 deletions bin/install-hind.sh → install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export FQDN=$(hostname -f)
podman run --net=host --privileged --cgroupns=host \
-v /var/lib/containers:/var/lib/containers \
-e FIRST -e TOK_C -e TOK_N -e FQDN -e HOST_UNAME \
--rm --name hind --pull=always "$@" ghcr.io/internetarchive/hind:podman
--rm --name hind-init --pull=always "$@" ghcr.io/internetarchive/hind:podman
# xxx :main -- also change GH Pages to build from main branch when merge podman => main
)

Expand All @@ -26,7 +26,7 @@ if [ "$HOST_UNAME" = Darwin ]; then
-v /var/lib/containers:/var/lib/containers \
-v /opt/nomad/data/alloc:/opt/nomad/data/alloc \
-v /pv:/pv \
--restart=always --name hindup -d hind >/dev/null
--restart=always --name hind -d hind >/dev/null
)
else
(
Expand All @@ -36,7 +36,7 @@ else
-v /var/lib/containers:/var/lib/containers \
-v /opt/nomad/data/alloc:/opt/nomad/data/alloc \
-v /pv:/pv \
--restart=always --name hindup -d hind >/dev/null
--restart=always --name hind -d hind >/dev/null
)
fi

Expand Down

0 comments on commit 152d923

Please sign in to comment.