You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
c4k-website/src/main/resources/website/nginx-deployment.yaml

75 lines
2.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: NAME
labels:
app.kubernetes.part-of: NAME-website
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
namespace: NAME
labels:
app: nginx
app.kubernetes.part-of: NAME-website
spec:
containers:
- name: nginx
image: nginx:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
command: [ "/bin/bash", "-c", "nginx -g 'daemon off;'" ]
volumeMounts:
- mountPath: /etc/nginx
readOnly: true
name: etc-nginx
- mountPath: /tmp
name: tmp
- mountPath: /var/www/html/website
name: content-volume
readOnly: true
initContainers:
- image: domaindrivenarchitecture/c4k-website-build
name: init-build-container
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: BUILD_CPU_REQUEST
memory: BUILD_MEMORY_REQUEST
limits:
cpu: BUILD_CPU_LIMIT
memory: BUILD_MEMORY_LIMIT
command: ["/entrypoint.sh"]
envFrom:
- secretRef:
name: build-secret
volumeMounts:
- name: content-volume
mountPath: /var/www/html/website
- name: hash-state-volume
mountPath: /var/hashfile.d
volumes:
- name: etc-nginx
configMap:
name: etc-nginx
items:
- key: nginx.conf
path: nginx.conf
- key: website.conf
path: conf.d/website.conf
- key: mime.types
path: mime.types
- name: tmp
emptyDir: {}
- name: content-volume
persistentVolumeClaim:
claimName: content-volume
- name: hash-state-volume
persistentVolumeClaim:
claimName: hash-state-volume