简体   繁体   English

无法从外部访问运行在 Kubernetes-Pi-Cluster 上的 SpringBoot-Application

[英]Can't access SpringBoot-Application running on Kubernetes-Pi-Cluster from outside

I created a Kubernetes-cluster with a deployment + service (LoadBalancer) for a SpringBoot-Java-App.我为 SpringBoot-Java-App 创建了一个带有部署 + 服务 (LoadBalancer) 的 Kubernetes 集群。 If I want to access the Web-App via the external IP, I get a timeout error.如果我想通过外部 IP 访问 Web-App,我会收到超时错误。 Does anybody now how to fix this?现在有人如何解决这个问题吗?

LoadBalancerService.yml: LoadBalancerService.yml:

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: null
  labels:
    app: webapp
  name: webapp
spec:
  ports:
  - name: 8080-8080
    port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    app: webapp
  type: LoadBalancer

Deployment.yml部署.yml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: webapp
  labels:
    app: webapp
spec:
  replicas: 4
  selector:
    matchLabels:
      app: webapp
  template:
    metadata:
      labels:
        app: webapp
    spec:
      containers:
        - name: webapp-container
          image: skrivutenliv/raspi_stress:latest
          ports:
        - containerPort: 8080

Cluster overview:集群概览:

NAME                            READY   STATUS    RESTARTS   AGE
pod/svclb-webapp-5gs9s          1/1     Running   1          120m
pod/svclb-webapp-qfkzn          1/1     Running   1          120m
pod/nginx-app-b8b875889-272nw   1/1     Running   2          6h26m
pod/webapp-ffb868dbb-nw9bw      1/1     Running   1          121m
pod/webapp-ffb868dbb-4gv8d      1/1     Running   1          121m
pod/webapp-ffb868dbb-8j8ld      1/1     Running   1          121m
pod/svclb-webapp-zsvbf          1/1     Running   1          120m
pod/webapp-ffb868dbb-nps6s      1/1     Running   1          121m

NAME                 TYPE           CLUSTER-IP      EXTERNAL-IP                   PORT(S)          AGE
service/kubernetes   ClusterIP      10.43.0.1       <none>                        443/TCP          7d4h
service/webapp       LoadBalancer   10.43.216.123   192.168.0.233,192.168.0.235   8080:30313/TCP   120m

NAME                          DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/svclb-webapp   3         3         3       3            3           <none>          120m

NAME                        READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nginx-app   1/1     1            1           5d1h
deployment.apps/webapp      4/4     4            4           121m

NAME                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/nginx-app-b8b875889   1         1         1       5d1h
replicaset.apps/webapp-ffb868dbb      4         4         4       121m

Cluster-Nodes集群节点

NAME          STATUS   ROLES    AGE     VERSION        INTERNAL-IP     EXTERNAL-IP   OS-IMAGE                         KERNEL-VERSION   CONTAINER-RUNTIME
knode2        Ready    <none>   7d      v1.18.6+k3s1   192.168.0.233   <none>        Raspbian GNU/Linux 10 (buster)   5.4.51-v7l+      containerd://1.3.3-k3s2
knode1        Ready    <none>   7d      v1.18.6+k3s1   192.168.0.232   <none>        Raspbian GNU/Linux 10 (buster)   4.19.118-v7l+    containerd://1.3.3-k3s2
kmasternode   Ready    master   7d21h   v1.18.6+k3s1   192.168.0.231   <none>        Raspbian GNU/Linux 10 (buster)   4.19.118-v7l+    containerd://1.3.3-k3s2

Solution: disable the Firewall;)解决方案:禁用防火墙;)

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

相关问题 如何将类副本通知给SpringBoot-Application? - How can I inform my SpringBoot-Application of a class copy? 无法从在 AWS ECS 中运行的 springboot 应用程序访问在 EC2 上运行的 elasticsearch - Can't access elasticsearch running on EC2 from a springboot application running in AWS ECS 在jar文件夹外运行时,SpringBoot无法读取application.properties - SpringBoot can't read application.properties when running outside jar folder Hazecast-Kubernetes Springboot 应用嵌入式集群警告 - Hazecast-Kubernetes Springboot application embedded cluster warning 使用 kubernetes 集群进行动态 rest api 调用的 Springboot 应用程序 - Springboot application with dynamic rest api calls using kubernetes cluster 如何从集群中正在运行的 Spring Boot 应用程序中动态创建 Kubernetes 资源 - How to dynamically create Kubernetes resources from within a running spring boot application in the cluster 无法从 Kubernetes 集群内部访问 Cassandra - Unable to access the Cassandra from inside the Kubernetes cluster 无法运行SpringBoot应用程序 - Can't run SpringBoot Application 无法从 kubernetes 中的已安装卷将配置数据加载到 springboot 应用程序 - Unable to load config data to springboot application from mounted volume in kubernetes 在 Kube.netes 集群中运行的 Thymeleaf 应用程序中处理服务器上下文 - Handle server context in a Thymeleaf application running in a Kubernetes cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM