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
17 changes: 10 additions & 7 deletions kubernetes/namespaces/modmail/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Modmail

This folder contains the manifests for our Modmail service.
This namespace runs our Modmail system.

## Secrets
| Component | Description |
| --------- | ----------- |
| Polonium (`polonium-api`, `polonium-bot`) | The current Modmail bot. Its manifests are not in this directory. |
| [`barium/`](./barium) | Read-only viewer for logs from the **legacy** Modmail bot, so old `modmail.pydis.wtf/logs/<key>` links keep working. |

The legacy Modmail bot and its web logviewer have been retired. Their logs were exported from MongoDB
and are now served statically by Barium.

The services require one shared secret called `modmail` containing the following:
## Secrets

| Key | Value | Description |
| ------------------------| ---------------------------------|--------------------------------------------------------------|
| `CONNECTION_URI` | MongoDB connection URI | Used for storing data |
| `TOKEN` | Discord Token | Used to connect to Discord |
The `modmail` secret is shared by the Polonium deployments.
8 changes: 8 additions & 0 deletions kubernetes/namespaces/modmail/barium/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Barium
Static viewer for logs from the legacy Modmail bot. Serves pre-rendered logs at `/logs/<key>`
(the original `modmail.pydis.wtf` URLs) and a SQLite index for client-side search.

The image (`ghcr.io/owl-corp/barium`) is private, as it contains the archived logs, and is built
locally from a Modmail export (see the [barium repo](https://github.com/owl-corp/barium)). It needs
no secrets, and is exposed on `modmail.pydis.wtf` through the `modmail-pydis-wtf` route in
`nginx-gateway/routes/service-routes/`.
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: modmail-web
name: barium
namespace: modmail
spec:
replicas: 1
selector:
matchLabels:
app: modmail-web
app: barium
template:
metadata:
labels:
app: modmail-web
app: barium
spec:
containers:
- name: modmail-web
image: ghcr.io/python-discord/logviewer:latest
- name: barium
image: ghcr.io/owl-corp/barium:latest
imagePullPolicy: Always
resources:
requests:
cpu: 50m
memory: 100Mi
memory: 64Mi
limits:
cpu: 100m
memory: 150Mi
cpu: 200m
memory: 128Mi
ports:
- containerPort: 8000
envFrom:
- secretRef:
name: modmail
- configMapRef:
name: modmail-config-env
volumeMounts:
- name: tmp
mountPath: /tmp
securityContext:
readOnlyRootFilesystem: true
volumes:
- name: tmp
emptyDir: {}
imagePullSecrets:
- name: ghcr-pull-secret
securityContext:
fsGroup: 2000
runAsUser: 1000
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: modmail-web
name: barium
namespace: modmail
spec:
selector:
app: modmail-web
app: barium
ports:
- protocol: TCP
port: 80
Expand Down
7 changes: 0 additions & 7 deletions kubernetes/namespaces/modmail/bot/README.md

This file was deleted.

51 changes: 0 additions & 51 deletions kubernetes/namespaces/modmail/bot/deployment.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions kubernetes/namespaces/modmail/configmap.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions kubernetes/namespaces/modmail/web/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
namespace: nginx-gateway
rules:
- backendRefs:
- name: modmail-web
- name: barium
namespace: modmail
port: 80
filters:
Expand Down
Loading