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

feat: add CustomScripts.Role property #2220

Merged
merged 2 commits into from
May 10, 2024

Conversation

will4j
Copy link
Contributor

@will4j will4j commented Apr 23, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Support custom scripts executing on some specfic nodes when creating a cluster, make kubekey more flexible for different scenes.

Take examples below:

apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
  name: dubhe-open-cluster
spec:
  hosts:
    - { name: master, address: 192.168.10.1, internalAddress: 192.168.10.1, user: ubuntu, password: "ubuntu" }
    - { name: storage, address: 192.168.10.2, internalAddress: 192.168.10.2, user: ubuntu, password: "ubuntu" }
  roleGroups:
    control-plane:
      -  master
    nfs-server:
      - storage
  system:
    preInstall:
      - name: install nfs server
        # new added `role` property
        role: nfs-server
        bash: /bin/bash -x install_nfs_server.sh
        materials:
          - ./scripts/install_nfs_server.sh

preInstall script 'install nfs server' will only executed at storage node.

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

Does this PR introduced a user-facing change?

Add new optional property `role` for CustomScripts to let custom scripts like `PreInstall` only executed at specific nodes.

Additional documentation, usage docs, etc.:


@ks-ci-bot ks-ci-bot added kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 23, 2024
@will4j
Copy link
Contributor Author

will4j commented Apr 23, 2024

/assign @pixiake

@pixiake
Copy link
Collaborator

pixiake commented May 10, 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 May 10, 2024
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: e12a56a74e979d48aa686bd1426d5792ca5fe9df

@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 May 10, 2024
@ks-ci-bot ks-ci-bot merged commit 093003e into kubesphere:master May 10, 2024
4 checks passed
@will4j will4j deleted the feature/scripts-role branch June 2, 2024 01:47
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants