简体   繁体   English

无法使用kubernetes游乐场访问部署在kubernetes集群上的应用程序

[英]unable to access the application deployed on kubernetes cluster using kubernetes playground

I have a 3 node cluster created on kubernetes playground 我在kubernetes操场上创建了一个3节点集群

The 3 nodes as seen on the UI are : 在UI上看到的3个节点是:

192.168.0.13 : Master
192.168.0.12 : worker
192.168.0.11 : worker

I have a front end app connected to backend mysql. 我有一个连接后端MySQL的前端应用程序。

The deployment and service definition for front end is as below. 前端的部署和服务定义如下。

apiVersion: v1
kind: Service
metadata:
  name: springboot-app
spec:
  type: NodePort
  ports:
  - port: 8080
  selector:
    app: springboot-app
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: springboot-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: springboot-app
  template:
    metadata:
      labels:
        app: springboot-app
    spec:
      containers:
      - image: chinmayeepdas/springbootapp:1.0
        name: springboot-app
        env:
        - name: DATABASE_HOST
          value: demo-mysql
        - name: DATABASE_NAME
          value: chinmayee
        - name: DATABASE_USER
          value: root
        - name: DATABASE_PASSWORD
          value: root
        - name: DATABASE_PORT
          value: "3306"
        ports:
        - containerPort: 8080
          name: app-port

My PODs for UI and backend are up and running. 我的UI和后端POD已启动并正在运行。

[node1 ~]$ kubectl describe service springboot-app
Name:                     springboot-app
Namespace:                default
Labels:                   <none>
Annotations:              <none>
Selector:                 app=springboot-app
Type:                     NodePort
IP:                       10.96.187.226
Port:                     <unset>  8080/TCP
TargetPort:               8080/TCP
NodePort:                 <unset>  30373/TCP
Endpoints:                10.32.0.2:8080,10.32.0.3:8080,10.40.0.3:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

Now when i do, 现在当我这样做时

http://192.168.0.12:30373/employee/getAll http://192.168.0.12:30373/employee/getAll

I dont see any result. 我没有看到任何结果。 I get This site can't be reached 我知道无法访问此网站

What IP address i have to give in the URL? 我必须在URL中提供什么IP地址?

try this solution 试试这个解决方案

kubectl proxy --address 0.0.0.0

Then access it as http://localhost:30373/employee/getAll 然后以http:// localhost:30373 / employee / getAll的身份访问它

or maybe: 或者可能:

http://localhost:8080/employee/getAll HTTP://本地主机:8080 /员工/ GETALL

let me know if this fixes the access issue and which one works. 让我知道这是否解决了访问问题以及哪个可行。

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

相关问题 访问部署在 Kubernetes 上的应用程序 - Access application deployed on Kubernetes 无法访问 kubernetes 集群 - Unable to access kubernetes cluster 无法使用Azure CICD管道访问部署在Azure ACS Kubernetes群集中的应用程序 - Cannot access application deployed in Azure ACS Kubernetes Cluster using Azure CICD Pipeline 无法访问在Kubernetes集群上部署的应用 - Not able to access app deployed on kubernetes cluster 在 Bigip 面前暴露部署在 kubernetes 集群上的应用程序 - Exposing application deployed on kubernetes cluster in front of Bigip 如何访问部署在 Kubernetes 集群上的 postgresql - How to access postgresql, deployed on Kubernetes cluster 访问运行在 Kubernetes 集群上的应用程序 - Access application running on Kubernetes cluster 无法从部署在同一集群中的我的 golang 应用程序连接到 kubernetes 上的 redis 集群 - Unable to connect to redis cluster on kubernetes from my golang application deployed within the same cluster 无法访问部署在 Kubernetes 系统上的应用程序 UI - Unable to reach the Application UI deployed on a Kubernetes system 使用 nginx-ingess 访问 kubernetes 集群中的应用程序 - Using nginx-ingess to access an application in a kubernetes cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM