Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cluster addons enhancement #2267

Merged
merged 6 commits into from
Jun 3, 2024

Conversation

will4j
Copy link
Contributor

@will4j will4j commented Jun 2, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Cluster addons enhancement:

  1. Support install addons after create cluster
# skip addons when create cluster
kk create cluster --skip-install-addons -f kubesphere.yaml
# install addons after cluster create success
kk alpha create phase addons -f kubesphere.yaml
  1. Support install specific addons

For example:

spec:
  addons:
    - name: csi-driver-nfs
      namespace: storage
      sources:
        chart:
          # https://artifacthub.io/packages/helm/csi-driver-nfs/csi-driver-nfs
          release: csi-driver-nfs
          path: ./addons/csi-driver-nfs
    - name: metrics-server
      namespace: monitoring
      sources:
        chart:
          # https://artifacthub.io/packages/helm/metrics-server/metrics-server
          release: metrics-server
          path: ./addons/metrics-server
    - name: ingress-nginx
      namespace: network
      sources:
        chart:
          # https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx
          release: ingress-nginx
          path: ./addons/ingress-nginx
# only install csi-driver-nfs and metrics-server
kk alpha create phase addons -f kubesphere.yaml csi-driver-nfs metrics-server
  1. Support preInstall & postInstall scripts of addon
    example below prepare node dir before addon installation
spec:
  addons:
    - name: my-addons
      namespace: my-addons
      preInstall:
        - name: Prepare addon directory
          role: my-addons
          bash: /bin/bash -x prepare_addon_dir.sh
          materials:
            - ./scripts/prepare_addon_dir.sh

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

Does this PR introduced a user-facing change?

Add `kk alpha create phase addons` for addons installation.

Additional documentation, usage docs, etc.:


@ks-ci-bot ks-ci-bot added needs-rebase size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 2, 2024
Copy link

sonarcloud bot commented Jun 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
1.2% Duplication on New Code

See analysis details on SonarCloud

@will4j will4j changed the title Feature/addons enhance Feature/cluster addons enhancement Jun 2, 2024
@will4j
Copy link
Contributor Author

will4j commented Jun 2, 2024

/assign @pixiake

@pixiake
Copy link
Collaborator

pixiake commented Jun 3, 2024

@will4j Thanks for this contributions !
/lgtm
/approve

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2024
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: ee6d7c4dbe37f5e0d967c64098cf62efdbf4568d

@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pixiake, will4j

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2024
@ks-ci-bot ks-ci-bot merged commit 9a79dc7 into kubesphere:master Jun 3, 2024
11 checks passed
@will4j will4j deleted the feature/addons-enhance branch June 4, 2024 02:55
@antikilahdjs
Copy link

@will4j thank you so much for the code.

I just wondering know if is it possible add my own repo as example, I have a gitlab with all helm and I would like to install from my repo instead public ones. So, is it a option to include token or something like that? Tks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants