更新nginx yaml
This commit is contained in:
parent
fa6d686acf
commit
8662280849
@ -116,9 +116,13 @@ spec:
|
|||||||
image: $HARBOR_REGISTRY/test/nginx:$NGINX_IMAGE_TAG
|
image: $HARBOR_REGISTRY/test/nginx:$NGINX_IMAGE_TAG
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
|
|
||||||
|
# 添加明确的启动命令,确保使用正确的配置文件
|
||||||
|
command: ["/usr/local/nginx/sbin/nginx"]
|
||||||
|
args: ["-c", "/etc/nginx/nginx.conf", "-g", "daemon off;"]
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 8080 # 修改为与nginx.conf中一致的端口
|
containerPort: 8080
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|
||||||
# 环境变量
|
# 环境变量
|
||||||
@ -164,12 +168,10 @@ spec:
|
|||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
failureThreshold: 5
|
failureThreshold: 5
|
||||||
|
|
||||||
# 挂载配置文件
|
# 挂载配置文件 - 修改挂载方式
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nginx-config-volume
|
- name: nginx-config-volume
|
||||||
mountPath: /etc/nginx/nginx.conf
|
mountPath: /etc/nginx # 修改为目录挂载而非文件挂载
|
||||||
subPath: nginx.conf
|
|
||||||
readOnly: true
|
|
||||||
- name: nginx-cache
|
- name: nginx-cache
|
||||||
mountPath: /var/cache/nginx
|
mountPath: /var/cache/nginx
|
||||||
- name: nginx-run
|
- name: nginx-run
|
||||||
|
Loading…
x
Reference in New Issue
Block a user