You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Easy way to build your development environment with Docker
139
139
140
140
At first, change directory to kubernetes dashboard repository of your fork.
141
+
This development container has all of dependencies to develop dashboard.
141
142
142
-
### Allow accessing dashboard from outside the container
143
+
### Miscellaneous
143
144
144
-
Development container builds Kubernetes Dashboard and runs it with self-certificates by default,
145
-
but Kubernetes Dashboard is not exposed to outside the container with insecure certificates by default.
145
+
* Development container builds Kubernetes Dashboard and runs it with self-certificates by default.
146
+
* This container create `user` with `UID` and `GID` same as local user, switch user to `user` with `gosu` and run commands. So created or updated files like results of `make fix` would have same ownership as your host. You can commit them immediately from your host.
147
+
* Built Kubernetes Dashboard will run by `docker compose`, so other few containers will be created in your docker.
146
148
147
-
To allow accessing dashboard from outside the development container,
148
-
pass value for `--insecure-bind-address` option to dashboard as follows:
149
-
150
-
* Set `K8S_DASHBOARD_BIND_ADDRESS` environment variable as `"0.0.0.0"` before using `aio/develop/run-npm-on-container.sh`.
151
-
* Run like `npm run [command] --bind_address="0.0.0.0"`, when you run dashboard from inside the container.
152
-
153
-
### Change port number for dashboard
154
-
155
-
As default, development container uses `8080` port to expose dashboard. If you need to change the port number, set `K8S_DASHBOARD_PORT` environment variable before using `aio/develop/run-npm-on-container.sh`. The variable would be passed to `--port` option for docker and `npm run start` command inside container, then container exports the port and dashboard starts at the port.
156
-
157
-
### To run dashboard using Docker at ease
158
-
159
-
1. Run `aio/develop/run-npm-on-container.sh`.
160
-
161
-
That's all. It will build dashboard container from your local repository, will create also kubernetes cluster container for your dashboard using [`kind`](https://github.com/kubernetes-sigs/kind), and will run dashboard.
162
-
Then you can see dashboard `http://localhost:8080` with your browser. Since dashboard uses self-certificates, so you need ignore warning or error about it in your browser.
163
-
164
-
### To run with your another Kubernetes cluster
149
+
### To run with your Kubernetes cluster
165
150
166
151
1. Copy kubeconfig from your cluster, and confirm the URL for API server in it, and modify it if necessary.
167
152
2. Set filepath for kubeconfig into `K8S_DASHBOARD_KUBECONFIG` environment variable.
168
153
3. If you deployed `dashboard-metrics-scraper` in your cluster, set its endpoint to `K8S_DASHBOARD_SIDECAR_HOST` environment variable.
169
154
4. Change directory into your dashboard source directory.
170
-
5. Run `aio/develop/run-npm-on-container.sh`.
171
-
172
-
These manipulations will build container, and run dashboard as default.
173
-
174
-
### To run npm commands as you want
155
+
5. Run `hack/develop/run-dev-container.sh`.
175
156
176
-
Also, you can run npm commands described in package.json as you want
157
+
These manipulations will build container and run dashboard with `make run` as default.
177
158
178
-
e.g.
179
-
1. To test dashboard, run `aio/develop/run-npm-on-container.sh run test`.
180
-
2. To check your code changes, run `aio/develop/run-npm-on-container.sh run check`.
159
+
To accessing Kubernetes Dashboard, open https://localhost:4443 from your browser.
181
160
182
-
This container create `user` with `UID` and `GID` same as local user, switch user to `user` with `gosu` and run commands. So created or updated files like results of `npm run fix` or `npm run check` would have same ownership as your host. You can commit them immediately from your host.
183
-
184
-
### To run container without creating cluster and running dashboard
161
+
### Just to run development container without building and running dashboard
185
162
186
163
1. Set `K8S_DASHBOARD_CMD` environment variable as `bash`.
187
-
2. Run `aio/develop/run-npm-on-container.sh`.
164
+
2. Run `hack/develop/run-dev-container.sh`.
188
165
3. Run commands as you like in the container.
189
166
190
167
This runs container with `bash` command.
191
168
169
+
To run dashboard, execute `make run`. This will build dashboard for production and run three containers for the dashboard.
170
+
Then, access https://localhost:4443 from your browser.
171
+
192
172
### To access console inside of running development container
193
173
194
174
1. Run `docker exec -it k8s-dashboard-dev gosu user bash`.
0 commit comments