From 661f49409e69f5cfafbef4cd41411a72ebc5418d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 13 Aug 2023 20:01:42 +0100 Subject: Copy all files from kubernetes repo into this one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit is a like-for-like copy of the [kubernetes repo](https://github.com/python-discord/kubernetes) check that repo for comit history prioir to this commit. Co-authored-by: Amrou Bellalouna Co-authored-by: Bradley Reynolds Co-authored-by: Chris Co-authored-by: Chris Lovering Co-authored-by: ChrisJL Co-authored-by: Den4200 Co-authored-by: GDWR Co-authored-by: Hassan Abouelela Co-authored-by: Hassan Abouelela Co-authored-by: jchristgit Co-authored-by: Joe Banks <20439493+jb3@users.noreply.github.com> Co-authored-by: Joe Banks Co-authored-by: Joe Banks Co-authored-by: Johannes Christ Co-authored-by: Kieran Siek Co-authored-by: kosayoda Co-authored-by: ks129 <45097959+ks129@users.noreply.github.com> Co-authored-by: Leon Sand├©y Co-authored-by: Leon Sand├©y Co-authored-by: MarkKoz Co-authored-by: Matteo Bertucci Co-authored-by: Sebastiaan Zeeff <33516116+SebastiaanZ@users.noreply.github.com> Co-authored-by: Sebastiaan Zeeff Co-authored-by: vcokltfre --- .../namespaces/default/forms/backend/README.md | 20 +++++++++++++++++ .../namespaces/default/forms/backend/ingress.yaml | 24 +++++++++++++++++++++ .../namespaces/default/forms/backend/secrets.yaml | Bin 0 -> 832 bytes .../namespaces/default/forms/backend/service.yaml | 11 ++++++++++ 4 files changed, 55 insertions(+) create mode 100644 kubernetes/namespaces/default/forms/backend/README.md create mode 100644 kubernetes/namespaces/default/forms/backend/ingress.yaml create mode 100644 kubernetes/namespaces/default/forms/backend/secrets.yaml create mode 100644 kubernetes/namespaces/default/forms/backend/service.yaml (limited to 'kubernetes/namespaces/default/forms/backend') diff --git a/kubernetes/namespaces/default/forms/backend/README.md b/kubernetes/namespaces/default/forms/backend/README.md new file mode 100644 index 0000000..06fed13 --- /dev/null +++ b/kubernetes/namespaces/default/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/default/forms/backend/ingress.yaml b/kubernetes/namespaces/default/forms/backend/ingress.yaml new file mode 100644 index 0000000..1967ab4 --- /dev/null +++ b/kubernetes/namespaces/default/forms/backend/ingress.yaml @@ -0,0 +1,24 @@ +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 +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/default/forms/backend/secrets.yaml b/kubernetes/namespaces/default/forms/backend/secrets.yaml new file mode 100644 index 0000000..8977e99 Binary files /dev/null and b/kubernetes/namespaces/default/forms/backend/secrets.yaml differ diff --git a/kubernetes/namespaces/default/forms/backend/service.yaml b/kubernetes/namespaces/default/forms/backend/service.yaml new file mode 100644 index 0000000..6e11796 --- /dev/null +++ b/kubernetes/namespaces/default/forms/backend/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: forms-backend +spec: + selector: + app: forms-backend + ports: + - protocol: TCP + port: 80 + targetPort: 8000 -- cgit v1.2.3