0

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 vagrant@10.64.140.43

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

Tlaloc-ES
  • 4,825
  • 7
  • 38
  • 84
  • you are trying to achieve `bridged networking in microk8s` , check out https://microk8s.io/docs/addon-multus OR anything on that topic. – P.... Jul 08 '22 at 19:15

1 Answers1

0

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.

zer0
  • 2,153
  • 10
  • 12