A tool to manage your pai cluster.
- Manage cluster configuration
- Maintain machines
- Maintain your service
- Bootstrap your cluster
- Appendix: An example of the
machine-list
file
python paictl.py config external-config-update -e external-config [ -c kube-config ]
-
External storage is responsible for storing your cluster configuration. And it is not a part of OpenPai's service. Now OpenPai supports 2 method to integrate.
- git: Admin could manage their cluster configuration with git such as VSTS, Github or Gitlab. Of course, you could setup your own git server.
- local: If you don't have a git repo to manage your cluster configuration, you can store it in the local disk.
-
External storage configuration
#################
# Git #
#################
type: git
url: https://github.com/example/example
branch: example_branch
# relative path in the project source code
path: a/b/c
##################
# Local storage. #
##################
type: local
# absolute path in your system
path: /a/b/c
- kube-config: The configuration for kubectl and other kubernetes client to access to the server. The default value is
~/.kube/config
. For more detail information, please refer to the link
python paictl.py config generate -i /pai/deployment/quick-start/quick-start/quick-start.yaml -o ~/pai-config -f
- quick-start.yaml: Admin could generate a complete cluster configuration with quick-start.yaml. More detailed about this file please refer to this link.
- More information about this command please refer to this link.
- By default, in the generated configuration, a single-master Kubernetes is configured by default.
- Advanced users or developers can fine-tune the content of the generated configuration files according to specific environments.
python paictl config push -p /path/to/local/configuration [-c kubeconfig-path ]
- Same as local storage.
python paictl config push -e external-storage-config [-c kubeconfig-path]
- Configure the external storage configuration and pass the configuration file with the parameter
-e
.
python paictl config push [-c kubeconfig-path]
- Note: Please ensure that you have upload the external storage configuration to k8s with the command.
paictl.py config pull -o /path/to/output [-c kube-config]
paictl.py config get-id [-c kube-config]
python paictl.py machine add -p /path/to/cluster-configuration/dir -l machine-list.yaml
- See an example of the machine list here.
python paictl.py machine remove -p /path/to/cluster-configuration/dir -l machine-list.yaml
- See an example of the machine list here.
python paictl.py machine etcd-fix -p /path/to/cluster-configuration/dir -l machine-list.yaml
- See an example of the machine list here.
- Note: The opertion could only fix one node each time.
python paictl.py service start [-c /path/to/kubeconfig] [ -n service-list ]
- Start all services by default.
- If the option
-n
is set, only the specified services will be started.
python paictl.py service stop [-c /path/to/kubeconfig] [ -n service-list ]
- Stop all services by default.
- If the option
-n
is set, only the specified services will be stopped.
python paictl.py service delete [-c /path/to/kubeconfig] [ -n service-list ]
- 'Delete' a service means to stop that service and then delete all of its persisted data in HDFS, Yarn, ZooKeeper, etc.
- Delete all services by default.
- If the option
-n
is set, only the specified services will be deleted.
python paictl.py service refresh [-c /path/to/kubeconfig] [ -n service-list ]
- Refresh all the labels on each node.
- If the option
-n
is set, only the specified services will be upgrade.
python paictl.py cluster k8s-bootup -p /path/to/cluster-configuration/dir
- Install kubectl in the deployment box.
- Bootstrap Kubernetes in the specified cluster.
python paictl.py cluster k8s-clean -p /path/to/cluster-configuration/dir
- Stop Kubernetes in the specified cluster.
python paictl.py cluster k8s-set-env [ -p /path/to/cluster/configuration ]
- Install kubectl in the deployment box.
- Configure KUBECONFIG for kubectl or other kubernetes' client.
- The args
-p /path/to/cluster/configuration
is optional. If admin don't pass this args, paictl will ask admin to input the necessary information to generate KUBECONFIG. - When in a clean dev-box, please run this command firstly.
machine-list:
- hostname: host1 # echo `hostname`
hostip: 192.168.1.11
machine-type: D8SV3
etcdid: etcdid1
#sshport: PORT (Optional)
username: username
password: password
k8s-role: master
dashboard: "true"
zkid: "1"
pai-master: "true"
- hostname: host2
hostip: 192.168.1.12
machine-type: NC24R
#sshport: PORT (Optional)
username: username
password: password
k8s-role: worker
pai-worker: "true"