Coder Social home page Coder Social logo

lonelycz / clusteradm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-cluster-management-io/clusteradm

0.0 1.0 0.0 13.1 MB

command line tool to bootstrap open-cluster-management control plane.

License: Apache License 2.0

Shell 3.01% Makefile 1.94% Go 95.05%

clusteradm's Introduction

clusteradm CLI & CLI Plugin

A CLI and kubernetes CLI plugin that allows you to interact with open-cluster-management to manage your Hybrid Cloud presence from the command-line.

Quick start

Install the clusteradm command-line:

From install script:

curl -L https://raw.githubusercontent.com/open-cluster-management-io/clusteradm/main/install.sh | bash

From go install:

GO111MODULE=off go get -u open-cluster-management.io/clusteradm/...

From binaries:

The binaries for several platforms are available here.

  • Download the compressed file from here
  • Uncompress the file and place the output in a directory of your $PATH

From source:

Go 1.17 is required in order to build or contribute on this project as it leverage the go:embed tip. The binary will be installed in $GOPATH/bin

git clone https://github.com/open-cluster-management-io/clusteradm.git
cd clusteradm
make build
clusteradm

Initialize a hub and join a cluster

# Initialize the hub
kubectl config use-context <hub cluster context> # kubectl config use-context kind-hub
clusteradm init

# Request a managed cluster to join the hub
kubectl config use-context <managed cluster context> # kubectl config use-context kind-managed-cluster
clusteradm join --hub-token <token> --hub-apiserver <api server url> --cluster-name <cluster name>

# Accept the managed cluster request on the hub
kubectl config use-context <hub cluster context> # kubectl config use-context kind-hub
clusteradm accept --clusters <list of clusters> # clusteradm accept --clusters c1,c2,...

After each above clusteradm command, the clusteradm will print out the next clusteradm command to execute which can be copy/paste.

Contributing

See our Contributing Document for more information.

Commands

The commands are composed of a verb and a noun and then a number of parameters. Logs can be gather by setting the klog flag -v. To get the logs in a separate file:

clusteradm <subcommand> -v 2 > <your_logfile>

or

clusteradm <subcommand> -v 99 --logtostderr=false --log-file=<your_log_file>

version

Display the clusteradm version and the kubeversion

clusteradm version

init

Initialize the hub by deploying the hub side resources to manage clusters.

clusteradm init [--use-bootstrap-token]

it returns the command line to launch on the spoke to join the hub.

join

Install the agent on the spoke.

clusteradm join --hub-token <token> --hub-apiserver <hub_apiserver_url> --cluster-name c1

it returns the command line to launch on the hub the accept the spoke onboarding.

accept

Accept the CSRs on the hub to approve the spoke clusters to join the hub.

clusteradm accept --clusters <cluster1>, <cluster2>,....

install hub-addon

Install specific built-in add-on(s) to the hub cluster.

clusteradm install hub-addon --names application-manager

clusteradm install hub-addon --names governance-policy-framework

enable addons

Enable specific add-on(s) agent deployment to the given managed clusters of the specified namespace

clusteradm addon enable --names application-manager --namespace <namespace> --clusters <cluster1>,<cluster2>,....

clusteradm addon enable --names governance-policy-framework --namespace <namespace> --clusters <cluster1>,<cluster2>,....

clusteradm's People

Contributors

chrisahl avatar dhaiducek avatar gurnben avatar haoqing0110 avatar hchenxa avatar huiwq1990 avatar ilan-pinto avatar itdove avatar jichenjc avatar justinkuli avatar kim-fitness avatar mgold1234 avatar mikeshng avatar mprahl avatar openshift-merge-robot avatar panguicai008 avatar philipwu08 avatar qiujian16 avatar sataqiu avatar testgod481 avatar vbelouso avatar xauthulei avatar xuezhaojun avatar ycyaoxdu avatar yue9944882 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.