在家中的Kong Ingress Controller [英] Kong Ingress Controller at Home

查看:177
本文介绍了在家中的Kong Ingress Controller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Kubernetes和入口控制器,但是当我尝试应用kong入口清单时,我一直卡在这个错误中...

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

是否可以在没有minikube的情况下在我的家庭服务器上运行此入口?如果是这样,怎么办?

注意:我有一个指向我的家庭服务器的FQDN.

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

推荐答案

我猜您是从 Github

豆荚问题

Issues with Pods

我转载了你的案子.由于具有3个吊舱,因此已在DB中使用了option. 如果您使用以下方式描述广告连播 $ kubectl describe pod <podname> -n kong 您将收到错误输出:

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)

您也可以在kong名称空间中检查job. 它可以在新的Minikube群集上正常工作,因此我想您可能会对存储类应用了相同的更改.

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.

是否可以在没有minikube的家庭服务器上运行此入口?如果是这样,怎么办?

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

您必须使用Kubernetes来做到这一点.由于Minikube支持LoadBalancer,因此您可以在Home中使用它. 您可以查看关于FQDN的此线程.如前所述:

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:

主机应能够解析该FQDN的名称.你 可能会在Mac主机的/etc/hosts中添加一条记录,以实现 那: 10.0.0.2 mydb.mytestdomain

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

但是在您的情况下,它应该是LoadBalancerkong-proxy的IP地址.

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

在Minikube中获得LoadBalancer IP

Obtain LoadBalancer IP in Minikube

如果您将正确部署所有内容,则可以检查服务. $ kubectl get svc -n kong 您将看到带有LoadBalancer类型wit <pending> EXTERNAL-IP的kong-proxy服务. 要获取ExternalIP,您必须使用 minikbue tunnel .

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.

请注意,您需要始终在一个控制台中运行$ sudo minikube tunnel.

在Minikube隧道之前

$ 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

之后

$ 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

此处您可以找到如何开始使用Kong的方法.它将向您展示如何创建Ingress.稍后,正如我提到的那样,您必须编辑ingress并添加类似 K8s文档.

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.

这篇关于在家中的Kong Ingress Controller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