my-homelab-configs/apps/website/web-app.yaml

77 lines
1.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: php-website-deployment
namespace: website-production
labels:
app: php-website
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
selector:
matchLabels:
app: php-website
template:
metadata:
labels:
app: php-website
spec:
nodeSelector:
kubernetes.io/hostname: raspberry
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution: # requiredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- php-website
topologyKey: "kubernetes.io/hostname"
containers:
- name: php-app
image: 192.168.100.68:30500/php-website:latest
imagePullPolicy: Always
ports:
- containerPort: 80
name: http
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 30
resources:
requests:
cpu: 25m
memory: 64Mi
limits:
memory: 256Mi
---
apiVersion: v1
kind: Service
metadata:
name: php-website-service
namespace: website-production
spec:
type: NodePort
externalTrafficPolicy: Local
ports:
- port: 80
targetPort: 80
nodePort: 30080
selector:
app: php-website