apiVersion: apps/v1 kind: Deployment metadata: name: NAME-deployment namespace: webserver labels: app.kubernetes.part-of: NAME-website spec: replicas: 1 selector: matchLabels: app: NAME-nginx template: metadata: namespace: webserver labels: app: NAME-nginx spec: containers: - name: NAME-nginx image: nginx:latest imagePullPolicy: IfNotPresent ports: - containerPort: 80 volumeMounts: - mountPath: /etc/nginx readOnly: true name: etc-ngingx - mountPath: /var/log/nginx name: log - mountPath: /var/www/html/website name: content-volume readOnly: true initContainers: - image: domaindrivenarchitecture/c4k-website-build name: 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: NAME-secret volumeMounts: - name: content-volume mountPath: /var/www/html/website - name: hashfile-volume mountPath: /var/hashfile.d volumes: - name: etc-ngingx configMap: name: etc-ngingx items: - key: nginx.conf path: nginx.conf - key: website.conf path: conf.d/website.conf - key: mime.types path: mime.types - name: log emptyDir: {} - name: content-volume persistentVolumeClaim: claimName: NAME-content-volume - name: hashfile-volume persistentVolumeClaim: claimName: NAME-hashfile-volume