1

我有一个 Rocky Linux (Vagrant VM),我在其上创建了一个 k3d 集群并使用 metallb 为我的服务分配 IP 地址。我可以从 Vagrant 机器访问服务(keycloak)。但我想知道是否有办法直接从我的桌面访问 keycloak 服务。

Network details:

MAC (desktop) - 192.168.0.202
Vagrant VM (Created using VirtualBox) - 192.168.80.11

Docker network: 192.168.80.128/26
k3d cluster node IPs: 192.168.80.130/131 ( 1 Server, 1 Agents)
k3d metallb reserved IP addresses - 192.168.80.192-192.168.80.220
keycloak service ip address assigned by metallb - 192.168.80.201

(ansible-py3) [vagrant@localhost k3d]$ kubectl get service
NAME       TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                         AGE
keycloak   LoadBalancer   10.43.94.201   192.168.80.201   8080:30425/TCP,8443:30193/TCP   7m33s

(ansible-py3) [vagrant@localhost k3d]$ curl -X GET http://192.168.80.201:8080
<!--
  ~ Copyright 2016 Red Hat, Inc. and/or its affiliates
  ~ and other contributors as indicated by the @author tags.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <meta http-equiv="refresh" content="0; url=/auth/" />
    <meta name="robots" content="noindex, nofollow">
    <script type="text/javascript">
        window.location.href = "/auth/"
    </script>
</head>
<body>
    If you are not redirected automatically, follow this <a href='/auth'>link</a>.
</body>
</html>

从本地 MAC 路由

netstat -rn | grep 192.168.80            ✔
192.168.80         link#22            UC         vboxnet      !
192.168.80.1       a:0:27:0:0:3       UHLWI          lo0
192.168.80.11      8:0:27:61:f7:90    UHLWIi     vboxnet    988
192.168.80.201     192.168.80.11      UGHS       vboxnet

traceroute 192.168.80.201          2 ✘  3s
traceroute to 192.168.80.201 (192.168.80.201), 64 hops max, 52 byte packets
 1  192.168.80.11 (192.168.80.11)  0.508 ms  0.309 ms  0.160 ms
 2  * * *
 3  * * *
 4  * * *

使用此配置,我无法从我的 MAC 访问该服务。关于如何解决这个问题的任何想法?

4

0 回答 0