infctl-cli/vagrant/dev/ubuntu/k8s/nginx-test/deployment.yaml

36 lines
945 B
YAML
Raw Normal View History

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:
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
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