Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 55 additions & 53 deletions go/k8s/manifests/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,61 @@ metadata:
labels:
app: dashboard
spec:
replicas: 1
selector:
matchLabels:
app: dashboard
template:
metadata:
labels:
app: dashboard
spec:
initContainers:
- name: wait-for-dependencies
image: busybox:1.36
command:
- sh
- -c
- |
until nc -z planetscale 3900; do
echo waiting for planetscale
sleep 2
done
containers:
- name: dashboard
image: unkey/dashboard:latest
imagePullPolicy: Never
ports:
- containerPort: 3000
env:
# Database configuration
- name: DATABASE_HOST
value: "planetscale:3900"
# ClickHouse configuration
- name: CLICKHOUSE_URL
value: "http://unkey:password@clickhouse:8123"
# Environment
- name: NODE_ENV
value: "production"
# Instance identification
- name: UNKEY_PLATFORM
value: "kubernetes"
- name: UNKEY_REGION
value: "local"
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
replicas: 1
selector:
matchLabels:
app: dashboard
template:
metadata:
labels:
app: dashboard
spec:
initContainers:
- name: wait-for-dependencies
image: busybox:1.36
command:
- sh
- -c
- |
until nc -z planetscale 3900; do
echo waiting for planetscale
sleep 2
done
containers:
- name: dashboard
image: unkey/dashboard:latest
imagePullPolicy: Never
ports:
- containerPort: 3000
env:
# Database configuration
- name: DATABASE_HOST
value: "planetscale:3900"
# ClickHouse configuration
- name: CLICKHOUSE_URL
value: "http://unkey:password@clickhouse:8123"
# Environment
- name: NODE_ENV
value: "production"
# Instance identification
- name: UNKEY_PLATFORM
value: "kubernetes"
- name: UNKEY_REGION
value: "local"
- name: CTRL_URL
value: "http://ctrl:7091"
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 10

---
apiVersion: v1
Expand Down
3 changes: 3 additions & 0 deletions tools/local/src/cmd/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export async function bootstrapDashboard(resources: {
Clickhouse: {
CLICKHOUSE_URL: "http://default:password@localhost:8123",
},
ControlPlane: {
CTRL_URL: "http://localhost:7091",
},
});

if (fs.existsSync(envPath)) {
Expand Down