Upgrade from 4.0 to 4.1.x

4.1.2

Frontend

Install/Upgrade KubeSphere Dependencies

Install/Upgrade create-ks-project.

npm install -g create-ks-project

Install/Upgrade KubeSphere Console dependencies.

yarn add -W \
  @ks-console/appstore@latest \
  @ks-console/bootstrap@latest \
  @ks-console/console@latest \
  @ks-console/core@latest \
  @ks-console/locales@latest \
  @ks-console/server@latest \
  @ks-console/shared@latest

The versions of @ks-console/* should ideally match the version of KubeSphere.

Install/Upgrade Kube Design.

yarn add -W \
  @kubed/charts@latest \
  @kubed/code-editor@latest \
  @kubed/components@latest \
  @kubed/diff-viewer@latest \
  @kubed/hooks@latest \
  @kubed/icons@latest \
  @kubed/log-viewer@latest

If the version of @ks-console/* is >=4.1.0, you need to upgrade Kube Design and other dependencies to the latest version.

Otherwise, you may encounter error messages when running and packaging locally.

Changes in External Dependencies for Extensions

Before KubeSphere 4.1.2, the core provided some commonly used dependency libraries, and extensions could directly import and use these dependencies without installing them. These dependencies were called external dependencies for extensions.

However, if the external dependencies of extensions caused functional anomalies, the extensions had to wait for the core to update the dependencies to fix them. This clearly violated the original intention of the extension mechanism.

Therefore, starting from 4.1.2, some external dependencies for extensions are removed as follows:

  • lodash
  • react-is
  • react-markdown

If extensions need to use these libraries, they need to install them themselves. The import and usage methods remain unchanged.

Split Webpack Custom Configuration

Before KubeSphere 4.1.2, there was only one Webpack custom configuration file, configs/webpack.config.js. This file was used for both local running of KubeSphere Console (yarn dev and yarn dev:client) and packaging of extension frontend (yarn build:ext).

Starting from 4.1.2, the Webpack custom configuration file is split into two:

  • configs/webpack.config.js: Used for local running of KubeSphere Console (yarn dev and yarn dev:client).
  • configs/webpack.extensions.config.js: Used for packaging extension frontend (yarn build:ext).
Deprecate Local Production Mode

Since you can directly access the KubeSphere Console to view extensions, there is no longer a need for local production mode.

Therefore, the build:prod and start commands in the scripts section of package.json are deprecated.

4.1.0

Frontend

Changes in Extension Configuration

Starting from KubeSphere 4.1.0, extensions need to export their configuration

export default extensionConfig;

instead of the previous way of registering extensions.

globals.context.registerExtension(extensionConfig);