更新nginx yaml
Some checks failed
Build NGINX on Ubuntu / build-and-push (push) Successful in 1m1s
Build NGINX on Ubuntu / deploy-to-kubernetes (push) Has been cancelled

This commit is contained in:
huangzhiqiang 2025-06-09 18:34:13 +08:00
parent fa6d686acf
commit 8662280849

View File

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