232 lines
No EOL
5.8 KiB
YAML
232 lines
No EOL
5.8 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-config-map
|
|
data:
|
|
APP_NAME: "${APP_APP_NAME}"
|
|
APP_ENV: "${APP_APP_ENV}"
|
|
APP_KEY: "${APP_APP_KEY}"
|
|
APP_DEBUG: "${APP_APP_DEBUG}"
|
|
APP_URL: "https://${APP_DOMAIN}"
|
|
ASSET_URL: "https://${APP_DOMAIN}"
|
|
LOG_CHANNEL: "k8s"
|
|
DB_HOST: "mariadb-service.common-services"
|
|
DB_DATABASE: "${APP_DB_DATABASE}"
|
|
DB_USERNAME: "${APP_DB_USERNAME}"
|
|
DB_PASSWORD: "${APP_DB_PASSWORD}"
|
|
QUEUE_CONNECTION: "${APP_QUEUE_CONNECTION}"
|
|
MAIL_HOST: "${APP_MAIL_HOST}"
|
|
MAIL_PORT: "${APP_MAIL_PORT}"
|
|
MAIL_USERNAME: "${APP_MAIL_USERNAME}"
|
|
MAIL_PASSWORD: "${APP_MAIL_PASSWORD}"
|
|
MAIL_ENCRYPTION: "${APP_MAIL_ENCRYPTION}"
|
|
MAIL_FROM_ADDRESS: "${APP_MAIL_FROM_ADDRESS}"
|
|
MAIL_FROM_NAME: "${APP_APP_NAME}"
|
|
SENTRY_LARAVEL_DSN: "${APP_SENTRY_LARAVEL_DSN}"
|
|
CRM_ENDPOINT: "${APP_CRM_ENDPOINT}"
|
|
CRM_TOKEN: "${APP_CRM_TOKEN}"
|
|
CRM_PASSWORD: "${APP_CRM_PASSWORD}"
|
|
MESBR_ENDPOINT: "${APP_MESBR_ENDPOINT}"
|
|
CODE_PAGINATE: "${APP_CODE_PAGINATE}"
|
|
CODE_CHAR_LIST: "${APP_CODE_CHAR_LIST}"
|
|
CODE_CHAR_LENGTH: "${APP_CODE_CHAR_LENGTH}"
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-pvc-storage
|
|
spec:
|
|
storageClassName: "csi-cinder-classic"
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: $APP_PVC_SIZE
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-deployment
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ggw-${CI_PROJECT_NAME}-app
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ggw-${CI_PROJECT_NAME}-app
|
|
spec:
|
|
containers:
|
|
- name: ggw-${CI_PROJECT_NAME}-container
|
|
image: $IMAGE_TAG
|
|
envFrom:
|
|
- configMapRef:
|
|
name: ggw-${CI_PROJECT_NAME}-config-map
|
|
volumeMounts:
|
|
- name: storage
|
|
mountPath: /app/srcs/storage
|
|
imagePullSecrets:
|
|
- name: docker-registry-credentials
|
|
securityContext:
|
|
runAsUser: 33
|
|
runAsGroup: 33
|
|
fsGroup: 33
|
|
fsGroupChangePolicy: "OnRootMismatch"
|
|
volumes:
|
|
- name: storage
|
|
persistentVolumeClaim:
|
|
claimName: ggw-${CI_PROJECT_NAME}-pvc-storage
|
|
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-service
|
|
spec:
|
|
selector:
|
|
app: ggw-${CI_PROJECT_NAME}-app
|
|
ports:
|
|
- port: 80
|
|
targetPort: 443
|
|
|
|
---
|
|
apiVersion: traefik.containo.us/v1alpha1
|
|
kind: IngressRoute
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-ingress-route
|
|
spec:
|
|
entryPoints:
|
|
- web
|
|
- websecure
|
|
routes:
|
|
- match: Host(`${APP_DOMAIN}`)
|
|
kind: Rule
|
|
services:
|
|
- name: ggw-${CI_PROJECT_NAME}-service
|
|
port: 80
|
|
tls:
|
|
secretName: $APP_DOMAIN
|
|
|
|
---
|
|
apiVersion: cert-manager.io/v1
|
|
kind: Certificate
|
|
metadata:
|
|
name: $APP_DOMAIN
|
|
spec:
|
|
dnsNames:
|
|
- $APP_DOMAIN
|
|
secretName: $APP_DOMAIN
|
|
issuerRef:
|
|
name: $APP_CERT_ISSUER
|
|
kind: ClusterIssuer
|
|
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-cronjob
|
|
spec:
|
|
schedule: "* * * * *"
|
|
jobTemplate:
|
|
spec:
|
|
template:
|
|
spec:
|
|
affinity:
|
|
podAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchExpressions:
|
|
- key: app
|
|
operator: In
|
|
values:
|
|
- ggw-${CI_PROJECT_NAME}-app
|
|
topologyKey: "kubernetes.io/hostname"
|
|
namespaces: [$KUBE_NAMESPACE]
|
|
containers:
|
|
- name: ggw-${CI_PROJECT_NAME}-scheduled
|
|
image: $IMAGE_TAG
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- "php"
|
|
args:
|
|
- "artisan"
|
|
- "schedule:run"
|
|
envFrom:
|
|
- configMapRef:
|
|
name: ggw-${CI_PROJECT_NAME}-config-map
|
|
volumeMounts:
|
|
- name: storage
|
|
mountPath: /app/srcs/storage
|
|
imagePullSecrets:
|
|
- name: docker-registry-credentials
|
|
volumes:
|
|
- name: storage
|
|
persistentVolumeClaim:
|
|
claimName: ggw-${CI_PROJECT_NAME}-pvc-storage
|
|
securityContext:
|
|
runAsUser: 33
|
|
runAsGroup: 33
|
|
fsGroup: 33
|
|
fsGroupChangePolicy: "OnRootMismatch"
|
|
restartPolicy: OnFailure
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ggw-${CI_PROJECT_NAME}-deployment-queue
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ggw-${CI_PROJECT_NAME}-app-queue
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ggw-${CI_PROJECT_NAME}-app-queue
|
|
spec:
|
|
affinity:
|
|
podAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchExpressions:
|
|
- key: app
|
|
operator: In
|
|
values:
|
|
- ggw-${CI_PROJECT_NAME}-app
|
|
topologyKey: "kubernetes.io/hostname"
|
|
namespaces: [$KUBE_NAMESPACE]
|
|
containers:
|
|
- name: ggw-${CI_PROJECT_NAME}-container-queue
|
|
image: "registry.s-web.fr/ldc-web/projets/op-insta:latest"
|
|
command:
|
|
- php
|
|
args:
|
|
- artisan
|
|
- queue:work
|
|
- --max-jobs=200
|
|
- --sleep=3
|
|
- --tries=3
|
|
imagePullPolicy: IfNotPresent
|
|
envFrom:
|
|
- configMapRef:
|
|
name: ggw-${CI_PROJECT_NAME}-config-map
|
|
volumeMounts:
|
|
- name: storage
|
|
mountPath: /app/srcs/storage
|
|
imagePullSecrets:
|
|
- name: docker-registry-credentials
|
|
volumes:
|
|
- name: storage
|
|
persistentVolumeClaim:
|
|
claimName: ggw-${CI_PROJECT_NAME}-pvc-storage
|
|
securityContext:
|
|
runAsUser: 33
|
|
runAsGroup: 33
|
|
fsGroup: 33
|
|
fsGroupChangePolicy: "OnRootMismatch" |