【发布时间】:2020-08-09 17:42:44
【问题描述】:
我正在使用 Kubernetes 和版本 3.16.1 的 docker 镜像 ghost 托管 Ghost 博客。上传主题时,我收到一条错误消息,指出文件过大。
您上传的文件大于服务器允许的最大文件大小。
我一直在远程访问 pod,以查看是否在其中找到任何可以配置但看不到任何设置的设置。看不到部署文件中要添加什么配置来增加默认值。
我有一个使用 Nginx 并指定“nginx.org/client-max-body-size”的 Ingress 控制器,但在我添加该控制器后没有帮助。
有人知道在使用 Ghost docker 映像和 nginx 入口控制器时如何增加最大文件大小吗?下面是入口控制器配置文件和部署文件的一部分。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: beitostolenlive-no-ingress
namespace: beitostolenlive-no
annotations:
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.org/proxy-connect-timeout: "30s"
nginx.org/proxy-read-timeout: "20s"
nginx.org/client-max-body-size: "50m"
这是部署配置文件。
apiVersion: apps/v1
kind: Deployment
metadata:
name: beitostolenlive-no
namespace: beitostolenlive-no
labels:
web: beitostolenlive-no
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
web: beitostolenlive-no
template:
metadata:
labels:
web: beitostolenlive-no
spec:
containers:
- name: beitostolenlive-no
image: ghost:3.16.1
imagePullPolicy: Always
ports:
- containerPort: 2368
env:
- name: url
value: https://beitostolenlive.no
- name: database__client
value: mysql
- name: database__connection__host
value: ***
- name: database__connection__user
value: ***
- name: database__connection__password
value: ***
- name: database__connection__database
value: ***
volumeMounts:
- mountPath: /var/lib/ghost/content
name: content
volumes:
- name: content
persistentVolumeClaim:
claimName: beitostolenlive-no-content
【问题讨论】:
-
你尝试添加 nginx.ingress.kubernetes.io/proxy-body-size 注解吗?
-
所以我将它作为解决方案发布,您可以接受并让其他社区更容易看到?
-
是的,如果您发布该解决方案,我会将其标记为已接受。 @MaggieO
标签: kubernetes ghost-blog