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

gmol1639  于 2024-01-06  发布在  Kubernetes
关注(0)|答案(1)|浏览(185)

面临的问题:当我尝试在下面的两个文件上运行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文件

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: webapp
  5. labels :
  6. mylabelname: webapp
  7. spec:
  8. containers:
  9. - name: webapp
  10. image: richardchesterwood/k8s-fleetman-webapp-angular:release0

字符串

webapp-services.yaml文件

  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: fleetman-webapp
  5. spec:
  6. # This defines which pods are going to be represented by this Service
  7. # The service becomes a network endpoint for either other services
  8. # or maybe external users to connect to (eg browser)
  9. selector:
  10. mylabelname: webapp
  11. ports:
  12. - name: http
  13. port: 80
  14. nodePort: 30080
  15. type: NodePort

t3psigkw

t3psigkw1#

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

  1. $ minikube start --driver=none

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

相关问题