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
5 changes: 5 additions & 0 deletions charts/keeptrack/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ kubectl create secret generic keeptrack-app \
--from-literal=tmdbapikey='***' \
--from-literal=rawgapikey='***' \
--from-literal=discogstoken='***' \
--from-literal=googlebooksApiKey='***' \
--namespace demo
```

Expand Down Expand Up @@ -90,6 +91,10 @@ webapi:
tokenSecretKeyRef:
name: keeptrack-app
key: discogstoken
googlebooks:
apiKeySecretKeyRef:
name: keeptrack-app
key: googlebooksApiKey

ingress:
enabled: true
Expand Down
4 changes: 2 additions & 2 deletions charts/keeptrack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name: keeptrack
description: Helm chart for Keeptrack
type: application
version: 0.2.2
appVersion: "2.1"
version: 0.2.3
appVersion: "2.3"
home: https://github.com/devpro/keeptrack
sources:
- https://github.com/devpro/keeptrack
Expand Down
10 changes: 10 additions & 0 deletions charts/keeptrack/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@ spec:
- name: Discogs__Token
value: {{ .referenceData.discogs.token | quote }}
{{- end }}
{{- if .referenceData.googlebooks.apiKeySecretKeyRef }}
- name: GoogleBooks__ApiKey
valueFrom:
secretKeyRef:
name: {{ .referenceData.googlebooks.apiKeySecretKeyRef.name }}
key: {{ .referenceData.googlebooks.apiKeySecretKeyRef.key }}
{{- else }}
- name: GoogleBooks__ApiKey
value: {{ .referenceData.googlebooks.apiKey | quote }}
{{- end }}
{{- end }}
restartPolicy: Always
{{- if $.Values.security.hardened.enabled }}
Expand Down
9 changes: 7 additions & 2 deletions charts/keeptrack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
healthEndpoint: /health
tls:
secretName: keeptrack-blazorapp-tls
tag: 2.1.29541631973 # ref. https://hub.docker.com/r/devprofr/keeptrack-blazorapp/tags
tag: 2.3.29668982088 # ref. https://hub.docker.com/r/devprofr/keeptrack-blazorapp/tags
replicaCount: 1
resources: {}
# limits:
Expand Down Expand Up @@ -54,7 +54,7 @@ webapi:
secretName: keeptrack-webapi-tls
host: ""
replicaCount: 1
tag: 2.1.29541631973 # ref. https://hub.docker.com/r/devprofr/keeptrack-webapi/tags
tag: 2.3.29668982088 # ref. https://hub.docker.com/r/devprofr/keeptrack-webapi/tags
resources: {}
extraEnv: []
additionalPodLabels: {}
Expand Down Expand Up @@ -91,6 +91,11 @@ webapi:
# name: ""
# key: ""
token: ""
googlebooks:
# apiKeySecretKeyRef:
# name: ""
# key: ""
apiKey: ""

dotnet:
environment: Production
Expand Down
9 changes: 9 additions & 0 deletions charts/liveship/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git/
.gitignore
.helmignore
*.orig
*.swp
*.bak
values.mine.yaml
temp*.yaml
kubeconfig
64 changes: 64 additions & 0 deletions charts/liveship/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Contribution guide

## Update chart dependencies

Add the Bitnami Helm repository:

```bash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
```

Look for existing versions:

```bash
helm search repo -l mongodb --versions
```

Manually edit `Chart.yaml` with the version.

Update `Chart.lock` and fetch the archive into `charts/` (gitignored, rebuilt from `Chart.lock` by anyone who needs it):

```bash
helm dependency update .
```

Note: Bitnami's index currently redirects some downloads to `oci://registry-1.docker.io/bitnamicharts`, which can fail with a 401 for older versions.
The same `mongodb-18.6.16.tgz` is used by the sidelab and keeptrack charts — copying it from a sibling `charts/` directory is a valid workaround as long as the version matches.

## Review the generated manifest

```bash
helm template liveship . -f values.yaml -f values.mine.yaml --namespace liveship --debug > temp.yaml
```

