aboutsummaryrefslogtreecommitdiff
path: root/cmd/future-sight/manifest
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-06-16 09:24:19 -0400
committerXe Iaso <me@xeiaso.net>2024-06-16 09:24:33 -0400
commitf8357c132c7457c23ed8e5ce654f3cd48ef0550f (patch)
tree69740de47189b4aebe05f7161b36c7b35d338b78 /cmd/future-sight/manifest
parent58d56c8906241805d161cd1e45f86d20555839d2 (diff)
downloadx-f8357c132c7457c23ed8e5ce654f3cd48ef0550f.tar.xz
x-f8357c132c7457c23ed8e5ce654f3cd48ef0550f.zip
cmd/future-sight: move to kustomize
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/future-sight/manifest')
-rw-r--r--cmd/future-sight/manifest/dev/minio.yaml108
-rw-r--r--cmd/future-sight/manifest/kustomization.yaml8
-rw-r--r--cmd/future-sight/manifest/prod/1password.yaml9
-rw-r--r--cmd/future-sight/manifest/prod/deployment.yaml81
-rw-r--r--cmd/future-sight/manifest/prod/ingress.yaml26
-rw-r--r--cmd/future-sight/manifest/prod/kustomization.yaml11
-rw-r--r--cmd/future-sight/manifest/prod/namespace.yaml4
-rw-r--r--cmd/future-sight/manifest/prod/nats.yaml36
-rw-r--r--cmd/future-sight/manifest/prod/service.yaml20
-rw-r--r--cmd/future-sight/manifest/prod/valkey.yaml50
10 files changed, 353 insertions, 0 deletions
diff --git a/cmd/future-sight/manifest/dev/minio.yaml b/cmd/future-sight/manifest/dev/minio.yaml
new file mode 100644
index 0000000..7581f5a
--- /dev/null
+++ b/cmd/future-sight/manifest/dev/minio.yaml
@@ -0,0 +1,108 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: minio
+ namespace: future-sight
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 10Gi
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: minio
+ namespace: future-sight
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: minio
+ template:
+ metadata:
+ labels:
+ app: minio
+ spec:
+ volumes:
+ - name: data
+ persistentVolumeClaim:
+ claimName: minio
+ containers:
+ - name: minio
+ volumeMounts:
+ - name: data
+ mountPath: /data
+ image: minio/minio
+ args:
+ - server
+ - /data
+ - --console-address=:9001
+ env:
+ - name: MINIO_ACCESS_KEY
+ value: "minio"
+ - name: MINIO_SECRET_KEY
+ value: "minio123"
+ - name: MINIO_ROOT_USER
+ value: root
+ - name: MINIO_ROOT_PASSWORD
+ value: hunter22
+ ports:
+ - containerPort: 9000
+ name: http
+ - containerPort: 9001
+ name: webui
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: create-bucket
+ namespace: future-sight
+spec:
+ template:
+ spec:
+ containers:
+ - name: create-bucket
+ image: minio/mc
+ command: ["/bin/sh"]
+ args:
+ - "-c"
+ - |
+ /usr/bin/mc config host add k8s http://minio:9000 minio minio123;
+ /usr/bin/mc rm -r --force myminio/xesite-preview-versions;
+ /usr/bin/mc mb myminio/xesite-preview-versions;
+ /usr/bin/mc policy download myminio/xesite-preview-versions;
+ exit 0;
+ restartPolicy: Never
+ backoffLimit: 4
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: minio
+ namespace: future-sight
+spec:
+ type: ClusterIP
+ ports:
+ - name: http
+ port: 80
+ targetPort: 9000
+ protocol: TCP
+ selector:
+ app: minio
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: minio-webui
+ namespace: future-sight
+spec:
+ type: ClusterIP
+ ports:
+ - name: webui
+ port: 80
+ targetPort: 9001
+ protocol: TCP
+ selector:
+ app: minio \ No newline at end of file
diff --git a/cmd/future-sight/manifest/kustomization.yaml b/cmd/future-sight/manifest/kustomization.yaml
new file mode 100644
index 0000000..5d7ee96
--- /dev/null
+++ b/cmd/future-sight/manifest/kustomization.yaml
@@ -0,0 +1,8 @@
+resources:
+ - ./prod/namespace.yaml
+ - ./prod/nats.yaml
+ - ./prod/valkey.yaml
+ - ./dev/minio.yaml
+namespace: future-sight
+commonLabels:
+ app.kubernetes.io/name: future-sight
diff --git a/cmd/future-sight/manifest/prod/1password.yaml b/cmd/future-sight/manifest/prod/1password.yaml
new file mode 100644
index 0000000..393ecfa
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/1password.yaml
@@ -0,0 +1,9 @@
+apiVersion: onepassword.com/v1
+kind: OnePasswordItem
+metadata:
+ name: tigris-creds
+ namespace: future-sight
+ labels:
+ app.kubernetes.io/name: future-sight
+spec:
+ itemPath: "vaults/Kubernetes/items/Tigris creds" \ No newline at end of file
diff --git a/cmd/future-sight/manifest/prod/deployment.yaml b/cmd/future-sight/manifest/prod/deployment.yaml
new file mode 100644
index 0000000..1294c52
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/deployment.yaml
@@ -0,0 +1,81 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: future-sight
+ namespace: future-sight
+ labels:
+ app.kubernetes.io/name: future-sight
+data:
+ BUCKET_NAME: xesite-preview-versions
+ DATA_DIR: /cache
+ NATS_URL: nats://nats:4222
+ VALKEY_HOST: valkey:6379
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: future-sight
+ namespace: future-sight
+ labels:
+ app.kubernetes.io/name: future-sight
+ annotations:
+ operator.1password.io/auto-restart: "true"
+spec:
+ replicas: 3
+ selector:
+ matchLabels:
+ app.kubernetes.io/name: future-sight
+ template:
+ metadata:
+ namespace: future-sight
+ labels:
+ app.kubernetes.io/name: future-sight
+ spec:
+ volumes:
+ - name: tigris
+ secret:
+ secretName: tigris-creds
+ - name: cache
+ emptyDir: {}
+ securityContext:
+ fsGroup: 1000
+ containers:
+ - name: main
+ image: ghcr.io/xe/x/future-sight:latest
+ imagePullPolicy: Always
+ resources:
+ limits:
+ cpu: "250m"
+ memory: "512Mi"
+ requests:
+ cpu: "100m"
+ memory: "256Mi"
+ securityContext:
+ runAsUser: 1000
+ runAsGroup: 1000
+ runAsNonRoot: true
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ seccompProfile:
+ type: RuntimeDefault
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: 8080
+ httpHeaders:
+ - name: X-Kubernetes
+ value: "is kinda okay"
+ initialDelaySeconds: 3
+ periodSeconds: 3
+ volumeMounts:
+ - name: tigris
+ mountPath: /run/secrets/tigris
+ - name: cache
+ mountPath: /cache
+ envFrom:
+ - configMapRef:
+ name: valkey-secret
+ - configMapRef:
+ name: future-sight \ No newline at end of file
diff --git a/cmd/future-sight/manifest/prod/ingress.yaml b/cmd/future-sight/manifest/prod/ingress.yaml
new file mode 100644
index 0000000..5b31f35
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/ingress.yaml
@@ -0,0 +1,26 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: future-sight
+ namespace: future-sight
+ labels:
+ app.kubernetes.io/name: future-sight
+ annotations:
+ cert-manager.io/cluster-issuer: "letsencrypt-prod"
+spec:
+ ingressClassName: nginx
+ tls:
+ - hosts:
+ - preview.xeiaso.net
+ secretName: preview-xeiaso-net-tls
+ rules:
+ - host: preview.xeiaso.net
+ http:
+ paths:
+ - pathType: Prefix
+ path: "/"
+ backend:
+ service:
+ name: future-sight
+ port:
+ name: web \ No newline at end of file
diff --git a/cmd/future-sight/manifest/prod/kustomization.yaml b/cmd/future-sight/manifest/prod/kustomization.yaml
new file mode 100644
index 0000000..026e648
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/kustomization.yaml
@@ -0,0 +1,11 @@
+resources:
+ - namespace.yaml
+ - 1password.yaml
+ - deployment.yaml
+ - service.yaml
+ - ingress.yaml
+ - nats.yaml
+ - valkey.yaml
+namespace: future-sight
+commonLabels:
+ app.kubernetes.io/name: future-sight
diff --git a/cmd/future-sight/manifest/prod/namespace.yaml b/cmd/future-sight/manifest/prod/namespace.yaml
new file mode 100644
index 0000000..240ee6b
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/namespace.yaml
@@ -0,0 +1,4 @@
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: future-sight \ No newline at end of file
diff --git a/cmd/future-sight/manifest/prod/nats.yaml b/cmd/future-sight/manifest/prod/nats.yaml
new file mode 100644
index 0000000..93c3b4b
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/nats.yaml
@@ -0,0 +1,36 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: nats
+ namespace: future-sight
+ labels:
+ xeiaso.net/role: nats
+spec:
+ replicas: 1
+ strategy: {}
+ selector:
+ matchLabels:
+ xeiaso.net/role: nats
+ template:
+ metadata:
+ labels:
+ xeiaso.net/role: nats
+ spec:
+ containers:
+ - name: nats
+ image: nats:2-alpine
+ ports:
+ - containerPort: 4222
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: nats
+ namespace: future-sight
+ labels:
+ xeiaso.net/role: valkey
+spec:
+ selector:
+ xeiaso.net/role: nats
+ ports:
+ - port: 4222 \ No newline at end of file
diff --git a/cmd/future-sight/manifest/prod/service.yaml b/cmd/future-sight/manifest/prod/service.yaml
new file mode 100644
index 0000000..4c518ae
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/service.yaml
@@ -0,0 +1,20 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: future-sight
+ namespace: future-sight
+ labels:
+ app.kubernetes.io/name: future-sight
+spec:
+ selector:
+ app.kubernetes.io/name: future-sight
+ ports:
+ - protocol: TCP
+ port: 80
+ targetPort: 8081
+ name: web
+ - protocol: TCP
+ port: 8080
+ targetPort: 8080
+ name: api
+ type: ClusterIP \ No newline at end of file
diff --git a/cmd/future-sight/manifest/prod/valkey.yaml b/cmd/future-sight/manifest/prod/valkey.yaml
new file mode 100644
index 0000000..fda0872
--- /dev/null
+++ b/cmd/future-sight/manifest/prod/valkey.yaml
@@ -0,0 +1,50 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: valkey-secret
+ namespace: future-sight
+ labels:
+ xeiaso.net/role: valkey
+data:
+ VALKEY_PASSWORD: hunter2
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: valkey
+ namespace: future-sight
+ labels:
+ xeiaso.net/role: valkey
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ xeiaso.net/role: valkey
+ template:
+ metadata:
+ labels:
+ xeiaso.net/role: valkey
+ spec:
+ containers:
+ - name: valkey
+ image: 'docker.io/bitnami/valkey:latest'
+ imagePullPolicy: Always
+ ports:
+ - containerPort: 6379
+ envFrom:
+ - configMapRef:
+ name: valkey-secret
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: valkey
+ namespace: future-sight
+ labels:
+ xeiaso.net/role: valkey
+spec:
+ type: ClusterIP
+ ports:
+ - port: 6379
+ selector:
+ xeiaso.net/role: valkey \ No newline at end of file