nineskeletor/misc/k8s/kustomization/base/resources/app/app-deployment.yaml

91 lines
2.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
io.kompose.service: app
name: app
spec:
replicas: 3
selector:
matchLabels:
io.kompose.service: app
strategy:
type: Recreate
template:
metadata:
labels:
io.kompose.service: app
spec:
restartPolicy: Always
containers:
- image: reg.cadoles.com/afornerot/nineskeletor
imagePullPolicy: Always
name: app-php-fpm
args: ["/usr/sbin/php-fpm81", "-F", "-e"]
resources: {}
env:
- name: PHP_FPM_LISTEN
value: 127.0.0.1:9000
- name: PHP_MEMORY_LIMIT
value: 128m
- name: PHP_FPM_MEMORY_LIMIT
value: 128m
- name: PHP_FPM_LOG_LEVEL
value: warning
- name: POSTGRES_DATABASE_SERVICE_NAME
value: $(POSTGRES_DATABASE_SERVICE_NAME)-rw
- name: POSTGRES_DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: postgres-user
key: username
- name: POSTGRES_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: postgres-user
key: password
- name: DATABASE_URL
value: "postgresql://$(POSTGRES_DATABASE_USERNAME):$(POSTGRES_DATABASE_PASSWORD)@$(POSTGRES_DATABASE_SERVICE_NAME)-rw:5432/app"
- name: REDIS_HOST
value: rfs-$(REDIS_SERVICE_NAME)
- name: REDIS_PORT
value: "26379"
- name: MINIO_SERVICE_NAME
value: $(MINIO_SERVICE_NAME)
- name: MINIO_URL
value: "http://$(MINIO_SERVICE_NAME):9000"
- name: MINIO_KEY
valueFrom:
secretKeyRef:
name: minio-secret
key: minio-root-user
- name: MINIO_SECRET
valueFrom:
secretKeyRef:
name: minio-secret
key: minio-root-password
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "/app/bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration && /app/bin/console app:Init"]
- image: reg.cadoles.com/afornerot/nineskeletor
imagePullPolicy: Always
name: app-nginx
args: ["/usr/sbin/nginx"]
env:
- name: NGINX_APP_UPSTREAM_BACKEND_SERVER
value: 127.0.0.1:9000
- name: NGINX_APP_ROOT
value: "/public"
- name: NGINX_APP_PHP_INDEX
value: "/index.php"
- name: NGINX_ERROR_LOG_LEVEL
value: "warn"
- name: NGINX_APP_PHP_NON_FILE_PATTERN
value: "^/index\\.php(/|$)"
ports:
- containerPort: 8080
resources: {}