2025-08-16 18:00:28 +01:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
|
|
|
|
name: nginx-with-storage
|
|
|
|
|
namespace: default
|
|
|
|
|
spec:
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: nginx-storage
|
|
|
|
|
replicas: 1
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
app: nginx-storage
|
|
|
|
|
spec:
|
2025-08-23 15:05:26 +01:00
|
|
|
|
|
|
|
|
initContainers:
|
|
|
|
|
- name: init-nginx-content
|
|
|
|
|
image: busybox
|
|
|
|
|
command: ["sh", "-c", "echo '<html><body><h1>Welcome to nginx!</h1><h2>using MVK</h2><p><a href=\"https://mvk.headshed.dev/\">https://mvk.headshed.dev/</a></p></body></html>' > /usr/share/nginx/html/index.html"]
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- name: nginx-data
|
|
|
|
|
mountPath: /usr/share/nginx/html
|
2025-08-16 18:00:28 +01:00
|
|
|
containers:
|
|
|
|
|
- name: nginx
|
|
|
|
|
image: nginx:stable
|
|
|
|
|
ports:
|
|
|
|
|
- containerPort: 80
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- name: nginx-data
|
|
|
|
|
mountPath: /usr/share/nginx/html
|
|
|
|
|
volumes:
|
|
|
|
|
- name: nginx-data
|
|
|
|
|
persistentVolumeClaim:
|
|
|
|
|
claimName: nginx-data-pvc
|