diff options
Diffstat (limited to 'kubernetes/namespaces/apis/patsy')
| -rw-r--r-- | kubernetes/namespaces/apis/patsy/README.md | 17 | ||||
| -rw-r--r-- | kubernetes/namespaces/apis/patsy/deployment.yaml | 41 | ||||
| -rw-r--r-- | kubernetes/namespaces/apis/patsy/secrets.yaml | bin | 0 -> 372 bytes | |||
| -rw-r--r-- | kubernetes/namespaces/apis/patsy/service.yaml | 12 | 
4 files changed, 70 insertions, 0 deletions
| diff --git a/kubernetes/namespaces/apis/patsy/README.md b/kubernetes/namespaces/apis/patsy/README.md new file mode 100644 index 0000000..78e386a --- /dev/null +++ b/kubernetes/namespaces/apis/patsy/README.md @@ -0,0 +1,17 @@ +# Patsy + +Patsy is the premiere project for data collection in the python-discord toolchain. It uses word-class technology in a system architected by our in-house engineers to facilitate the  automatic transfer, collection, and categorization of user data to develop user-centric solutions to real world problems. It is a marvel of engineering designed to push the limits of what we thought possible. + +The deployment for the [Patsy API](https://git.pydis.com/patsy), there is no ingress as Patsy is designed to only be accessible from within the cluster. + +This API is given help channel messages by the bot and stores them in postgres for after-the-fact processing. +The hope with this project is that we can inspect what topics get asked about often in help channels, along with which ones go un-answered the most. + +## Secret + +It requires a `patsy-env` secret with the following + +| Key            | Description                                                  | +| -------------- | ------------------------------------------------------------ | +| `DATABASE_URL` | An asyncpg connection string to the postgres database        | +| `STATE_SECRET` | A long random string, used to lock down endpoints with auth. | diff --git a/kubernetes/namespaces/apis/patsy/deployment.yaml b/kubernetes/namespaces/apis/patsy/deployment.yaml new file mode 100644 index 0000000..bb6f9a0 --- /dev/null +++ b/kubernetes/namespaces/apis/patsy/deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: patsy +  namespace: apis +spec: +  replicas: 0 +  selector: +    matchLabels: +      app: patsy +  template: +    metadata: +      labels: +        app: patsy +    spec: +      containers: +        - name: patsy +          image: ghcr.io/python-discord/patsy:latest +          imagePullPolicy: Always +          ports: +            - containerPort: 80 +              name: http +          envFrom: +            - secretRef: +                name: patsy-env +          startupProbe: +            httpGet: +              path: /ping +              port: http +              httpHeaders: +                - name: Host +                  value: patsy.pythondiscord.com +            failureThreshold: 3 +            periodSeconds: 1 +            initialDelaySeconds: 10 +          securityContext: +            readOnlyRootFilesystem: true +      securityContext: +        fsGroup: 2000 +        runAsUser: 1000 +        runAsNonRoot: true diff --git a/kubernetes/namespaces/apis/patsy/secrets.yaml b/kubernetes/namespaces/apis/patsy/secrets.yamlBinary files differ new file mode 100644 index 0000000..30d2641 --- /dev/null +++ b/kubernetes/namespaces/apis/patsy/secrets.yaml diff --git a/kubernetes/namespaces/apis/patsy/service.yaml b/kubernetes/namespaces/apis/patsy/service.yaml new file mode 100644 index 0000000..b3b2421 --- /dev/null +++ b/kubernetes/namespaces/apis/patsy/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: +  name: patsy +  namespace: apis +spec: +  selector: +    app: patsy +  ports: +    - protocol: TCP +      port: 80 +      targetPort: 80 | 
