aboutsummaryrefslogtreecommitdiff
path: root/cmd/within.website/manifest.yaml
blob: e0e915fa037fdbc3fd34d4f0e2000595577e1690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: within-website
data:
  "config.ts": |   
    export interface Repo {
        kind: "gitea" | "github";
        domain: string;
        user: string;
        repo: string;
        description: string;
    }

    const githubRepo = (name: string, description: string): Repo => {
    return {
        kind: "github",
        domain: "github.com",
        user: "Xe",
        repo: name,
        description,
    };
    };

    const giteaRepo = (name: string, description: string): Repo => {
    return {
        kind: "gitea",
        domain: "tulpa.dev",
        user: "cadey",
        repo: name,
        description,
    };
    };

    const repos: Repo[] = [
    githubRepo("derpigo", "A Derpibooru/Furbooru API client in Go. This is used to monitor Derpibooru/Furbooru for images by artists I care about and archive them."),
    githubRepo("eclier", "A command router for Go programs that implements every command in Lua. This was an experiment for making extensible command-line applications with Lua for extending them."),
    githubRepo("gcss", "A CSS preprocessor for Go. This is a legacy Go package that I am bringing forward to modern Go standards."),
    giteaRepo("gopher", "A Gopher (RFC 1436) client/server stack for Go applications. This allows users to write custom Gopher clients and servers."),
    githubRepo("ln", "The natural log function for Go: an easy package for structured logging. This is the logging stack that I use for most of my personal projects."),
    githubRepo("x", "Various experimental things. /x/ is my monorepo of side projects, hobby programming, and other explorations of how programming in Go can be."),
    ];

    export default repos;
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: within-website
  labels:
    app.kubernetes.io/name: within-website
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: within-website
  template:
    metadata:
      labels:
        app.kubernetes.io/name: within-website
    spec:
      securityContext:
        fsGroup: 1000
      volumes:
        - name: tyson
          configMap:
            name: within-website
      containers:
        - name: main
          image: ghcr.io/xe/x/within-website:latest
          imagePullPolicy: "Always"
          resources:
            limits:
              cpu: "500m"
              memory: "256Mi"
            requests:
              cpu: "250m"
              memory: "128Mi"
          securityContext:
            runAsUser: 1000
            runAsGroup: 1000
            runAsNonRoot: true
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            seccompProfile:
              type: RuntimeDefault
          livenessProbe:
            httpGet:
              path: /
              port: 8080
              httpHeaders:
                - name: X-Kubernetes
                  value: "is kinda okay"
            initialDelaySeconds: 3
            periodSeconds: 3
          env:
            - name: TYSON_CONFIG
              value: "/etc/within.website/config.ts"
            - name: PORT
              value: "8080"
            - name: SLOG_LEVEL
              value: DEBUG
          volumeMounts:
            - name: tyson
              mountPath: /etc/within.website
              readOnly: true
---
apiVersion: v1
kind: Service
metadata:
  name: within-website
  labels:
    app.kubernetes.io/name: within-website
spec:
  selector:
    app.kubernetes.io/name: within-website
  ports:
    - port: 80
      targetPort: 8080
      name: http
  type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: within-website
  labels:
    app.kubernetes.io/name: within-website
  annotations:
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
  ingressClassName: nginx
  tls:
    - hosts:
      - within.website
      secretName: within-website-public-tls
  rules:
  - host: within.website
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            name: within-website
            port: 
              name: http