manifests/today_ai_weather/load.yaml
songtianlun 4f06b0151e fix: increase replicas for load balancing
- Change the number of replicas from 1 to 3 in the
  deployment configuration.
- This adjustment aims to improve load balancing and
  availability of the application.

Increasing the replicas allows the application to handle
more traffic and provides redundancy in case of failures.
2025-04-23 20:53:28 +08:00

108 lines
2.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
#kind: DaemonSet
metadata:
name: app
namespace: taw
labels:
app: taw
spec:
replicas: 3
selector:
matchLabels:
app: taw
template:
metadata:
annotations: {}
labels:
app: taw
spec:
#nodeSelector:
# region: us
# dc: vkus
tolerations:
- key: "scheduling"
operator: "Equal"
value: "restricted"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- vkvm-us1
- vkvm-us2
- zgocloud-us1
containers:
- name: app
image: songtianlun/today_ai_weather:main
imagePullPolicy: Always
ports:
- containerPort: 3000
name: web
env:
- name: DATABASE_URL
value: "postgresql://postgres:JG5haZAVcqpkYQtW@pg.taw.svc.cluster.local:5432/taw"
#value: "postgresql://taw:BEhQkRSw3eGPti2c@8.134.120.243:5432/today_ai_weather"
#value: "postgresql://taw:BEhQkRSw3eGPti2c@172.26.12.25:5432/today_ai_weather"
- name: REDIS_URL
value: "redis://redis.taw.svc.cluster.local:6379/0"
- name: RAILS_ENV
value: "production"
- name: RAILS_LOG_LEVEL
value: "info"
- name: RAILS_MASTER_KEY
value: "a1f61bf46afa19f4ca54d99638f6e7ce"
- name: TZ
value: "Asia/Shanghai"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tasks
namespace: taw
labels:
app: tasks
spec:
replicas: 1
selector:
matchLabels:
app: tasks
template:
metadata:
annotations: {}
labels:
app: tasks
spec:
nodeSelector:
region: us
containers:
- name: tasks
image: songtianlun/today_ai_weather:main
imagePullPolicy: Always
command: ["bundle"]
args: ["exec", "sidekiq"]
env:
- name: DATABASE_URL
value: "postgresql://postgres:JG5haZAVcqpkYQtW@pg.taw.svc.cluster.local:5432/taw"
#value: "postgresql://taw:BEhQkRSw3eGPti2c@8.134.120.243:5432/today_ai_weather"
#value: "postgresql://taw:BEhQkRSw3eGPti2c@172.26.12.25:5432/today_ai_weather"
- name: REDIS_URL
value: "redis://redis.taw.svc.cluster.local:6379/0"
- name: RAILS_ENV
value: "production"
- name: RAILS_LOG_LEVEL
value: "info"
- name: RAILS_MASTER_KEY
value: "a1f61bf46afa19f4ca54d99638f6e7ce"
- name: TZ
value: "Asia/Shanghai"
---