gpt4 book ai didi

nginx - 更改index.html nginx kubernetes部署

转载 作者:行者123 更新时间:2023-12-02 20:26:02 27 4
gpt4 key购买 nike

我有这样的部署:

enter image description here

我能够在我的一个 Pod 上编辑索引页面,但如何将其提交到部署镜像?因此,当我扩展应用程序时,所有新 Pod 都将具有相同的图像并编辑了索引。

最佳答案

这对我有用

apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: /usr/share/nginx/html/index.html
name: nginx-conf
subPath: index.html
volumes:
- name: nginx-conf
configMap:
name: nginx-index-html-configmap

和简单的配置映射:

data:
<html></html>

关于nginx - 更改index.html nginx kubernetes部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49904784/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com