This is a sample python client on top of the generated assisted-installer python library to ease working with assisted installer
Available features:
- create/delete cluster (autoinjecting pull secret file and ssh public key)
- create/download discovery iso
- list cluster/hosts
- update hostnames and host roles
- update cluster attributes such as api vip and ingress vip
- launch cluster install
Install the package with
pip3 install aicli
To upgrade it later on
pip3 install -U aicli assisted-service-client
alias aicli='docker run --net host -it --rm -e AI_OFFLINETOKEN=$AI_OFFLINETOKEN -v $HOME/.aicli:/root/.aicli -v $PWD:/workdir quay.io/karmab/aicli'
Where AI_OFFLINETOKEN is an environment variable used to access public saas. This token can be retrieved at https://cloud.redhat.com/openshift/token
With onprem mode, you can instead use -e AI_URL=$AI_URL
the flag --staging
can be set to target the internal staging environment
Alternatively, set the env variable STAGING to true (or any non empty string, really)
In container mode, that would be -e STAGING=true
To deploy assisted installer, you can use kcli with the provided plan in the kcli_plan directory
cd kcli_plan
kcli create plan
You need to indicate a target AI_URL, which can be done with the flag --url
The url is in this format http://$AI_IP:8080
Alternatively, you can set it as an environment variable
For most of the commands, you can pass parameters either on the command line by repeating -P key=value
or by putting them in a parameter file, in yaml format.
If present, the file aicli_parameters.yml
is also parsed.
aicli -h
aicli list cluster
aicli list host
aicli create cluster myclu
aicli delete cluster myclu
aicli info cluster mycluster
aicli info host myhost
aicli update cluster myclu -P api_vip=192.168.122.253
aicli update host host_id -P name=coolname.testk.karmalabs.com
The following command can be used to update the names of all the nodes named localhost to master-X instead in each cluster
aicli update host localhost -P role=master
aicli create iso myclu
aicli download iso myclu
#3 Update data
aicli create iso myclu
aicli download iso myclu
aicli start cluster myclu
For this purpose, we assume we already have an installer cluster (named myclu). When creating a new cluster with the same name and the '-day2' extension, the api code will create a dedicated cluster for adding host purposes.
aicli create cluster myclu-day2
# gather the discovery iso and launch hosts as usual then
aicli start cluster myclu-day2
openshift_version: 4.8
sno: true
pull_secret: my_pull_secret.json
disconnected_url: testk-disconnecter.ipv6only:5000
installconfig:
additionalTrustBundle: |
-----BEGIN CERTIFICATE-----
MIIGCzCCA/O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ipv6only:5000/ocp4
source: quay.io/openshift-release-dev/ocp-v4.0-art-dev
- mirrors:
- testk-disconnecter.ipv6only:5000/ocp4
source: registry.ci.openshift.org/ocp-release