All checks were successful
CI / Security Scan (push) Successful in 21s
CI / Lint & Format (push) Successful in 23s
CI / Advanced Security Tests (push) Successful in 16s
CI / Memory Leak Check (push) Successful in 20s
CI / Security Tests (push) Successful in 25s
CI / Unit Tests (push) Successful in 33s
CI / SBOM Generation (push) Successful in 21s
CI / Build & Push Image (push) Successful in 8s
- use harbor.mymx.me instead of old internal IP - fix liveness/readiness probes to use /health endpoint
134 lines
2.9 KiB
YAML
134 lines
2.9 KiB
YAML
# FlaskPaste Kubernetes Deployment
|
|
# Generated from Podman container configuration
|
|
#
|
|
# Apply: kubectl apply -f kubernetes.yaml
|
|
# Delete: kubectl delete -f kubernetes.yaml
|
|
---
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: flaskpaste
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: flaskpaste-config
|
|
namespace: flaskpaste
|
|
data:
|
|
FLASK_ENV: "production"
|
|
FLASKPASTE_URL_PREFIX: "/paste"
|
|
FLASKPASTE_EXPIRY_ANON: "432000"
|
|
FLASKPASTE_MAX_ANON: "3145728"
|
|
FLASKPASTE_MAX_AUTH: "52428800"
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: flaskpaste-data
|
|
namespace: flaskpaste
|
|
spec:
|
|
storageClassName: local-path
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: flaskpaste
|
|
namespace: flaskpaste
|
|
labels:
|
|
app: flaskpaste
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: flaskpaste
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: flaskpaste
|
|
spec:
|
|
securityContext:
|
|
runAsUser: 999
|
|
runAsGroup: 999
|
|
fsGroup: 999
|
|
imagePullSecrets:
|
|
- name: harbor-creds
|
|
containers:
|
|
- name: flaskpaste
|
|
image: harbor.mymx.me/library/flaskpaste:latest
|
|
ports:
|
|
- containerPort: 5000
|
|
protocol: TCP
|
|
envFrom:
|
|
- configMapRef:
|
|
name: flaskpaste-config
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /app/data
|
|
resources:
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "1000m"
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "250m"
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 5000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
timeoutSeconds: 5
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 5000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 3
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: flaskpaste-data
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: flaskpaste
|
|
namespace: flaskpaste
|
|
spec:
|
|
selector:
|
|
app: flaskpaste
|
|
ports:
|
|
- protocol: TCP
|
|
port: 80
|
|
targetPort: 5000
|
|
nodePort: 30500
|
|
type: NodePort
|
|
---
|
|
# Optional: Ingress for external access
|
|
# Uncomment and adjust for your ingress controller
|
|
# apiVersion: networking.k8s.io/v1
|
|
# kind: Ingress
|
|
# metadata:
|
|
# name: flaskpaste
|
|
# namespace: flaskpaste
|
|
# annotations:
|
|
# nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
|
# spec:
|
|
# rules:
|
|
# - host: paste.example.com
|
|
# http:
|
|
# paths:
|
|
# - path: /
|
|
# pathType: Prefix
|
|
# backend:
|
|
# service:
|
|
# name: flaskpaste
|
|
# port:
|
|
# number: 80
|