100 lines
2.5 KiB
YAML
100 lines
2.5 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Chart.Name }}-web
|
|
labels:
|
|
app: web
|
|
spec:
|
|
minReadySeconds: 5
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxSurge: 1
|
|
maxUnavailable: 1
|
|
replicas: {{ .Values.app.replicas.web }}
|
|
selector:
|
|
matchLabels:
|
|
service: {{ .Chart.Name }}-web
|
|
template:
|
|
metadata:
|
|
labels:
|
|
service: {{ .Chart.Name }}-web
|
|
annotations:
|
|
prometheus.io/scrape: 'true'
|
|
prometheus.io/port: '9253'
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: regsecret
|
|
containers:
|
|
- name: fpm
|
|
image: {{ .Values.app.image }}
|
|
command: ["/usr/local/sbin/php-fpm", "-c", "/usr/local/etc/php-fpm"]
|
|
ports:
|
|
- name: fpm
|
|
containerPort: 9000
|
|
env:
|
|
{{- include "envs_all" . | indent 12 }}
|
|
{{- include "app_resources" . | indent 10 }}
|
|
lifecycle:
|
|
preStop:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- '-c'
|
|
- sleep 5 && kill -SIGQUIT 1
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 9000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 9000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
- name: nginx
|
|
image: {{ .Values.app.image }}
|
|
command: ["/usr/sbin/nginx", "-g", "daemon off;"]
|
|
ports:
|
|
- name: http
|
|
containerPort: 80
|
|
env:
|
|
{{- include "envs_all" . | indent 12 }}
|
|
{{- include "nginx_resources" . | indent 10}}
|
|
lifecycle:
|
|
preStop:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- '-c'
|
|
- sleep 5 && /usr/sbin/nginx -s quit
|
|
volumeMounts:
|
|
- name: configs
|
|
mountPath: /etc/nginx/nginx.conf
|
|
subPath: nginx.conf
|
|
- name: phpfpm-exporter
|
|
image: cr.yandex/crpnn6fi85p3dauha6nc/php-fpm_exporter:latest
|
|
ports:
|
|
- containerPort: 9253
|
|
env:
|
|
- name: PHP_FPM_SCRAPE_URI
|
|
value: "tcp://127.0.0.1:9000/hrbox-fpm-status"
|
|
volumes:
|
|
- name: configs
|
|
configMap:
|
|
name: web-configuration
|
|
defaultMode: 420
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ .Chart.Name }}-web
|
|
spec:
|
|
selector:
|
|
service: {{ .Chart.Name }}-web
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP |