diff options
| author | 2024-04-14 23:12:48 +0100 | |
|---|---|---|
| committer | 2024-04-14 23:12:48 +0100 | |
| commit | 85afb3b8ca98db360c863cc56af18c411c6489e2 (patch) | |
| tree | c5adcf0fe35eeebc1eaaf0a20c44656ed36b018b /kubernetes/namespaces/bots/bot | |
| parent | Configure Ansible for user authentication (#213) (diff) | |
Move all bots to designated namespaces
Diffstat (limited to 'kubernetes/namespaces/bots/bot')
| -rw-r--r-- | kubernetes/namespaces/bots/bot/README.md | 15 | ||||
| -rw-r--r-- | kubernetes/namespaces/bots/bot/configmap.yaml | 10 | ||||
| -rw-r--r-- | kubernetes/namespaces/bots/bot/deployment.yaml | 49 | ||||
| -rw-r--r-- | kubernetes/namespaces/bots/bot/secrets.yaml | bin | 0 -> 489 bytes | 
4 files changed, 74 insertions, 0 deletions
| diff --git a/kubernetes/namespaces/bots/bot/README.md b/kubernetes/namespaces/bots/bot/README.md new file mode 100644 index 0000000..565cf70 --- /dev/null +++ b/kubernetes/namespaces/bots/bot/README.md @@ -0,0 +1,15 @@ +## Bot + +Deployment file for @Python, our valiant community bot and workhorse. + +## Secrets +This deployment expects a number of secrets and environment variables to exist in a secret called `bot-env`. + +| Environment       | Description                                                 | +|-------------------|-------------------------------------------------------------| +| API_KEYS_GITHUB   | An API key for Github's API.                                | +| API_KEYS_SITE_API | The token to access our site's API.                         | +| BOT_SENTRY_DSN    | The sentry DSN to send sentry events to.                    | +| BOT_TOKEN         | The Discord bot token to run the bot on.                    | +| METABASE_PASSWORD | Password for Metabase                                       | +| METABASE_USERNAME | Username for Metabase                                       | diff --git a/kubernetes/namespaces/bots/bot/configmap.yaml b/kubernetes/namespaces/bots/bot/configmap.yaml new file mode 100644 index 0000000..8e04e35 --- /dev/null +++ b/kubernetes/namespaces/bots/bot/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: +  name: bot-config-env +  namespace: bots +data: +  BOT_TRACE_LOGGERS: bot.utils.scheduling.ModPingsOnOff,bot.exts.moderation.modpings,bot.exts.backend.sync._syncers +  DEBUG: 'False' +  DUCK_POND_EXTRA_CHANNEL_BLACKLIST: "[291284109232308226,463035241142026251,463035268514185226]"  # The 3 off-topic channels +  URLS_PASTE_URL: https://paste.pythondiscord.com diff --git a/kubernetes/namespaces/bots/bot/deployment.yaml b/kubernetes/namespaces/bots/bot/deployment.yaml new file mode 100644 index 0000000..033c2b9 --- /dev/null +++ b/kubernetes/namespaces/bots/bot/deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: bot +  namespace: bots +spec: +  replicas: 1 +  selector: +    matchLabels: +      app: bot +  template: +    metadata: +      labels: +        app: bot +    spec: +      securityContext: +        fsGroup: 2000 +        runAsUser: 1000 +        runAsNonRoot: true +      containers: +      - name: bot +        image: ghcr.io/python-discord/bot:latest +        imagePullPolicy: Always +        resources: +          requests: +            cpu: 750m +            memory: 600Mi +          limits: +            cpu: 1000m +            memory: 1400Mi +        envFrom: +        - secretRef: +            name: bot-env +        - secretRef: +            name: redis-credentials +        - configMapRef: +            name: bot-config-env +        volumeMounts: +        - mountPath: /bot/logs +          name: logs-vol +        - mountPath: /.cache/python-tldextract +          name: tldextract-cache +        securityContext: +          readOnlyRootFilesystem: true +      volumes: +      - name: logs-vol +        emptyDir: {} +      - name: tldextract-cache +        emptyDir: {} diff --git a/kubernetes/namespaces/bots/bot/secrets.yaml b/kubernetes/namespaces/bots/bot/secrets.yamlBinary files differ new file mode 100644 index 0000000..156c55a --- /dev/null +++ b/kubernetes/namespaces/bots/bot/secrets.yaml | 
