如何从主机中的浏览器访问虚拟机中的URL

时间:2019-01-08 04:36:19

标签: nginx kubernetes virtualbox

我正在虚拟机中运行kubernetes集群。 我可以从虚拟机访问(卷曲)URL https://wso2-apim/carbon,该虚拟机是使用kubernetes入口设置的,以指向集群中运行的服务。

但是,我需要在浏览器中查看它。首先,我尝试通过在虚拟机中安装仅文本的Web浏览器(例如lynx)来完成此操作,但是由于它没有javascript,因此无法满足我的要求。

因此,我正在检查如何从主机上的浏览器访问该URL。 (苹果电脑) 你能指导我如何完成它吗?

 render(){
    const {classes}=this.props;
     console.log("iiiiiiiiii",this.props.rsl['data'])
    return(
        <Paper className={classes.root}>
            <div className={classes.tableWrapper}>
                <Table>
                    <EnhancedTableHead rows={this.props.rowsHdr} />
                    {console.log("this.props.rowsHdr",this.props.rowsHdr)}
                    <TableBody>
                        {this.props.rsl['data'].map(row=>{
                            return(
                                <TableRow key={row.bankId}
                                  hover
                                  onClick={e=>console.log("e",e)}
                                >
                                    <TableCell>{row.bankName}</TableCell>
                                    <TableCell>{row.bankCode}</TableCell>
                                    <TableCell>{row.city}</TableCell>
                                    <TableCell>{row.country}</TableCell>
                                    <TableCell>{row.status}</TableCell>
                                    <TableCell>
                                        <Button variant="contained" className={classes.button} onClick={()=>this.handleViewProfile(row.bankCode)}>
                                            View
                                        </Button>
                                    </TableCell>
                                </TableRow>
                            )
                        })}                            
                    </TableBody>
                </Table>                    
            </div>
        </Paper>
    )
   }

  iiiiiiiiii 

  (4) [{…}, {…}, {…}, {…}]
   0: {status: "ACTIVE", zipcode: "500018", country: "India"}
    1: {status: "ACTIVE", zipcode: "500019", country: "India"}
   2: {status: "ACTIVE", zipcode: "500026", country: "India" }
   3: {status: "ACTIVE", zipcode: "500028", country: "India"}
   length: 4
   __proto__: Array(0)

我要访问的服务的入口设置:

pasan@ubuntu:~$ kubectl get ing --all-namespaces
NAMESPACE     NAME                                          HOSTS               ADDRESS     PORTS     AGE
vick-system   gw-ingress                                    wso2-apim-gateway   10.0.2.15   80, 443   16h
vick-system   pub-store-ingress                             wso2-apim           10.0.2.15   80, 443   16h
vick-system   vick-observability-portal-dashboard-ingress   vick-dashboard      10.0.2.15   80        16h

服务列表:

pasan@ubuntu:~$ kubectl describe ing pub-store-ingress -n vick-system
Name:             pub-store-ingress
Namespace:        vick-system
Address:          10.0.2.15
Default backend:  default-http-backend:80 (<none>)
TLS:
  SNI routes wso2-apim
Rules:
  Host       Path  Backends
  ----       ----  --------
  wso2-apim
             /   gateway:9443 (<none>)
