kubernetes 运行服务和Pod后,应用程序未在浏览器上呈现

gmol1639  于 5个月前  发布在  Kubernetes
关注(0)|答案(1)|浏览(67)

面临的问题:当我尝试在下面的两个文件上运行kubectl apply命令,并尝试在http://192.168.49.2:30080/的浏览器中查看应用程序时,应用程序没有呈现。我尝试运行minikube服务fleetman - webapp --url,但仍然没有进展。请帮助!

其他信息:minikube ip -192.168.49.2 .
注意:我在mac book air Catalina 上安装了docker桌面应用。
**浏览器消息:**无法访问此网站192.168.49.2
Docker镜像链接https://hub.docker.com/r/richardchesterwood/k8s-fleetman-webapp-angular
first-pod.yaml文件

apiVersion: v1
kind: Pod
metadata:
 name: webapp
 labels : 
   mylabelname: webapp
spec:
 containers:
   - name: webapp
     image: richardchesterwood/k8s-fleetman-webapp-angular:release0

字符串

webapp-services.yaml文件

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:
     mylabelname: webapp

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

  type: NodePort

t3psigkw

t3psigkw1#

尝试使用驱动程序none创建minikube:

$ minikube start --driver=none

字符串
none驱动程序允许高级minikube用户跳过VM创建,允许minikube在用户提供的VM上运行。
因此,您将能够通过您的主机(即用户提供的VM)网络地址与您的应用程序进行通信。

相关问题