GoogleContainerTools / GoogleContainerTools/skaffold
Document how to load image to local cluster
- Dominant language
- Go
- Stars
- 15.9k
- Forks
- 1.7k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
## Background
- some local kubernetes clusters cannot access images on local docker deamon directly, if the clusters want to use those images, those images are needed to load to the clusters.
- Skaffold does images loading for some clusters under the hood, like `minikube`(by using the docker inside minikube), ``Kind``, ``K3D``, but Skaffold are not doing image loading work for other local clusters like micro8s
- If images built by local docker daemon are not loaded to local clusters, deployment phase will fail, normally the uses will see ``images cannot be pull error``
- As a workaround, skaffold users can config build hooks for their build to load images
- Note that the build hooks are able to access build output https://skaffold.dev/docs/pipeline-stages/lifecycle-hooks/#environment-variables
example config for the workaround
```yaml
apiVersion: skaffold/v4beta1
kind: Config
build:
artifacts:
- image: skaffold-example
hooks:
after:
- command:
- "bash"
- "-c"
- "xxx xxx xxx $SKAFFOLD_IMAGE"
```
- We should document this
Contributor guide
Assessment
This issue has not been assessed yet.