- Change kind from DaemonSet to Deployment - Uncomment replicas setting to ensure proper scaling This change corrects the resource type for the application in the Kubernetes configuration, ensuring it is deployed as a Deployment instead of a DaemonSet. This allows for better management of replicas and scaling capabilities.
108 lines
2.8 KiB
YAML
108 lines
2.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
#kind: DaemonSet
|
|
metadata:
|
|
name: app
|
|
namespace: taw
|
|
labels:
|
|
app: taw
|
|
spec:
|
|
replicas: 1
|
|
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"
|
|
|
|
|
|
---
|
|
|