apiVersion: apps/v1 kind: Deployment metadata: name: {{ taskserv.name }} namespace: {{ taskserv.namespace }} labels: app.kubernetes.io/name: {{ taskserv.name }} app.kubernetes.io/managed-by: provisioning spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app.kubernetes.io/name: {{ taskserv.name }} template: metadata: labels: app.kubernetes.io/name: {{ taskserv.name }} app.kubernetes.io/managed-by: provisioning spec: securityContext: runAsNonRoot: true runAsUser: 101 runAsGroup: 101 fsGroup: 101 containers: - name: {{ taskserv.name }} image: {{ taskserv.image }}:{{ taskserv.image_tag }} ports: - name: http containerPort: {{ taskserv.http_port }} protocol: TCP volumeMounts: - name: nginx-conf mountPath: /etc/nginx/conf.d/default.conf subPath: nginx.conf readOnly: true - name: data mountPath: {{ taskserv.data_dir }} {% if taskserv.auth_paths | length > 0 %} - name: htpasswd mountPath: /etc/nginx/auth readOnly: true {% endif %} readinessProbe: httpGet: path: /_health port: {{ taskserv.http_port }} initialDelaySeconds: 5 periodSeconds: 10 failureThreshold: 6 livenessProbe: httpGet: path: /_health port: {{ taskserv.http_port }} initialDelaySeconds: 15 periodSeconds: 30 failureThreshold: 3 resources: requests: cpu: "10m" memory: "32Mi" limits: cpu: "200m" memory: "128Mi" terminationGracePeriodSeconds: 30 volumes: - name: nginx-conf configMap: name: {{ taskserv.name }}-nginx-conf items: - key: nginx.conf path: nginx.conf - name: data persistentVolumeClaim: claimName: {{ taskserv.name }}-data {% if taskserv.auth_paths | length > 0 %} - name: htpasswd secret: secretName: {{ taskserv.name }}-htpasswd {% endif %}