Kuberentes返回以下错误:
fabiansc@Kubernetes-Master:~/Dokumente$ kubectl run -f open-project.yaml
Error: required flag(s) "image" not set
我想基于Kubernetes On-Prem安装创建Open Project。有references for docker;但是我想在它之上使用Kubernetes来更熟悉它。重新启动主机后,保持一切正常运行很重要。因此,我要保留打开的项目配置。 Docker通过添加一个卷(-v选项)来引用它:
docker run -d -p 8080:80 --name openproject -e SECRET_KEY_BASE=secret \
-v /var/lib/openproject/pgdata:/var/openproject/pgdata \
-v /var/lib/openproject/static:/var/openproject/assets \
openproject/community:8
我的Kubernetes文件如下所示:
apiVersion: v1
kind: Pod
metadata:
name: open-project-pod
labels:
environment: production
spec:
containers:
- name: open-project-container
image: openproject/community:8
ports:
- name: open-project
containerPort: 80
protocol: TCP
volumeMounts:
- mountPath: "/var/openproject"
name: data
livenessProbe:
tcpSocket:
port: 80
initialDelaySeconds: 600
timeoutSeconds: 1
volumes:
- name: data
persistentVolumeClaim:
claimName: open-project-storage-claim
imagePullSecrets:
- name: regcred
错误:未设置必需的标志“图像”
答案 0 :(得分:0)
正确的命令是kubectl apply -f open-project.yaml
答案 1 :(得分:0)
您的kubernetes清单文件中的完整docker路径应为docker.io/openproject/community