Доступ к службе k3d из внешней системы в другой сети

У меня есть Rocky Linux (Vagrant VM), на которой я создал кластер k3d и с помощью Metallb назначил IP-адреса для своих служб. Я могу получить доступ к службам (keycloak) с машины Vagrant. Но мне интересно, есть ли способ получить доступ к службе 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. Есть идеи, как это решить?

0 ответов

Другие вопросы по тегам