docker-compose up --build
-
Install microk8s
-
Enable registry
microk8s enable registry
-
Do
multipass list
, and take note of themicrok8s-vm
IP -
Now we have to use the IP. In
/etc/hosts
file, add this entry:{IP} microk8s.multipass.org
-
Add
microk8s.multipass.org:32000
as insecure registry to your docker, following instructions given here -
Finally build your image and push like below:
docker build . -t microk8s.multipass.org:32000/ci-app:1.0.0 -t localhost:32000/ci-app:1.0.0 docker push microk8s.multipass.org:32000/ci-app:1.0.0
-
Apply the
kubernetes
namespace:microk8s kubectl apply -f k8s/namespace.yaml
-
Apply
deployment
andservice
:microk8s kubectl apply -f k8s
-
Now port forward the created service to test out:
microk8s kubectl port-forward service/ci-app 8080:80
; you can hitlocalhost:8080
to see the service