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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ The chart is `deploy/helm/squirrelbot`. It runs one replica with the Recreate st

Supply secrets with `--set`, a private values file, or `existingSecret`. The secret keys are `DATABASE_URL`, `DISCORD_TOKEN`, `DISCORD_CLIENT_ID`, `DISCORD_CLIENT_SECRET`, and `SESSION_SECRET`.

`deploy/flux/squirrelbot-kustomization.yaml` is a Flux Kustomization for the published chart. It reconciles `deploy/flux/squirrelbot`. Create a Secret named `squirrelbot` in the `squirrelbot` namespace before the first reconcile, with those keys. Point `sourceRef` at your Flux GitRepository when it is not named `flux-system`. Pin `version` in the HelmRelease to stop automatic upgrades.

```sh
helm upgrade --install squirrelbot deploy/helm/squirrelbot \
--set publicUrl=https://mod.example.com \
Expand Down
17 changes: 17 additions & 0 deletions deploy/flux/squirrelbot-kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Flux Kustomization for the published SquirrelBot chart.
# Copy this into the cluster directory that Flux already reconciles, and point
# sourceRef at that GitRepository. The default name flux-system matches flux bootstrap.
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: squirrelbot
namespace: flux-system
spec:
interval: 10m
sourceRef:
kind: GitRepository
name: flux-system
path: ./deploy/flux/squirrelbot
prune: true
wait: true
timeout: 5m
6 changes: 6 additions & 0 deletions deploy/flux/squirrelbot/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- repository.yaml
- release.yaml
4 changes: 4 additions & 0 deletions deploy/flux/squirrelbot/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: squirrelbot
28 changes: 28 additions & 0 deletions deploy/flux/squirrelbot/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: squirrelbot
namespace: squirrelbot
spec:
interval: 10m
chart:
spec:
chart: squirrelbot
version: ">=0.1.0"
sourceRef:
kind: HelmRepository
name: squirrelbot
namespace: flux-system
interval: 10m
install:
remediation:
retries: 3
upgrade:
remediation:
retries: 3
values:
publicUrl: https://mod.example.com
existingSecret: squirrelbot
# A private image needs a pull secret in this namespace.
# imagePullSecrets:
# - name: ghcr
12 changes: 12 additions & 0 deletions deploy/flux/squirrelbot/repository.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: squirrelbot
namespace: flux-system
spec:
type: oci
interval: 30m
url: oci://ghcr.io/boxingoctopuscreative/charts
# A private chart needs a docker-registry Secret in flux-system.
# secretRef:
# name: ghcr
4 changes: 4 additions & 0 deletions deploy/helm/squirrelbot/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: {{ include "squirrelbot.fullname" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
runAsNonRoot: true
runAsUser: 65532
Expand Down
2 changes: 2 additions & 0 deletions deploy/helm/squirrelbot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ image:
tag: ""
pullPolicy: IfNotPresent

imagePullSecrets: []

# The Discord gateway allows one session per bot token. The Deployment
# hardcodes replicas to 1 and uses Recreate. Do not scale this chart.

Expand Down
Loading