0

I have made a minimal image of a fast-api program by building its Dockerfile. The imagename is task1. I'm trying to deploy it locally with minikube, kubectl by specifying a file named task1-deployment.yaml with the following structure:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: task1-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: task1
  template:
    metadata:
      labels:
        app: task1
    spec:
      containers:
        - name: task1
          image: task1:latest
          imagePullPolicy: Never
          ports:
            - containerPort: 8080

Whenever I run kubectl -f apply task1-deployment.yaml it shows a successful message, yet when running kubectl get deployment, task1 isn't ready and can't be accessed at localhost:8080.
The other official-pulled images work, what am I doing wrong?

Note: "imagePullPolicy" doesn't change anything

X HOxha
  • 143
  • 1
  • 2
  • 10

1 Answers1

2

Posting this as an answer instead of a comment:

Minikube can't get images from your machine's docker - you need to load it into the minikube cluster by running the following command:

$ minikube image load <image_name>
Leonardo Dagnino
  • 2,914
  • 7
  • 28