Annotations:
  nginx.ingress.kubernetes.io/session-cookie-name:   route
  nginx.ingress.kubernetes.io/ssl-passthrough:       true
  nginx.ingress.kubernetes.io/ssl-redirect:          false
  kubectl.kubernetes.io/last-applied-configuration:  {"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{"kubernetes.io/ingress.class":"nginx","nginx.ingress.kubernetes.io/affinity":"cookie","nginx.ingress.kubernetes.io/session-cookie-hash":"sha1","nginx.ingress.kubernetes.io/session-cookie-name":"route","nginx.ingress.kubernetes.io/ssl-passthrough":"true"},"name":"pub-store-ingress","namespace":"vick-system"},"spec":{"rules":[{"host":"wso2-apim","http":{"paths":[{"backend":{"serviceName":"gateway","servicePort":9443},"path":"/"}]}}],"tls":[{"hosts":["wso2-apim"]}]}}

  kubernetes.io/ingress.class:                      nginx
  nginx.ingress.kubernetes.io/affinity:             cookie
  nginx.ingress.kubernetes.io/session-cookie-hash:  sha1
Events:                                             <none>

我的/ etc / hosts文件:

pasan@ubuntu:~$ kubectl get svc --all-namespaces
NAMESPACE       NAME                                    TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                                                                   AGE
default         kubernetes                              ClusterIP      10.96.0.1        <none>        443/TCP                                                                                                                   16h
ingress-nginx   default-http-backend                    ClusterIP      10.102.146.126   <none>        80/TCP                                                                                                                    16h
ingress-nginx   ingress-nginx                           NodePort       10.102.166.109   10.0.2.15     80:31139/TCP,443:32537/TCP                                                                                                16h
istio-system    grafana                                 ClusterIP      10.97.173.253    <none>        3000/TCP                                                                                                                  16h
istio-system    istio-citadel                           ClusterIP      10.96.221.235    <none>        8060/TCP,9093/TCP                                                                                                         16h
istio-system    istio-egressgateway                     ClusterIP      10.98.223.83     <none>        80/TCP,443/TCP                                                                                                            16h
istio-system    istio-galley                            ClusterIP      10.101.43.78     <none>        443/TCP,9093/TCP                                                                                                          16h
istio-system    istio-ingressgateway                    LoadBalancer   10.105.4.150     <pending>     80:31380/TCP,443:31390/TCP,31400:31400/TCP,15011:32425/TCP,8060:31612/TCP,853:30264/TCP,15030:31349/TCP,15031:30408/TCP   16h
istio-system    istio-pilot                             ClusterIP      10.102.142.98    <none>        15010/TCP,15011/TCP,8080/TCP,9093/TCP                                                                                     16h
istio-system    istio-policy                            ClusterIP      10.98.119.8      <none>        9091/TCP,15004/TCP,9093/TCP                                                                                               16h
istio-system    istio-sidecar-injector                  ClusterIP      10.110.150.219   <none>        443/TCP                                                                                                                   16h
istio-system    istio-statsd-prom-bridge                ClusterIP      10.98.218.30     <none>        9102/TCP,9125/UDP                                                                                                         16h
istio-system    istio-telemetry                         ClusterIP      10.109.56.176    <none>        9091/TCP,15004/TCP,9093/TCP,42422/TCP                                                                                     16h
istio-system    jaeger-agent                            ClusterIP      None             <none>        5775/UDP,6831/UDP,6832/UDP                                                                                                16h
istio-system    jaeger-collector                        ClusterIP      10.107.248.128   <none>        14267/TCP,14268/TCP                                                                                                       16h
istio-system    jaeger-query                            ClusterIP      10.97.91.158     <none>        16686/TCP                                                                                                                 16h
istio-system    prometheus                              ClusterIP      10.98.16.190     <none>        9090/TCP                                                                                                                  16h
istio-system    servicegraph                            ClusterIP      10.96.66.82      <none>        8088/TCP                                                                                                                  16h
istio-system    tracing                                 ClusterIP      10.104.57.157    <none>        80/TCP                                                                                                                    16h
istio-system    zipkin                                  ClusterIP      10.109.76.209    <none>        9411/TCP                                                                                                                  16h
kube-system     kube-dns                                ClusterIP      10.96.0.10       <none>        53/UDP,53/TCP                                                                                                             16h
vick-system     gateway                                 ClusterIP      10.101.191.90    <none>        8280/TCP,8243/TCP,9763/TCP,9443/TCP                                                                                       16h
vick-system     vick-observability-portal               ClusterIP      10.100.113.178   <none>        3000/TCP                                                                                                                  16h
vick-system     wso2apim-with-analytics-rdbms-service   ClusterIP      10.99.21.97      <none>        3306/TCP                                                                                                                  16h
vick-system     wso2sp-worker                           ClusterIP      10.96.175.235    <none>        9091/TCP,9092/TCP,9411/TCP,9443/TCP,9090/TCP,7611/TCP,7711/TCP,9611/TCP,9711/TCP,7443/TCP,9123/TCP                        16h

0 个答案:

没有答案
相关问题