Removed proxying from pip in Dockerfile, added K8S files
This commit is contained in:
18
k8s/data-loader-pod.yaml
Normal file
18
k8s/data-loader-pod.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: data-loader
|
||||
namespace: vorgabenui
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
containers:
|
||||
- name: loader
|
||||
image: alpine:3.20
|
||||
command: ["sh","-c","sleep 3600"]
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: django-data-pvc
|
||||
BIN
k8s/db/db.sqlite3
Normal file
BIN
k8s/db/db.sqlite3
Normal file
Binary file not shown.
61
k8s/deployment.yaml
Normal file
61
k8s/deployment.yaml
Normal file
@@ -0,0 +1,61 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: django
|
||||
namespace: vorgabenui
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: django
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: django
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 999
|
||||
fsGroupChangePolicy: "OnRootMismatch"
|
||||
containers:
|
||||
- name: web
|
||||
image: docker.io/adebaumann/vorgabenui_minimal:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /app/data
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 6
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8000
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 20
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 3
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: django-data-pvc
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: django
|
||||
namespace: vorgabenui
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: django
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
|
||||
19
k8s/ingress.yaml
Normal file
19
k8s/ingress.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: django
|
||||
namespace: vorgabenui
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
||||
spec:
|
||||
rules:
|
||||
- host: vorgabenui.local
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: django
|
||||
port:
|
||||
number: 8000
|
||||
18
k8s/ingressdebug.yaml
Normal file
18
k8s/ingressdebug.yaml
Normal file
@@ -0,0 +1,18 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: django
|
||||
namespace: vorgabenui
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: vorgabenui.local
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: django
|
||||
port:
|
||||
number: 8000
|
||||
12
k8s/pvc.yaml
Normal file
12
k8s/pvc.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: django-data-pvc
|
||||
namespace: vorgabenui
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
|
||||
Reference in New Issue
Block a user