655 lines
15 KiB
YAML
655 lines
15 KiB
YAML
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
kind: Kustomization
|
|
|
|
metadata:
|
|
name: bakery-ia-dev
|
|
|
|
namespace: bakery-ia
|
|
|
|
resources:
|
|
- ../../base
|
|
- dev-ingress.yaml
|
|
|
|
patches:
|
|
- path: dev-patches.yaml
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: auth-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: redis
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: rabbitmq
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "128Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "300m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: auth-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "128Mi"
|
|
cpu: "50m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: frontend
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/imagePullPolicy
|
|
value: Never
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "128Mi"
|
|
cpu: "100m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: gateway
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/imagePullPolicy
|
|
value: Never
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "128Mi"
|
|
cpu: "100m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: alert-processor-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
# Database patches
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: external-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: forecasting-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: inventory-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: notification-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: orders-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: pos-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: production-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: recipes-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: sales-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: suppliers-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: tenant-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: training-db
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
# Service patches
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: external-service
|
|
patch: |-
|
|
- op: add
|
|
path: /spec/template/spec/initContainers
|
|
value:
|
|
- name: wait-for-external-db
|
|
image: postgres:13-alpine
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
until pg_isready -h $EXTERNAL_DB_HOST -p $EXTERNAL_DB_PORT -U $EXTERNAL_DB_USER; do
|
|
echo "Waiting for external database..."
|
|
sleep 2
|
|
done
|
|
echo "External database is ready!"
|
|
env:
|
|
- name: EXTERNAL_DB_HOST
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: bakery-config
|
|
key: EXTERNAL_DB_HOST
|
|
- name: EXTERNAL_DB_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: bakery-config
|
|
key: DB_PORT
|
|
- name: EXTERNAL_DB_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: database-secrets
|
|
key: EXTERNAL_DB_USER
|
|
- name: PGPASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: database-secrets
|
|
key: EXTERNAL_DB_PASSWORD
|
|
- name: wait-for-rabbitmq
|
|
image: busybox:1.35
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
until nc -z $RABBITMQ_HOST $RABBITMQ_PORT; do
|
|
echo "Waiting for RabbitMQ..."
|
|
sleep 2
|
|
done
|
|
echo "RabbitMQ is ready!"
|
|
env:
|
|
- name: RABBITMQ_HOST
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: bakery-config
|
|
key: RABBITMQ_HOST
|
|
- name: RABBITMQ_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: bakery-config
|
|
key: RABBITMQ_PORT
|
|
- name: wait-for-redis
|
|
image: redis:7-alpine
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
until redis-cli -h $REDIS_HOST -p $REDIS_PORT ping; do
|
|
echo "Waiting for Redis..."
|
|
sleep 2
|
|
done
|
|
echo "Redis is ready!"
|
|
env:
|
|
- name: REDIS_HOST
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: bakery-config
|
|
key: REDIS_HOST
|
|
- name: REDIS_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: bakery-config
|
|
key: REDIS_PORT
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: forecasting-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: inventory-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: notification-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: orders-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: pos-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: production-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: recipes-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: sales-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: suppliers-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: tenant-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "64Mi"
|
|
cpu: "25m"
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "200m"
|
|
- target:
|
|
group: apps
|
|
version: v1
|
|
kind: Deployment
|
|
name: training-service
|
|
patch: |-
|
|
- op: replace
|
|
path: /spec/template/spec/containers/0/resources
|
|
value:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "500m"
|
|
|
|
configMapGenerator:
|
|
- name: bakery-dev-config
|
|
literals:
|
|
- ENVIRONMENT=development
|
|
- DEBUG=true
|
|
- LOG_LEVEL=DEBUG
|
|
- AUTO_RELOAD=true
|
|
- PROFILING_ENABLED=true
|
|
|
|
secretGenerator:
|
|
- name: dev-secrets
|
|
literals:
|
|
- DEV_MODE=true
|
|
|
|
labels:
|
|
- includeSelectors: true
|
|
pairs:
|
|
environment: development
|
|
tier: local
|
|
|
|
images:
|
|
- name: bakery/auth-service
|
|
newTag: dev
|
|
- name: bakery/tenant-service
|
|
newTag: dev
|
|
- name: bakery/training-service
|
|
newTag: dev
|
|
- name: bakery/forecasting-service
|
|
newTag: dev
|
|
- name: bakery/sales-service
|
|
newTag: dev
|
|
- name: bakery/external-service
|
|
newTag: dev
|
|
- name: bakery/notification-service
|
|
newTag: dev
|
|
- name: bakery/inventory-service
|
|
newTag: dev
|
|
- name: bakery/recipes-service
|
|
newTag: dev
|
|
- name: bakery/suppliers-service
|
|
newTag: dev
|
|
- name: bakery/pos-service
|
|
newTag: dev
|
|
- name: bakery/orders-service
|
|
newTag: dev
|
|
- name: bakery/production-service
|
|
newTag: dev
|
|
- name: bakery/alert-processor
|
|
newTag: dev
|
|
- name: bakery/gateway
|
|
newTag: dev
|
|
- name: bakery/dashboard
|
|
newTag: dev
|
|
|
|
replicas:
|
|
- name: auth-service
|
|
count: 1
|
|
- name: tenant-service
|
|
count: 1
|
|
- name: training-service
|
|
count: 1
|
|
- name: forecasting-service
|
|
count: 1
|
|
- name: sales-service
|
|
count: 1
|
|
- name: external-service
|
|
count: 1
|
|
- name: notification-service
|
|
count: 1
|
|
- name: inventory-service
|
|
count: 1
|
|
- name: recipes-service
|
|
count: 1
|
|
- name: suppliers-service
|
|
count: 1
|
|
- name: pos-service
|
|
count: 1
|
|
- name: orders-service
|
|
count: 1
|
|
- name: production-service
|
|
count: 1
|
|
- name: alert-processor-service
|
|
count: 1
|
|
- name: gateway
|
|
count: 1
|
|
- name: frontend
|
|
count: 1
|