forked from username/flaskpaste
- change service type from ClusterIP to NodePort (30500) - enables HAProxy routing from mymx to k8s cluster
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: 192.168.122.154:30443/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: /
|
|
port: 5000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 30
|
|
timeoutSeconds: 5
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
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
|