Useful sanity checks on the output: `helm template liveship .` with nothing set must fail fast asking for a database;
`--set mongodb.enabled=true` alone must fail asking for `mongodb.auth.rootPassword`;
`--set ingress.enabled=true` without a host, or an `auth.encryptionKey` that isn't 64 hex characters, must fail with a clear message rather than render something broken.

## Validate on a local cluster

The image is private on GHCR for now — create the pull secret first:

```bash
kubectl create secret docker-registry ghcr-pull -n liveship \
--docker-server=ghcr.io --docker-username=<github-user> --docker-password=<PAT-with-read:packages>
```

Then a minimal `values.mine.yaml` for a demo install:

```yaml
imagePullSecrets:
- name: ghcr-pull
mongodb:
enabled: true
auth:
rootPassword: "change-me"
```

```bash
helm upgrade --install liveship . -f values.mine.yaml --namespace liveship --create-namespace
```

Follow the printed NOTES.txt to seed the first admin user and port-forward to the app.
Verify login works end-to-end (that exercises MongoDB, `NEXTAUTH_SECRET`, and `NEXTAUTH_URL` at once), then create a connection and re-open it after `kubectl rollout restart` (that exercises `ENCRYPTION_KEY` stability).
6 changes: 6 additions & 0 deletions charts/liveship/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: mongodb
repository: https://charts.bitnami.com/bitnami
version: 18.6.16
digest: sha256:889cbf07e49e630d28dc8a1c72fdd0465f3f0f0c1601b3be559940108bb50ab2
generated: "2026-07-11T01:36:26.300038311+02:00"
25 changes: 25 additions & 0 deletions charts/liveship/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v2
name: liveship
description: >
One platform for an organization's infrastructure, security posture, and code.
Deploys the Liveship application, which reads the same MongoDB database terraform-backend-mongodb writes to.
type: application
version: 0.1.0
appVersion: "0.1.0"
keywords:
- liveship
- infrastructure
- kubernetes
- terraform
home: https://github.com/devpro/helm-charts
sources:
- https://github.com/devpro/liveship
dependencies:
- name: mongodb
version: 18.6.16 # MongoDB 8.2.6
repository: https://charts.bitnami.com/bitnami
alias: mongodb
condition: mongodb.enabled
maintainers:
- name: devpro
email: bertrand@devpro.fr
61 changes: 61 additions & 0 deletions charts/liveship/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Liveship Helm Chart

