How can I get access to this cluster?

175 Views Asked by At

Hello I was created a k8s cluster in vagrant using the followings commands:

sudo apt-get update
sudo apt-get upgrade
sudo snap install microk8s --classic --channel=1.21/stable
sudo usermod -a -G microk8s $USER
newgrp microk8s
sudo chown -f -R $USER ~/.kube
microk8s enable dns storage ingress metallb:10.64.140.43-10.64.140.49
microk8s config > ~/.kube/config
sudo snap install juju --classic
juju bootstrap microk8s mycontroler
juju add-model kubeflow
juju deploy kubeflow-lite --trust
microk8s kubectl patch role -n kubeflow istio-ingressgateway-operator -p '{"apiVersion":"rbac.authorization.k8s.io/v1","kind":"Role","metadata":{"name":"istio-ingressgateway-operator"},"rules":[{"apiGroups":["*"],"resources":["*"],"verbs":["*"]}]}'
juju config dex-auth public-url=http://10.64.140.43.nip.io
juju config oidc-gatekeeper public-url=http://10.64.140.43.nip.io
juju config dex-auth static-username=admin
juju config dex-auth static-password=admin

I copied the .kube/config from vagrant to the host and set the socks proxy to the vagrant like this

ssh -D 9999 [email protected]

I cannot get access to the http://10.64.140.43.nip.io because I get a error 403 too.

any idea about how can I use kubectl from host to get access to that k8s cluster?

Thanks

1

There are 1 best solutions below

0
zer0 On

This is by design. This is a security control that doesn't allow outside access to Vagrant networking. You need to configure port forwarding inside your vagrant Vagrantfile and then run vagrant reload for this to take effect.

You can find more details in this stackoverflow answer.