Added possibility deploy with k3s
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: application
|
||||
namespace: family-hub
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: application
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: application
|
||||
spec:
|
||||
containers:
|
||||
- name: application
|
||||
image: git.myhomecloud.tech/admin/familyhub:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: family-hub-config
|
||||
- secretRef:
|
||||
name: family-hub-secrets
|
||||
env:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: /secrets/credentials.json
|
||||
volumeMounts:
|
||||
- name: google-credentials
|
||||
mountPath: /secrets
|
||||
readOnly: true
|
||||
# livenessProbe:
|
||||
# httpGet:
|
||||
# path: /api/v1/health
|
||||
# port: 8000
|
||||
# initialDelaySeconds: 10
|
||||
# periodSeconds: 30
|
||||
# readinessProbe:
|
||||
# httpGet:
|
||||
# path: /api/v1/health
|
||||
# port: 8000
|
||||
# initialDelaySeconds: 5
|
||||
# periodSeconds: 10
|
||||
volumes:
|
||||
- name: google-credentials
|
||||
secret:
|
||||
secretName: google-credentials
|
||||
imagePullSecrets:
|
||||
- name: gitea-registry
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: application
|
||||
namespace: family-hub
|
||||
spec:
|
||||
selector:
|
||||
app: application
|
||||
ports:
|
||||
- port: 9876
|
||||
targetPort: 8000
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: family-hub-config
|
||||
namespace: family-hub
|
||||
data:
|
||||
DB_HOST: postgres
|
||||
DB_PORT: "5432"
|
||||
DB_NAME: familyHubDB
|
||||
DB_USER: familyUser
|
||||
API_PORT: "8000"
|
||||
API_HOST: 0.0.0.0
|
||||
RUN_MODE: standalone
|
||||
OPEN_API_ENABLED: "true"
|
||||
DEBUG_MODE: "false"
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: application
|
||||
namespace: family-hub
|
||||
annotations:
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: web
|
||||
spec:
|
||||
rules:
|
||||
- host: application.local
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: application
|
||||
port:
|
||||
number: 9876
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: family-hub
|
||||
@@ -0,0 +1,62 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: family-hub
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: git.myhomecloud.tech/admin/familyhub-postgres:latest
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
value: familyUser
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: family-hub-secrets
|
||||
key: DB_PASSWORD
|
||||
- name: POSTGRES_DB
|
||||
value: familyHubDB
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
imagePullSecrets:
|
||||
- name: gitea-registry
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: family-hub
|
||||
spec:
|
||||
selector:
|
||||
app: postgres
|
||||
ports:
|
||||
- port: 5432
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres-pvc
|
||||
namespace: family-hub
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
Reference in New Issue
Block a user