Add K8s deployment for OCI (aarch64) and make deploy/deploy-oci targets
- K8s manifests: namespace, PVC (local-path 2Gi), deployment, service, ingress - Ingress: repo-vis.oci.euphon.net with Let's Encrypt TLS via traefik - Cross-compile aarch64-unknown-linux-musl for OCI ARM64 host - make deploy: local Docker (x86_64) - make deploy-oci: SCP binary + web dist to OCI, native docker build, k3s import - Dockerfile accepts MUSL_TARGET build arg for multi-arch support
This commit is contained in:
35
k8s/deployment.yaml
Normal file
35
k8s/deployment.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: repo-vis
|
||||
namespace: repo-vis
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: repo-vis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: repo-vis
|
||||
spec:
|
||||
containers:
|
||||
- name: repo-vis
|
||||
image: repo-vis:latest
|
||||
imagePullPolicy: Never
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
env:
|
||||
- name: PORT
|
||||
value: "8080"
|
||||
- name: FRONTEND_DIR
|
||||
value: "./web/dist"
|
||||
- name: DATA_DIR
|
||||
value: "/data"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: repo-vis-data
|
||||
23
k8s/ingress.yaml
Normal file
23
k8s/ingress.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: repo-vis
|
||||
namespace: repo-vis
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.tls.certresolver: le
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
rules:
|
||||
- host: repo-vis.oci.euphon.net
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: repo-vis
|
||||
port:
|
||||
number: 80
|
||||
tls:
|
||||
- hosts:
|
||||
- repo-vis.oci.euphon.net
|
||||
4
k8s/namespace.yaml
Normal file
4
k8s/namespace.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: repo-vis
|
||||
11
k8s/pvc.yaml
Normal file
11
k8s/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: repo-vis-data
|
||||
namespace: repo-vis
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
11
k8s/service.yaml
Normal file
11
k8s/service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: repo-vis
|
||||
namespace: repo-vis
|
||||
spec:
|
||||
selector:
|
||||
app: repo-vis
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
||||
Reference in New Issue
Block a user