diff --git a/apps/rustbin/deployment.yaml b/apps/rustbin/deployment.yaml new file mode 100644 index 0000000..4b22b0d --- /dev/null +++ b/apps/rustbin/deployment.yaml @@ -0,0 +1,60 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: rustbin + namespace: rustbin +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: rustbin + strategy: + type: Recreate + template: + metadata: + labels: + app.kubernetes.io/name: rustbin + spec: + containers: + - env: + - name: DATABASE_URL + value: sqlite:///data/rustbin.db?mode=rwc + image: ghcr.io/whyredfire/rustbin:sha-75418bf + livenessProbe: + httpGet: + path: / + port: http + name: rustbin + ports: + - containerPort: 3000 + name: http + readinessProbe: + httpGet: + path: / + port: http + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 10m + memory: 64Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + volumeMounts: + - mountPath: /data + name: data + securityContext: + fsGroup: 65532 + runAsGroup: 65532 + runAsNonRoot: true + runAsUser: 65532 + seccompProfile: + type: RuntimeDefault + volumes: + - name: data + persistentVolumeClaim: + claimName: rustbin-data diff --git a/apps/rustbin/httproute.yaml b/apps/rustbin/httproute.yaml new file mode 100644 index 0000000..371fe43 --- /dev/null +++ b/apps/rustbin/httproute.yaml @@ -0,0 +1,23 @@ +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + annotations: + argocd.argoproj.io/sync-wave: "2" + name: rustbin + namespace: rustbin +spec: + hostnames: + - bin.whyredfire.dev + parentRefs: + - kind: Gateway + name: traefik-gateway + namespace: traefik + sectionName: websecure + rules: + - backendRefs: + - name: rustbin + port: 3000 + matches: + - path: + type: PathPrefix + value: / diff --git a/apps/rustbin/kustomization.yaml b/apps/rustbin/kustomization.yaml new file mode 100644 index 0000000..e1e32aa --- /dev/null +++ b/apps/rustbin/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - pvc.yaml + - deployment.yaml + - service.yaml + - httproute.yaml diff --git a/apps/rustbin/pvc.yaml b/apps/rustbin/pvc.yaml new file mode 100644 index 0000000..21a7985 --- /dev/null +++ b/apps/rustbin/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: rustbin-data + namespace: rustbin +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/apps/rustbin/service.yaml b/apps/rustbin/service.yaml new file mode 100644 index 0000000..1bbc0b9 --- /dev/null +++ b/apps/rustbin/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: rustbin + namespace: rustbin +spec: + ports: + - name: http + port: 3000 + targetPort: http + selector: + app.kubernetes.io/name: rustbin diff --git a/argocd-apps/services/kustomization.yaml b/argocd-apps/services/kustomization.yaml index 18f3b8b..7ad6f7d 100644 --- a/argocd-apps/services/kustomization.yaml +++ b/argocd-apps/services/kustomization.yaml @@ -9,4 +9,5 @@ resources: - jellyfin.yaml - legislative-summarization.yaml - qbit.yaml + - rustbin.yaml - scriptscribe.yaml diff --git a/argocd-apps/services/rustbin.yaml b/argocd-apps/services/rustbin.yaml new file mode 100644 index 0000000..5e3a678 --- /dev/null +++ b/argocd-apps/services/rustbin.yaml @@ -0,0 +1,22 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + annotations: + argocd.argoproj.io/sync-wave: "3" + name: rustbin + namespace: argocd +spec: + destination: + namespace: rustbin + server: https://kubernetes.default.svc + project: default + source: + path: apps/rustbin + repoURL: https://gitea.whyredfire.dev/whyredfire/gitops.git + targetRevision: main + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true