Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.82 KB

README.md

File metadata and controls

49 lines (35 loc) · 1.82 KB

Run helloworld Python service with nginx ingress controller

It is described here how to use kind clusters with local docker images.

Create a cluster and install nginx ingress controller:

./make_cluster.sh

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml

kubectl wait --namespace ingress-nginx \
  --for=condition=ready pod \
  --selector=app.kubernetes.io/component=controller \
  --timeout=120s

Check if the registry is available:

curl http://localhost:5000/v2/_catalog
{"repositories":[]}

Build custom helloworld docker image from one the previous examples and push it to the local registry:

docker build -t helloworld_py:v0 ../minikube_knative_helloworld_py
docker tag helloworld_py:v0 localhost:5000/helloworld_py:v0
docker push localhost:5000/helloworld_py:v0

Deploy s service:

kubectl apply -f service.yaml

It doesn't work. It can't start a pod because can't use the image. The pod finally falls to the CrashLoopBackOff state.

  ----     ------     ----                  ----                         -------
  Normal   Scheduled  2m38s                 default-scheduler            Successfully assigned default/helloworld-py to kind-control-plane
  Normal   Pulled     61s (x5 over 2m37s)   kubelet, kind-control-plane  Container image "localhost:5000/helloworld_py:v0" already present on machine
  Normal   Created    61s (x5 over 2m37s)   kubelet, kind-control-plane  Created container helloworld-py
  Normal   Started    61s (x5 over 2m37s)   kubelet, kind-control-plane  Started container helloworld-py
  Warning  BackOff    44s (x10 over 2m35s)  kubelet, kind-control-plane  Back-off restarting failed container