Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
372 views
in Technique[技术] by (71.8m points)

kubernetes - Kong Ingress Controller at Home

I'm learning about Kubernetes and ingress controllers but I'm stucked getting this error when I try to apply kong ingress manifest...

ingress-kong-7dd57556c5-bh687   0/2     Init:0/1   0          29s
kong-migrations-gzlqj           0/1     Init:0/1   0          28s
postgres-0                      0/1     Pending    0          28s

Is it possible to run this ingress on my home server without minikube ? If so, how?

Note: I have a FQDN pointing to my home server.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I guess you run manifest from Github

Issues with Pods

I have reproduced your case. As you have 3 pods, you have used option with DB. If you will describe pods using $ kubectl describe pod <podname> -n kong you will receive error output:

Events:
  Type     Reason            Age               From               Message
  ----     ------            ----              ----               -------
  Warning  FailedScheduling  7s (x4 over 17s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims (repeated 2 times)

You can also check job in kong namespace. It is work correctly on fresh Minikube cluster, so I guess you might apply same changes to storageclass.

Is it possible to run this ingress on my home server without minikube ? If so, how?

You have to use Kubernetes to do it. Since Minikube is supporting LoadBalancer you can can use it in Home. You can check this thread about FQDN. As mentioned:

The host machine should be able to resolve the name of that FQDN. You might add a record into the /etc/hosts at the Mac host to achieve that: 10.0.0.2 mydb.mytestdomain

But in your case it should be IP address of LoadBalancer, kong-proxy.

Obtain LoadBalancer IP in Minikube

If you will deploy everything correctly you can check your services. $ kubectl get svc -n kong You will see kong-proxy service with LoadBalancer type wit <pending> EXTERNAL-IP. To obtain ExternalIP you have to use minikbue tunnel.

Please note that you need have $ sudo minikube tunnel run in one console whole time.

Before Minikube tunnel

$ kubectl get svc -n kong
NAME                      TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
kong-proxy                LoadBalancer   10.110.218.74    <pending>     80:31881/TCP,443:31319/TCP   103m
kong-validation-webhook   ClusterIP      10.108.204.137   <none>        443/TCP                      103m
postgres                  ClusterIP      10.105.9.54      <none>        5432/TCP                     103m

After

$ kubectl get svc -n kong
NAME                      TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)                      AGE
kong-proxy                LoadBalancer   10.110.218.74    10.110.218.74   80:31881/TCP,443:31319/TCP   104m
kong-validation-webhook   ClusterIP      10.108.204.137   <none>          443/TCP                      104m
postgres                  ClusterIP      10.105.9.54      <none>          5432/TCP                     104m

Testing Kong

Here you can find how to get start with Kong. It will show you how to create Ingress. Later as I mentioned you have to edit ingress and add rule (host) similar like in K8s docs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...