Helm chart for [Liveship](https://github.com/devpro/liveship) — one platform for an organization's infrastructure, security posture, and code.
Deploys the Liveship application (Next.js + MongoDB), which reads the same database [terraform-backend-mongodb](../terraform-backend-mongodb) writes to — point both charts at the same MongoDB to get the Terraform state views.

`values.yaml` is the source of truth for every option — it's fully commented.

## Quick Start

Add the chart repository:

```bash
helm repo add devpro https://devpro.github.io/helm-charts
helm repo update
```

Create a `values.yaml` file to override [default values](values.yaml).
Two things are always required:

- **Image pull credentials** — the `ghcr.io/devpro/liveship` image is private for now:

```bash
kubectl create secret docker-registry ghcr-pull -n liveship \
--docker-server=ghcr.io --docker-username=<github-user> --docker-password=<PAT-with-read:packages>
```

then set `imagePullSecrets: [{name: ghcr-pull}]`.
- **A MongoDB** — one of `database.uri`, `database.existingSecret`, or `mongodb.enabled=true` (bundled demo instance; also set `mongodb.auth.rootPassword`).
The chart fails fast at render time when none is set.

Install the application:

```bash
helm upgrade --install liveship devpro/liveship -f values.yaml --namespace liveship --create-namespace
```

`NEXTAUTH_SECRET` and `ENCRYPTION_KEY` are auto-generated on first install and kept stable across upgrades.
Under GitOps (ArgoCD/Flux), set `auth.existingSecret` instead — offline rendering would rotate them on every sync, and a rotated `ENCRYPTION_KEY` makes stored connection credentials permanently undecryptable (see `values.yaml`).

The first admin user is seeded with the `seed-admin.mjs` script from the liveship repo — `helm install` prints the exact commands (NOTES.txt).

## Scaling & high availability

The app is stateless and scales horizontally with no extra configuration: set `replicaCount` (or `autoscaling.enabled=true`), optionally with `podDisruptionBudget.enabled=true`.

What makes this safe (verified against the app's source):

- Sessions are stateless NextAuth JWT cookies — any replica can validate any user's cookie, since all replicas share the chart's single `NEXTAUTH_SECRET`.
No sticky sessions needed.
- All application state and every cache (Kubernetes resource-type discovery, git repository cache, login lockout counters) live in MongoDB, shared by all replicas.
- Stored credentials are encrypted with the shared `ENCRYPTION_KEY` env var — every replica can decrypt what any other stored.
- Nothing is written to the local filesystem, and there are no in-process background jobs to run twice.

## Uninstall

```bash
helm uninstall liveship -n liveship
kubectl delete namespace liveship
```

The auto-generated `<release>-auth` Secret is deleted along with the namespace — its `ENCRYPTION_KEY` is the only way to decrypt stored connection credentials, so back it up first if the database outlives the release.
2 changes: 2 additions & 0 deletions charts/liveship/ci/ci-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
database:
uri: mongodb://ci-dummy-mongo:27017
86 changes: 86 additions & 0 deletions charts/liveship/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
🎉 Liveship has been deployed!

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Application URL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{{- if .Values.ingress.enabled }}
{{ include "liveship.nextauthUrl" . }}
{{- if .Values.ingress.tls.enabled }}

The TLS certificate is issued automatically by cert-manager, if configured
via a cert-manager.io/cluster-issuer annotation. Allow 1-2 minutes for it
to become ready:

kubectl get certificate -n {{ .Release.Namespace }} -w
{{- end }}
{{- else }}
Port-forward to access the app locally:

kubectl port-forward -n {{ .Release.Namespace }} \
svc/{{ include "liveship.fullname" . }} 3000:{{ .Values.service.port }}

Then open: http://localhost:3000
(NEXTAUTH_URL defaults to exactly that, so login works out of the box —
see auth.url in values.yaml before putting this behind a real hostname.)
{{- end }}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
First login
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The app has no built-in signup — the first global_admin user is seeded
directly into MongoDB with the seed script from the liveship repo:

{{- if and .Values.mongodb.enabled (not .Values.database.uri) (not .Values.database.existingSecret) }}

kubectl port-forward -n {{ .Release.Namespace }} svc/{{ .Release.Name }}-mongodb 27017:27017

then, from a checkout of https://github.com/devpro/liveship:

MONGODB_URI='mongodb://root:<mongodb.auth.rootPassword>@localhost:27017/?authSource=admin' \
MONGODB_DB='{{ .Values.database.name }}' \
node scripts/seed-admin.mjs --username admin --password <choose-one>
{{- else }}

From a checkout of https://github.com/devpro/liveship, pointed at the
same MongoDB this release uses:

MONGODB_URI='<your database.uri>' MONGODB_DB='{{ .Values.database.name }}' \
node scripts/seed-admin.mjs --username admin --password <choose-one>

Not needed if terraform-backend-mongodb (or a previous install) already
seeded users into this database — they log straight in.
{{- end }}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Back up the encryption key
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
{{- if .Values.auth.existingSecret }}
Managed by you, in Secret/{{ .Values.auth.existingSecret }} (key ENCRYPTION_KEY).
{{- else }}
ENCRYPTION_KEY encrypts every stored connection credential (cloud keys,
cluster tokens, registry passwords). If the Secret is lost, that data is
permanently undecryptable. Save a copy somewhere safe:

kubectl get secret -n {{ .Release.Namespace }} {{ include "liveship.authSecretName" . }} \
-o jsonpath='{.data.ENCRYPTION_KEY}' | base64 -d; echo
{{- end }}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Database
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Database: {{ .Values.database.name }}
{{- if and .Values.mongodb.enabled (not .Values.database.uri) (not .Values.database.existingSecret) }}
Using the bundled MongoDB chart — fine for a demo, not backed up. Point
database.uri at a real MongoDB before you rely on this data.
{{- end }}
Terraform state views expect terraform-backend-mongodb writing to this
same database — point both charts at the same instance.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Useful commands
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Watch the app Pods
kubectl get pods -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }} -w

# Tail app logs
kubectl logs -n {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }} -f
Loading
Loading