aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/namespaces/forms/forms-backend
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-04-15 11:42:30 +0100
committerGravatar Joe Banks <[email protected]>2024-04-15 11:42:30 +0100
commit275d697e01bb9b5f2b4189cd24cab4f0b498aa12 (patch)
tree80f40ece156624198f3ee473b995b0fe84704484 /kubernetes/namespaces/forms/forms-backend
parentMove services to tooling namespace (diff)
Move forms to new namespace
Diffstat (limited to 'kubernetes/namespaces/forms/forms-backend')
-rw-r--r--kubernetes/namespaces/forms/forms-backend/README.md20
-rw-r--r--kubernetes/namespaces/forms/forms-backend/ingress.yaml25
-rw-r--r--kubernetes/namespaces/forms/forms-backend/secrets.yamlbin0 -> 851 bytes
-rw-r--r--kubernetes/namespaces/forms/forms-backend/service.yaml12
4 files changed, 57 insertions, 0 deletions
diff --git a/kubernetes/namespaces/forms/forms-backend/README.md b/kubernetes/namespaces/forms/forms-backend/README.md
new file mode 100644
index 0000000..06fed13
--- /dev/null
+++ b/kubernetes/namespaces/forms/forms-backend/README.md
@@ -0,0 +1,20 @@
+# Forms Backend
+
+Forms backend is our surveyance system for putting out forms in our community.
+
+This directory contains the necessary routing manifests, the deployment is located in the [python-discord/forms-backend](https://github.com/python-discord/forms-backend) repository.
+
+This deployment expects a number of secrets and environment variables to exist in a secret called `forms-backend-env`.
+
+| Environment | Description |
+|----------------------|-----------------------------------------------------------------|
+| DATABASE_URL | A MongoDB database url |
+| DISCORD_BOT_TOKEN | The bot token to connect to Discord's API with |
+| DOCS_PASSWORD | The password required to access the auto-generated API docs |
+| HCAPTCHA_API_SECRET | The API key to HCAPTCHA's API |
+| OAUTH2_CLIENT_ID | The Discord app OAuth2 client id |
+| OAUTH2_CLIENT_SECRET | The Discord app OAuth2 client secret |
+| PRODUCTION | Whether the app is in production true/false |
+| SECRET_KEY | The key to sign all JWTs with |
+| SNEKBOX_URL | The URL to the senkbox service to use for code form submissions |
+| FORMS_BACKEND_DSN | The sentry DSN to send sentry events to |
diff --git a/kubernetes/namespaces/forms/forms-backend/ingress.yaml b/kubernetes/namespaces/forms/forms-backend/ingress.yaml
new file mode 100644
index 0000000..0fc9fb5
--- /dev/null
+++ b/kubernetes/namespaces/forms/forms-backend/ingress.yaml
@@ -0,0 +1,25 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ annotations:
+ nginx.ingress.kubernetes.io/auth-tls-verify-client: "on"
+ nginx.ingress.kubernetes.io/auth-tls-secret: "kube-system/mtls-client-crt-bundle"
+ nginx.ingress.kubernetes.io/auth-tls-error-page: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
+ name: forms-backend
+ namespace: forms
+spec:
+ tls:
+ - hosts:
+ - "*.pythondiscord.com"
+ secretName: pythondiscord.com-tls
+ rules:
+ - host: forms-api.pythondiscord.com
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: forms-backend
+ port:
+ number: 80
diff --git a/kubernetes/namespaces/forms/forms-backend/secrets.yaml b/kubernetes/namespaces/forms/forms-backend/secrets.yaml
new file mode 100644
index 0000000..da828d3
--- /dev/null
+++ b/kubernetes/namespaces/forms/forms-backend/secrets.yaml
Binary files differ
diff --git a/kubernetes/namespaces/forms/forms-backend/service.yaml b/kubernetes/namespaces/forms/forms-backend/service.yaml
new file mode 100644
index 0000000..7e8dd0c
--- /dev/null
+++ b/kubernetes/namespaces/forms/forms-backend/service.yaml
@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: forms-backend
+ namespace: forms
+spec:
+ selector:
+ app: forms-backend
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: 8000