Commit 33804872 authored by 智勇's avatar 智勇

rabbitmq固定hostname

parent dd10908d
...@@ -80,7 +80,7 @@ metadata: ...@@ -80,7 +80,7 @@ metadata:
spec: spec:
type: NodePort type: NodePort
ports: ports:
- name: '3306' - name: tcp-3306-3306
port: 3306 port: 3306
targetPort: 3306 targetPort: 3306
selector: selector:
......
...@@ -34,9 +34,11 @@ spec: ...@@ -34,9 +34,11 @@ spec:
labels: labels:
qcloud-app: {{app}} qcloud-app: {{app}}
spec: spec:
# hostname固定,容器重置后数据持久化才能正常
hostname: {{app}}-{{namespace}}
containers: containers:
- image: ccr.ccs.tencentyun.com/{{image}} - image: ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy: Always imagePullPolicy: IfNotPresent
name: {{app}} name: {{app}}
resources: resources:
requests: requests:
...@@ -45,14 +47,16 @@ spec: ...@@ -45,14 +47,16 @@ spec:
limits: limits:
memory: 500Mi memory: 500Mi
cpu: 500m cpu: 500m
volumeMounts:
- mountPath: "/var/lib/rabbitmq"
name: {{app}}
env: env:
- name: RABBITMQ_DEFAULT_USER - name: RABBITMQ_DEFAULT_USER
value: qa value: qa
- name: RABBITMQ_DEFAULT_PASS - name: RABBITMQ_DEFAULT_PASS
value: qatest value: qatest
# 数据持久化
volumeMounts:
- name: {{app}}
mountPath: "/var/lib/rabbitmq"
volumes: volumes:
- name: {{app}} - name: {{app}}
persistentVolumeClaim: persistentVolumeClaim:
...@@ -76,6 +80,8 @@ metadata: ...@@ -76,6 +80,8 @@ metadata:
namespace: {{namespace}} namespace: {{namespace}}
spec: spec:
type: NodePort type: NodePort
# 保留客户端源 IP 地址, 方便调试连接
externalTrafficPolicy: Local
ports: ports:
- name: tcp-5672-5672 - name: tcp-5672-5672
port: 5672 port: 5672
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment