Kubernetes: required flag(s) "image" not set

7/27/2019

Kuberentes returns the following error:

fabiansc@Kubernetes-Master:~/Dokumente$ kubectl run -f open-project.yaml
Error: required flag(s) "image" not set

I want to create Open Project based on a Kubernetes On-Prem installation. There are references for docker; however I would like to use Kubernetes on top of it to get more familar with it. It's important to keep things working after a reboot of my host. Therefore I want to persistent the open project configuration. Docker references this by adding a volume (-v option):

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

My Kubernetes file looks like the following:

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

Error: required flag(s) "image" not set

-- Fabiansc
kubernetes
openproject

2 Answers

8/8/2019

the full docker path in your kubernetes manifest file should be docker.io/openproject/community

-- mayo
Source: StackOverflow

7/28/2019

The correct command is kubectl apply -f open-project.yaml

-- Fabiansc
Source: StackOverflow