-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
81 lines (63 loc) · 2.74 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env -S just --justfile
# ^ A shebang isn't required, but allows a justfile to be executed
# like a script, with `./justfile test`, for example.
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
set dotenv-load := true
docker-stack-name := "wasmcloud-playground"
# Show available commands
default:
@just --list --justfile {{justfile()}}
# Start wasmCloud
up:
cd ./docker && docker compose up -d
# Start wasmCloud with OpenFGA
up-fga:
cd ./docker && docker compose -p {{ docker-stack-name }} -f compose.yaml -f compose.openfga.yaml up -d
# Restart the wasmCloud stack with OpenFGA
restart: down up
# Restart the wasmCloud stack
restart-fga: down up-fga
# Stop wasmCloud stack
down:
cd ./docker && docker compose -p {{ docker-stack-name }} down
# Run the wash (wasmCloud Shell) UI dashboard:
ui:
wash ui
# Test the Go component
test-go:
curl localhost:8062
# Test the Rust component
test-rust:
curl localhost:8061
create-cluster: init-local-cluster install-k8s-dash && view-k8s-dash
# Create local K8s cluster using kind
[private]
init-local-cluster: && install-prometheus-operator install-kind-registry
# Create local k8s cluster (based on kind)
kind create cluster --config deployment/k8s/kind-config.yaml
prometheus_operator_latest := `curl -s https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest | jq -cr .tag_name`
[private]
install-prometheus-operator:
# Install Prometheus Operator
curl -sL https://github.com/prometheus-operator/prometheus-operator/releases/download/{{prometheus_operator_latest}}/bundle.yaml | kubectl create -f -
# Wait for Kubernetes Operator to deploy
kubectl rollout status deployment prometheus-operator -n default --timeout=90s
[private]
install-kind-registry:
chmod +x ./deployment/kind-registry.sh && ./deployment/kind-registry.sh
# Install Kubectl Dashboard
[private]
install-k8s-dash:
helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
helm upgrade --install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard --create-namespace --namespace kubernetes-dashboard \
--set=extraArgs={--enable-skip-login} --wait
kubectl apply -k ./deployment/argocd/apps/kubernetes-dashboard/
kubectl-dashboard-default-port := "8443"
# Open Kubectl Dashboard
view-k8s-dash port=kubectl-dashboard-default-port:
#!/usr/bin/env bash
export POD_NAME=$(kubectl get pods -n kubernetes-dashboard -l "app.kubernetes.io/name=kubernetes-dashboard,app.kubernetes.io/instance=kubernetes-dashboard" \
-o jsonpath="{.items[0].metadata.name}")
kubectl -n kubernetes-dashboard port-forward $POD_NAME {{port}}:8443
port-forward-nats:
kubectl port-forward service/nats-cluster-headless 4222:4222 4223:4223