Minikube网络 [英] Minikube networking

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

问题描述

我有一台Linux构建机器,我也已经安装了minikube.在minikube实例中,我安装了工件,该工件将用于存储各种构建工件

I have a Linux build machine that I have installed minikube too. Within the minikube instance I have installed artifactory which I will be using for storing various build artifacts

我现在希望能够在我的开发机(这是与Linux构建机位于同一网络上的不相关的便携式计算机)上进行一些工作,并将一些构建的工件推入工件中.

I now want to be able to do some work on my dev machine (which is an unrelated laptop on the same network as the Linux build machine) and push some built artifacts into artifactory.

但是我无法弄清楚如何使用人工制品.当我SSH到Linux服务器并检查minikube服务时,我可以看到工件实例正在192.168地址上运行.

However I can't figure out how to get to artifactory. When I ssh to the Linux server and check the minikube service I can see that the artifactory instance is running on a 192.168 address.

有什么方法可以暴露工件,即在Windows计算机上对其进行访问吗?或者这是不可能的,我应该只在Linux机器上而不是在minikube中安装工件?

Is there any way to expose artifactory ie access it on the windows machine? Or is this not possible and I should just install artifactory on the Linux machine rather than in minikube?

推荐答案

是的,我们需要一个入口控制器(例如nginx)来公开kubernetes服务以进行外部访问.

Yes, we need an ingress controller (like nginx) to expose a kubernetes service for external access.

每种 https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services--service-types 并将其公开以供外部访问:

There are three ways to create the nginx ingress service using kubernetes per https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types and expose it for external access:

  1. LoadBalancer服务类型,可自动设置ExternalIP.当存在外部非k8,云提供商的负载均衡器(例如CGE,AWS或Azure)并且此外部负载均衡器将为nginx入口服务提供ExternalIP时,将使用此功能.
  2. ExternalIPs每个 https://kubernetes.io/docs/concepts/services-networking/service/#external-ips .
  3. NodePort.通过这种方法,可以使用NodeIP:NodePort/url/of/the/service从群集外部访问服务.
  1. LoadBalancer service type which sets the ExternalIP automatically. This is used when there is an external non-k8s, cloud-provider's load-balancer like CGE, AWS or Azure, and this external load-balancer would provide the ExternalIP for the nginx ingress service.
  2. ExternalIPs per https://kubernetes.io/docs/concepts/services-networking/service/#external-ips.
  3. NodePort. In this approach, the service can be accessed from outside the cluster using NodeIP:NodePort/url/of/the/service.

与nginx入口控制器一起,您还将需要一个入口资源.请参考 https://github.com/nginxinc/kubernetes-ingress /tree/master/examples/complete-example 作为示例.

Along with the nginx ingress controller, you'll need an ingress resource too. Refer https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/complete-example for examples.

请记住,默认情况下,Minikube是具有小型Docker注册表的小型VM.因此,可能无法在Minikube中存储很多构建工件.

Keep in mind that Minikube is a small VM with a small docker registry by default. So, it may not be possible to store a lot of build artifacts in Minikube.

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

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