updates after learning things

add aws command which actually runs a nix flake.
update hostnames to be {s3,web}.strudelline.net.
tools command now can setup your garage alias.
This commit is contained in:
James Andariese 2025-04-10 23:50:51 -05:00
parent 5d917e1bc3
commit 95b17c7e63
4 changed files with 53 additions and 21 deletions

3
aws Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec nix --extra-experimental-features nix-command --extra-experimental-features flakes run nixpkgs#awscli2 -- "$@"

View File

@ -16,7 +16,7 @@ data:
s3_api.s3_region: "us-east-1"
s3_api.api_bind_addr: "[::]:3900"
s3_api.root_domain: ".strudelline.net"
s3_api.root_domain: ".s3.strudelline.net"
s3_web.bind_addr: "[::]:3902"
s3_web.root_domain: ".web.strudelline.net"

View File

@ -6,18 +6,15 @@ metadata:
namespace: garage
spec:
ingressClassName: haproxy
tls:
- secretName: wildcard-tls
hosts:
- s3.strudelline.net
- '*.s3.strudelline.net'
- web.strudelline.net
- '*.web.strudelline.net'
rules:
- host: 'strudelline.net'
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: garage
port:
name: s3-web
- host: '*.strudelline.net'
- host: 's3.strudelline.net'
http:
paths:
- path: /
@ -27,3 +24,33 @@ spec:
name: garage
port:
name: s3-api
- host: '*.s3.strudelline.net'
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: garage
port:
name: s3-api
- host: 'web.strudelline.net'
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: garage
port:
name: s3-web
- host: '*.web.strudelline.net'
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: garage
port:
name: s3-web

20
tools
View File

@ -70,7 +70,7 @@ generate_layout() {( # generates a sample layout, (args are included verbatim, e
$zero,
"garage", "layout", "assign",
"-t", .metadata.name,
"-c", "\(.metadata.labels["strudelline.net/garage-meta-free-bytes"]|tonumber/1024/1024/1024|floor)G"
"-c", "\((.metadata.labels["strudelline.net/garage-data-free-bytes"]//"10737418240")|tonumber/1024/1024/1024|floor)G"
]+$ARGS.positional
| @sh' --args -- "$@" "${gnid%%@*}" | while read -r cmd;do
eval "set $cmd"
@ -115,14 +115,16 @@ connect() { # attempt to connect all nodes
done
}
env() { # connect your local garage cli to a random node
jq -n -r \
--argjson secret "$(kubectl get secret -n "$GARAGE_NAMESPACE" garage-secrets -o json)" \
--arg gnid "$(get_ids | head -1)" \
'
rpc_secret=\($secret.data."rpc-secret")",
RPC_HOST=\($gnid)"
'
env() { # generate alias to use cluster garage cli.
case "$1" in
bash | sh | zsh | '' )
printf "\nalias garage=%q\n" "$(printf "%q garage" "$PWD/tools")"
;;
*)
1>&2 echo "unknown shell"
exit 1
;;
esac
}
help() {( # this help