Resolve "Use kubectl port-forward instead of SSH tunnel"
Closes #34 (closed)
It's possible that the set-port-forward script does work for @davor whereas the old SSH tunnel script apparently didn't work.
To use it, you'll need kubectl
access to the cluster:
-
Install kubectl (available through
snap
for linux, I don't know how to install it on Windows) -
Download the kubeconfig:
scp root@init.stackspin.net:/etc/rancher/k3s/k3s.yaml kube_config_init.yaml
-
Set
kubectl
to use the kubeconfig. I know how to do it in a shell:export KUBECONFIG=$PWD/kube_config_init.yaml
. Could be different on Windows too -
Test if it works:
kubectl get ingress -n stackspin
Should return something like:
NAME CLASS HOSTS ADDRESS PORTS AGE hydra-public <none> sso.init.stackspin.net 213.108.110.5 80, 443 39d dashboard <none> dashboard.init.stackspin.net 213.108.110.5 80, 443 150d kube-prometheus-stack-grafana <none> grafana.init.stackspin.net 213.108.110.5 80, 443 108d kube-prometheus-stack-alertmanager <none> alertmanager.init.stackspin.net 213.108.110.5 80, 443 108d kube-prometheus-stack-prometheus <none> prometheus.init.stackspin.net 213.108.110.5 80, 443 108d
-
Run the script to forward ports of the services to your local setup:
./set-port-forward.sh
No arguments needed: the kubectl connection already exists, so we know which cluster you want to use. The namespace defaults to
stackspin
, because nobody has a different namespace anymore.