简体   繁体   English

使用 Docker Kubernetes 集群获取 URL 并在没有 Minikube 集群的情况下访问正在运行的服务

[英]Get URL and access a running service without Minikube Cluster , using a Docker Kubernetes cluster

I'm running my Kubernetes Cluster using Docker and not using Minikube Cluster (requires a lot of memory) however after applying the required files, I can't get an external URL (like I used to have when I used Minikube) to run it in my Chrome browser.我正在运行我的Z30136395F018792198317C11831EA4Z群集,使用ZC5FD214CD0D2B3B4272E73B022BA5C2Z群集运行,但是在使用Minikube群集(需要大量的内存)333313333333333333333333133133133133333333333133133133333333333333333333333333333333333313313.66b i y633b i y633b i。在我的 Chrome 浏览器中。

Consider the followings:考虑以下几点:

The Pod:吊舱:

apiVersion: v1
kind: Pod
metadata:
  name: webapp-release-0-5
  labels:
    app: webapp
    release: "0-5"
spec:
  containers:
  - name: webapp
    image: richardchesterwood/k8s-fleetman-webapp-angular:release0-5

And its Service:及其服务:

apiVersion: v1
kind: Service
metadata:
  name: fleetman-webapp

spec:
  # This defines which pods are going to be represented by this Service
  # The service becomes a network endpoint for either other services
  # or maybe external users to connect to (eg browser)
  selector:
    app: webapp
    release: "0-5"

  ports:
    - name: http
      port: 80
      nodePort: 30080

  type: NodePort

After applying both from Command line (WINDOWS 10 CLI):从命令行(WINDOWS 10 CLI)应用两者后:

>>> kubectl get services
fleetman-webapp        NodePort    10.96.227.189    <none>        80:30080/TCP        5m57s

>>> kubectl get po

webapp                                   1/1     Running   0          12m
webapp-release-0-5                       1/1     Running   0          12m

However, I don't have an external URL of this POD to put in my browser to check out the App, like I used to have in Minikube.但是,我没有这个 POD 的外部 URL 可以放入我的浏览器以检查应用程序,就像我以前在 Minikube 中那样。

How can we generate such URL?我们如何生成这样的 URL?

It's particularly hard to make it work in a bespoke way.使其以定制的方式工作尤其困难。 I would suggest to use kind which creates kubernetes nodes as docker container.我建议使用创建 kubernetes 节点的kind作为 docker 容器。 You can access NodePort service via http://<NODEIP>:<NODEPORT> .您可以通过http://<NODEIP>:<NODEPORT>访问 NodePort 服务。 To get NODEIP use kubectl get nodes要获取NODEIP使用kubectl get nodes

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当 minikube 使用 DOCKER vm 驱动程序启动时,从 kubernetes 集群服务访问主机资源 - Access host resources from a kubernetes cluster service when minikube started with DOCKER vm driver 使用没有 minikube 的 docker 文件的 k8s 集群中的部署问题,但我的 pod 没有运行 - Deployment issue in k8s cluster using docker file without minikube, but my is pod not running 无法访问在 docker swarm 集群中运行的服务 - Unable to access service running in docker swarm cluster 如何使用 docker 桌面 k8s 集群在本地主机/本地机器上部署和访问负载均衡器 kube.netes 服务? - how to deploy and access loadbalancer kubernetes service on localhost/local machine using docker desktop k8s cluster? 在Kubernetes集群中使用Docker映像启动服务的最佳实践 - Best practice for starting a service using docker images in Kubernetes cluster Jenkins 构建 Docker 守护程序不在 kubernetes 集群上运行 - Jenkins build Docker daemon not running on kubernetes cluster 在AWS上使用Kubernetes创建和运行docker容器集群 - Creating and running docker containers cluster with Kubernetes on AWS 从 docker 容器内访问 Kubernetes 集群 - Access to a kubernetes cluster from inside a docker container 如何从本地机器访问 Docker Desktop - minikube 集群? - How to access Docker Desktop - minikube cluster from local machine? 如何在没有Kubernetes的情况下使用MQ创建Docker集群 - How to create a docker cluster with MQ without Kubernetes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM