提交 e9291fc4 编写于 作者: P Piotr Bryk

Merge pull request #340 from bryk/release-docs

Procedure and documentation for release process
......@@ -2,5 +2,6 @@
The developer guide is for anyone wanting to contribute code to Dashboard
## Setup
* Getting started ([getting-started.md](getting-started.md))
## Index
* Getting started guide ([getting-started.md](getting-started.md))
* Release process ([release.md](release.md))
......@@ -4,7 +4,10 @@ This document describes how to setup your development environment.
## Architecture Overview
Kubernetes Dashboard project consists of two main components. They are called here the frontend and the backend. The frontend is a single page web application that runs in a browser. It fetches all its business data from the backend using standard HTTP methods. The backend implements UI-business logic and fetches raw data from the various Kubernetes APIs.
Kubernetes Dashboard project consists of two main components. They are called here the frontend and
the backend. The frontend is a single page web application that runs in a browser. It fetches all
its business data from the backend using standard HTTP methods. The backend implements UI-business
logic and fetches raw data from the various Kubernetes APIs.
## Preparation
......@@ -23,23 +26,31 @@ $ npm install
## Run a Kubernetes Cluster
For development it is recommended to run a local Kubernetes cluster. For your convenience, a task is provided that checks out the latest stable version, and runs it inside a Docker container. Open a separate tab in your terminal and run the following command:
For development it is recommended to run a local Kubernetes cluster. For your convenience, a
task is provided that checks out the latest stable version, and runs it inside a Docker container.
Open a separate tab in your terminal and run the following command:
```
$ gulp local-up-cluster
```
This will build and start a lightweight local cluster, consisting of a master and a single node. All processes run locally, in Docker container. The local cluster should behave like a real cluster, however, plugins like heapster are not installed. To shut it down, type the following command that kills all running Docker containers:
This will build and start a lightweight local cluster, consisting of a master and a single node.
All processes run locally, in Docker container. The local cluster should behave like a real
cluster, however, plugins like heapster are not installed. To shut it down, type the following
command that kills all running Docker containers:
```
$ docker kill $(docker ps -aq)
```
From time to time you might want to use to a real Kubernetes cluster (e.g. GCE, Vagrant) instead of the local one. The most convenient way is to create a proxy. Run the following command instead of the gulp task from above:
From time to time you might want to use to a real Kubernetes cluster (e.g. GCE, Vagrant) instead
of the local one. The most convenient way is to create a proxy. Run the following command instead
of the gulp task from above:
```
$ kubectl proxy --port=8080
```
kubectl will handle authentication with Kubernetes and create an API proxy with the address `localhost:8080`. Therefore, no changes in the configuration are required.
kubectl will handle authentication with Kubernetes and create an API proxy with the address
`localhost:8080`. Therefore, no changes in the configuration are required.
## Serving Dashboard for Development
......@@ -47,21 +58,28 @@ It is easy to compile and run Dashboard. Open a new tab in your terminal and typ
```
$ gulp serve
```
Open a browser and access the UI under `localhost:9090`. A lot of things happened underneath. Let's scratch on the surface a bit.
Open a browser and access the UI under `localhost:9090`. A lot of things happened underneath.
Let's scratch on the surface a bit.
Compilation:
* Stylesheets are implemented with SASS and compiled to CSS with libsass
* JavaScript is implemented in ES6. It is compiled with Babel for development and the Google-Closure-Compiler for production.
* Go is used for the implementation of the backend. The source code gets compiled into the single binary 'dashboard'
* JavaScript is implemented in ES6. It is compiled with Babel for development and the
Google-Closure-Compiler for production.
* Go is used for the implementation of the backend. The source code gets compiled into the
single binary 'dashboard'
Execution:
* Frontend is served by BrowserSync. It enables features like live reloading when HTML/CSS/JS change and even synchronize scrolls, clicks and form inputs across multiple devices.
* Frontend is served by BrowserSync. It enables features like live reloading when
HTML/CSS/JS change and even synchronize scrolls, clicks and form inputs across multiple devices.
* Backend is served by the 'dashboard' binary.
File watchers listen for source code changes (CSS, JS, GO) and automatically recompile. All changes are instantly reflected, e.g. by automatic process restarts or browser refreshes. The build artifacts are created in a hidden folder (`.tmp`).
File watchers listen for source code changes (CSS, JS, GO) and automatically recompile.
All changes are instantly reflected, e.g. by automatic process restarts or browser refreshes.
The build artifacts are created in a hidden folder (`.tmp`).
After successful execution of `gulp local-up-cluster` and `gulp serve`, the following processes should be running (respective ports are given in parentheses):
After successful execution of `gulp local-up-cluster` and `gulp serve`, the following processes
should be running (respective ports are given in parentheses):
BrowserSync (9090) ---> Dashboard backend (9091) ---> Kubernetes API server (8080)
......@@ -72,14 +90,16 @@ The Dashboard project can be built for production by using the following task:
```
$ gulp build
```
The code is compiled, compressed and debug support removed. The artifacts can be found in the `dist` folder.
The code is compiled, compressed and debug support removed. The artifacts can be found
in the `dist` folder.
In order to serve Dashboard from the `dist` folder, use the following task:
```
$ gulp serve:prod
```
Open a browser and access the UI under `localhost:9090.` The following processes should be running (respective ports are given in parentheses):
Open a browser and access the UI under `localhost:9090.` The following processes should
be running (respective ports are given in parentheses):
Dashboard backend (9090) ---> Kubernetes API server (8080)
......@@ -90,23 +110,30 @@ In order to package everything into a ready-to-run Docker image, use the followi
```
$ gulp docker-image:canary
```
You might notice that the Docker image is very small and requires only a few MB. Only Dashboard assets are added to a scratch image. This is possible, because the `dashboard` binary has no external dependencies. Awesome!
You might notice that the Docker image is very small and requires only a few MB. Only
Dashboard assets are added to a scratch image. This is possible, because the `dashboard`
binary has no external dependencies. Awesome!
## Run the Tests
Unit tests should be executed after every source code change. The following task makes this a breeze by automatically executing the unit tests after every save action.
Unit tests should be executed after every source code change. The following task makes this
a breeze by automatically executing the unit tests after every save action.
```
$ gulp test:watch
```
The full test suite includes static code analysis, unit tests and integration tests. It can be executed with:
The full test suite includes static code analysis, unit tests and integration tests.
It can be executed with:
```
$ gulp check
```
## Building Dashboard Inside a Container
It's possible to run `gulp` and all the dependencies inside a development container. To do this, just replace `gulp [some arg]` commands with `build/run-gulp-in-docker.sh [some arg]`. If you do this, the only dependency is `docker`, and required commands such as `npm install` will be run automatically.
It's possible to run `gulp` and all the dependencies inside a development container. To do this,
just replace `gulp [some arg]` commands with `build/run-gulp-in-docker.sh [some arg]`. If you
do this, the only dependency is `docker`, and required commands such as `npm install`
will be run automatically.
## Contribute
Wish to contribute !! Great start [here](../../CONTRIBUTING.md).
Wish to contribute? Great, start [here](../../CONTRIBUTING.md).
# Introduction
This document describes Kubernetes Dashboard release procedure and version maintenance.
## Release procedure
So you want to release a new version of Kubernetes Dashboard? Great, you just need to follow
the steps below.
1. Send a pull request that increases Kubernetes Dashboard version number in `build/conf.js`.
The property name is `deploy.versionRelease`. Follow versioning guidelines.
1. Get the pull request reviewed and merged.
1. Create a git [release tag](https://github.com/kubernetes/dashboard/releases/) for the merged
pull request. Release description should include changelog.
1. Build and push production images to container registry. Use `gulp push-to-gcr:release`.
1. Update addons on the Kubernetes core repository. Dashboard addon directory is
[here](https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dashboard). If
the update is minor, all that needs to be done is to change image version number in the main
controller config file (`dashboard-controller.yaml`), and other configs, as described in
the header of the config. If the release is major, this needs coordination with
Kubernetes core team and possibly alignment with the schedule of the core.
## Versioning guidelines
Kubernetes Dashboard versioning follows [semver](http://semver.org/) in spirit. This means
that is uses `vMAJOR.MINOR.PATCH` version numbers, but uses UX and consumer-centric approach for
incrementing version numbers.
1. Increment MAJOR when there are breaking changes that affect user's workflows or the UX gets
major redesign.
1. Increment MINOR when new functionality is added or there are minor UX changes.
1. Increment PATCH in case of bug fixes and minor new features.
Versions `0.X.Y` are reserved for initial development and may not strictly follow the guidelines.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册