将 ArangoDB 部署到 MicroK8s 集群会导致:
$ kubectl logs -f dbgraph-64c6fd9b84-chqkm
automatically choosing storage engine
Initializing database...Hang on...
ArangoDB didn't start correctly during init
cat: can't open '/tmp/init-log': No such file or directory
部署声明是:
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
name: dbgraph
spec:
replicas: 1
selector:
matchLabels:
name: dbgraph
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
name: dbgraph
labels:
name: dbgraph
spec:
containers:
- env:
- name: ARANGO_NO_AUTH
value: "1"
image: arangodb:3.5
name: dbgraph
ports:
- containerPort: 8529
resources:
limits:
memory: "2Gi"
cpu: 0.5
volumeMounts:
- mountPath: /var/lib/arangodb3
name: dbdata-arangodb
restartPolicy: Always
volumes:
- name: dbdata-arangodb
persistentVolumeClaim:
claimName: dbdata-arangodb-pvc
status: {}
PersistentVolumeClaim 是:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
name: dbdata-arangodb-pvc
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}
并且 PersistentVolume 声明是:
apiVersion: v1
kind: PersistentVolume
metadata:
name: dbdata-arangodb-pv
labels:
type: local
spec:
storageClassName: ""
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/disk5/k8s-peristent-volumes/test/arangodb"
具有类似的Deployment-with-volume-declaration -> PVC -> PV关系适用于其他部署,例如 Minio。我也很幸运在 GKE 上为 ArangoDB 设置了类似的设置。
这可能是 ArangoDB 在 Kubernetes 版本中遇到的问题吗?
$ microk8s.kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-13T11:23:11Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-13T11:13:49Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
我确实尝试了ArangoDB Kubernetes Operator,但没有运气(但在 GKE 上很好)——在该项目的就绪状态表中,可以看出最多支持 Kubernetes 版本 1.14——所以这可能符合预期。
如何让 ArangoDB 在 MicroK8s 集群上运行?