Homelab/kubernetes/apps/example-nginx/deployment.yaml
2025-11-07 09:33:38 +01:00

67 lines
1.2 KiB
YAML

---
# Example application deployment
# This demonstrates how FluxCD automatically deploys apps from Git
apiVersion: v1
kind: Namespace
metadata:
name: example-nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: example-nginx
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.25-alpine
ports:
- containerPort: 80
name: http
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 5
periodSeconds: 3
---
apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: example-nginx
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 80
name: http
type: ClusterIP