Project for the course on Fog and Cloud Computing
Name | Surname | Username | MAT |
---|---|---|---|
Carlo | Corradini | carlocorradini |
223811 |
Giovanni | Zotta | GiovanniZotta |
223898 |
When developing locally, you want to push images to the cluster as fast as possible.
Pushing to an in-cluster image registry skips a lot of overhead:
-
Unlike with a remote registry, the image stays local to your machine, with no network traffic
-
Unlike with
kind load
, docker will skip pushing any layers that already exist in the registry
This makes it a great solution for iterative local development. But setting it up is awkward and fiddly.
Kind must be installed
-
Create a cluster with
kind-with-registry.sh
It creates the registry at port 5000
$ k8s/kind-with-registry.sh
-
Teardown the cluster with
teardown-kind-with-registry.sh
$ k8s/teardown-kind-with-registry.sh
-
-
Push an image
# Build image $ docker build -f ./docker/Dockerfile.gateway -t gateway . # Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE $ docker tag gateway localhost:5000/gateway # Push the image to the local registry $ docker push localhost:5000/gateway
-
Use the image
You can now use the image name
localhost:5000/gateway
in any resources you deploy to the Kind cluster.
Build Docker images
$ ./docker/docker.sh
-
--push=<true|false>
Default: false
Push the images to the registry.
-
--push-prefix=
Default: localhost:5000/
Prefix for registry images.
Based on https://kind.sigs.k8s.io/docs/user/ingress/#ingress-nginx
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml
$ kubectl apply -f ./k8s/graphmarket.yml