prom3theu5 / aspirational-manifests

Handle deployments of .NET Aspire AppHost Projects
MIT License
691 stars 36 forks source link

Can't load images in minikube after deploying with aspirate #135

Closed Hejle closed 8 months ago

Hejle commented 8 months ago

🔥 Bug Description

When running aspirate apply, it adds the images to the local Docker Desktop Images and creates everything "correctly" in minikube. However, it seems like Minikube can't reach the images in the local Docker Desktop Images. This is the error-message i get from minikube (seen through lens).

Error: ImagePullBackOff Failed to pull image "webfrontend:latest": Error response from daemon: pull access denied for webfrontend, repository does not exist or may require 'docker login': denied: requested access to the resource is denied Error: ImagePullBackOff Back-off pulling image "webfrontend:latest"

🔍 Steps to Reproduce the Bug

Setup minikube

  1. winget install minikube
  2. minikube start (this should use Docker Desktop as the driver)

    Setup Aspire Project

  3. dotnet new aspire-starter
  4. cd *.AppHost

    Generate

  5. aspirate generate
  6. Choose all Components
  7. Choose IfNotPresent as image pull policy
  8. Create Password and generate secrets
  9. Choose 'y' and generate kustomize manifest

    Apply

  10. aspirate apply
  11. insert password from step 8
  12. Choose yes to deploy the generated manifests to a kubernetes cluster defined in your kubeconfig file
  13. Select minikube as the kubernetes context

    Check status in k8

  14. Open Lens to check minikube.
  15. Check Events-tab to see error messages.

🧯 Possible Solution

I have used this to get my apps deployed. (https://github.com/kubernetes/minikube/issues/18021#issuecomment-1953589210)

docker image save -o image.tar my_image:tag minikube image load image.tar

prom3theu5 commented 8 months ago

The manual loading definitely should not be required as according to the minicube docs, it uses docker-env by default

https://minikube.sigs.k8s.io/docs/handbook/pushing/

Are you certain you used IfNotPresent? That's the error I would expect to see if it was set to Always

Can you also try Never?

prom3theu5 commented 8 months ago

You could try to run this before aspirate in the same terminal / PowerShell window

minikube docker-env | Invoke-Expression

Hejle commented 8 months ago

Thank you for the quick reply.

Setting it to Never instead of IfNotPresent, did not fix it.

However running minikube docker-env | Invoke-Expression did fix it. Now the images being built by aspirate generate is not added to my local Docker Desktop Images, but directly into minikubes docker instance.

Anyway it works for me and i can now continue playing around with kubernetes, aspire and aspirate. Thanks for the help, and thanks for the tool! :)

prom3theu5 commented 8 months ago

Yw 😃 thanks a lot Glad it's working for you!