Skip to content
Snippets Groups Projects
Commit 889901a0 authored by Tin Geber's avatar Tin Geber
Browse files

modified run script to pull local kubeconfig

parent ebc41511
No related branches found
No related tags found
1 merge request!125Improve UX for dashboard app tiles
Pipeline #41093 passed with stages
in 3 minutes and 20 seconds
......@@ -26,6 +26,9 @@ yarn-error.log*
.eslintcache
cypress/videos/
# KUBECONFIG values
backend/kubeconfig/*
# Helm dependencies
deployment/helmchart/charts/
......
......@@ -103,31 +103,19 @@ The application will run on `http://stackspin_proxy`. Add the following line to
#### 4. Kubernetes access
The `./run_app.sh` script needs to access the Kubernetes cluster that runs your Stackspin instance. If you followed the setup as above, you will have a YAML configuration file somewhere on your machine -- usually in the `clusters` directory of your Stackspin local repository -- called `kube_config_cluster.yml`. You can put that file anywhere you want (as long as Docker has read access to that directory). A common convention is to put it in the `~/.kube` directory.
The `./run_app.sh` script needs to access the Kubernetes cluster that runs your Stackspin instance. If you followed the setup as above, you will have a YAML configuration file somewhere on your machine -- usually in the `clusters` directory of your Stackspin local repository -- called `kube_config_cluster.yml`. This file holds all the configuration information (URLs, domain names, certificate data) needed to connect to the instance.
Assuming that your YAML file is in the above directory, run the following command (from the same terminal window you will use to run the script):
Copy that file into the `backend/kubeconfig` directory.
```
export KUBECONFIG=~/.kube/kube_config_cluster.yml
```
This way, when you run our install script from the same terminal window, it will use those configuration instructions, and you will be able to plug your local dashboard into your Stackspin instance.
#### Troubleshooting points:
- The kubeconfig will be mounted inside docker containers, so also make sure
your Docker user can read it.
- The bind-mount done by docker might not work if the file pointed to is
part of a filesystem such as sshfs. In that case, copy the file to a local
drive first.
If you wish to connect this dashboard to another Stackspin cluster, you can replace the `kube_config_cluster.yml` file with the one that's in that Stackspin's `clusters` directory.
## 5. Build and run
To recap, you now have:
- All the software and configurations as described above
- A running Stackspin cluster (a VPS somewhere in The Cloud
- A KUBECONFIG environment that knows how to connect with your Stackspin cluster because it uses your `kube_config_cluster.yml`
- A running Stackspin cluster (a VPS somewhere in The Cloud)
- A `kube_config_cluster.yml` file in the `backend/kubeconfig` that will tell the script how to connect to your Stackspin cluster of choice
- Overrides for local dashboard development (by installing and running the [Dashboard Dev Overrides](https://open.greenhost.net/stackspin/dashboard-dev-overrides) repository, editing your `/etc/hosts` file, etc)
- A copy of the [Stackspin Dashboard repository](https://open.greenhost.net/stackspin/dashboard) on your device.
......
#!/usr/bin/env bash
export KUBECONFIG=./backend/kubeconfig/kube_config_cluster.yml
set -euo pipefail
dockerComposeArgs=$@
export DATABASE_PASSWORD=$(kubectl get secret -n flux-system stackspin-single-sign-on-variables -o jsonpath --template '{.data.dashboard_database_password}' | base64 -d)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment