Develop new feature and fix bug on the Gardener Dashboard.
- Yarn. For the required version, refer to
.engines.yarn
in package.json. - Node.js. For the required version, refer to
.engines.node
in package.json.
Clone the gardener/dashboard repository
git clone git@github.com:gardener/dashboard.git
Run yarn
at the repository root to install all dependencies.
cd dashboard
yarn
Place the Gardener Dashboard configuration under ${HOME}/.gardener/config.yaml
or alternatively set the path to the configuration file using the GARDENER_CONFIG
environment variable.
A local configuration example could look like follows:
port: 3030
logLevel: debug
logFormat: text
apiServerUrl: https://my-local-cluster # garden cluster kube-apiserver url - kubectl config view --minify -ojsonpath='{.clusters[].cluster.server}'
sessionSecret: c2VjcmV0 # symmetric key used for encryption
frontend:
dashboardUrl:
pathname: /api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/
defaultHibernationSchedule:
evaluation:
- start: 00 17 * * 1,2,3,4,5
development:
- start: 00 17 * * 1,2,3,4,5
end: 00 08 * * 1,2,3,4,5
production: ~
The Gardener Dashboard backend
server requires a kubeconfig for the Garden cluster. You can set it e.g. by using the KUBECONFIG
environment variable.
If you want to run the Garden cluster locally, follow the getting started locally documentation.
Gardener Dashboard supports the local
infrastructure provider that comes with the local Gardener cluster setup.
See 6. Login to the dashboard for more information on how to use the Dashboard with a local gardener or any other Gardener landscape.
Start the backend
server (http://localhost:3030
).
cd backend
export KUBECONFIG=/path/to/garden/cluster/kubeconfig.yaml
yarn serve
To start the frontend server, you have two options for handling the server certificate:
-
Recommended Method: Run
yarn setup
in the frontend directory to generate a new self-signed CA and TLS server certificate before starting the frontend server for the first time. The CA is automatically added to the keychain on macOS. If you prefer not to add it to the keychain, you can use the--skip-keychain
flag. For other operating systems, you will need to manually add the generated certificates to the local trust store. -
Alternative Method: If you prefer not to run
yarn setup
, a temporary self-signed certificate will be generated automatically. This certificate will not be added to the keychain. Note that you will need to click through the insecure warning in your browser to access the dashboard.
We need to start a TLS dev server because we use cookie names with __Host-
prefix. This requires the secure attribute to be set. For more information, see OWASP Host Prefix.
Start the frontend
dev server (https://localhost:8443
) with https and hot reload enabled.
cd frontend
# yarn setup
yarn serve
You can now access the UI on https://localhost:8443/
To login to the dashboard you can either configure oidc
, or alternatively login using a token:
To login using a token, first create a service account.
kubectl -n garden create serviceaccount dashboard-user
Assign it a role, e.g. cluster-admin.
kubectl set subject clusterrolebinding cluster-admin --serviceaccount=garden:dashboard-user
Get the token of the service account.
kubectl -n garden create token dashboard-user --duration 24h
Copy the token and login to the dashboard.
Build docker image locally.
make build
Push docker image to Google Container Registry.
make push
This command expects a valid gcloud configuration named gardener
.
gcloud config configurations describe gardener
is_active: true
name: gardener
properties:
core:
account: john.doe@example.org
project: johndoe-1008