我想根据这个指南在kubernetes中安装nextcloud:https://www.codementor.io/@alicheaito/deploying-nextcloud-on-kubernetes-with-kustomize-tn78vcz0a
我不使用任何入口。为了进行测试,我在部署时使用了RunAsUser: 0,我知道这是不安全的,我将在生产中将其更改为端口8080和用户id 1099。当我调用页面时,我会看到这个屏幕:

我在日志里看不到任何可疑的东西:

我是kubernetes的新手,我不知道从哪里开始调试。
我的nextcloud deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
component: app
name: app
spec:
selector:
matchLabels:
component: app
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
component: app
spec:
securityContext:
fsGroup: 1099
runAsUser: 33
runAsGroup: 1099
containers:
- image: nextcloud:apache
imagePullPolicy: Always
name: app
ports:
- containerPort: 80
env:
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
key: MYSQL_DATABASE
name: db-secrets
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
key: MYSQL_PASSWORD
name: db-secrets
- name: MYSQL_USER
valueFrom:
secretKeyRef:
key: MYSQL_USER
name: db-secrets
volumeMounts:
- mountPath: /var/www/html
name: app-persistent-storage
- mountPath: /usr/local/etc/php/conf.d/
name: app-persistent-storage
restartPolicy: Always
volumes:
- name: app-persistent-storage
persistentVolumeClaim:
claimName: app-pvcnextcloud的service.yaml:
apiVersion: v1
kind: Service
metadata:
name: app
labels:
component: app
spec:
type: LoadBalancer
ports:
- port: 80
selector:
component: app来自服务和pods的截图:


这是nextcloud.log文件,其中有一些可疑的东西,但这对我没有帮助:
{"reqId":"4cSKDj718CckiPwauoRU","level":3,"time":"2020-05-28T11:00:55+00:00","remoteAddr":"10.20.0.8","user":"--","app":"base","method":"GET","url":"/","message":{"Exception":"Exception","Message":"Failed to start session","Code":0,"Trace":[{"file":"/var/www/html/lib/base.php","line":429,"function":"__construct","class":"OC\\Session\\Internal","type":"->","args":["oci0uf3awll8"]},{"file":"/var/www/html/lib/base.php","line":647,"function":"initSession","class":"OC","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1089,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/index.php","line":36,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Session/Internal.php","Line":65,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36","version":""}
{"reqId":"4cSKDj718CckiPwauoRU","level":3,"time":"2020-05-28T11:00:56+00:00","remoteAddr":"10.20.0.8","user":"--","app":"PHP","method":"GET","url":"/","message":"You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead. at /var/www/html/3rdparty/patchwork/utf8/src/Patchwork/Utf8/Bootup/intl.php#18","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36","version":""}发布于 2020-06-02 17:19:44
让我来解决你的问题中“我不知道从哪里开始调试”这一部分,因为我相信从长远来看,这将是对你最有益的方法。
有两个最常见的事情需要调试,这也适用于您的用例:
通过检查Debug Services:
<
Debug Running Pods解释了如何通过以下方式调试在节点上运行(或崩溃)的Pod:
使用具有短暂调试container
我还推荐阅读Troubleshoot Applications指南:
本指南旨在帮助用户调试部署到Kubernetes中且运行不正常的应用程序。
步骤和详细信息可以在链接的源代码中找到。
了解上面的方法将帮助您从Kubernetes端了解在哪里以及首先要检查什么。我希望你会发现它很有用。
https://stackoverflow.com/questions/62063279
复制相似问题