openshift-cli-installer


Nameopenshift-cli-installer JSON
Version 3.0.9 PyPI version JSON
download
home_pageNone
SummaryCLI to install/uninstall Openshift clusters.
upload_time2025-01-27 06:54:03
maintainerNone
docs_urlNone
authorMeni Yakove
requires_python<4.0,>=3.9
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # openshift-cli-installer

Basic Openshift install CLI wrapper.  
The tool allows deploying or deletion of one or more clusters.  
The clusters can be deployed on different platforms; currently supported platforms: AWS IPI, AWS OSD, GCP OSD, ROSA and Hypershift.  
Each cluster can be provided with different configuration options, such as worker type, number of workers etc.

## Tools

- AWS IPI installation uses openshift-installer cli which is extracted from the cluster's target version.  
  The binary is taken from `quay.io/openshift-release-dev/ocp-release:<target version>`
- ROSA and Hypershift installation uses the latest ROSA CLI

### Container

Image locate at [openshift-cli-installer](https://quay.io/repository/redhat_msi/openshift-cli-installer)  
To pull the image: `podman pull quay.io/redhat_msi/openshift-cli-installer`

### Command line

##### Install inside poetry venv:

```bash
poetry install
poetry run python openshift_cli_installer/cli.py --help
```

##### Install as system cli:

```bash
pipx install .
```

For shell complition Add this to ~/.bashrc or ~/.zshrc:

```bash
eval "$(_OPENSHIFT_CLI_INSTALLER_COMPLETE=zsh_source openshift-cli-installer)"
```

### Create clusters from YAML file

User can create/destroy clusters by sending YAML file instead with CLI args
Example YAML file can be found [here](openshift_cli_installer/manifests/clusters.example.yaml)
pass `--clusters-yaml-config-file=.local/clusters-example.yaml` to use YAML file.
Action also can be passed to the CLI as `--action create/destroy` instead of specifying the action in the YAML file.
`--action create --clusters-yaml-config-file=.local/clusters-example.yaml`

### Global CLI configuration

- `--clusters-install-data-directory`: Clusters configurations are written to `<clusters-install-data-directory><platform><cluster name>`; write permissions are needed.
  - `<cluster directory>/auth` contains `kubeconfig` and `kubeadmin-password` files
  - Hypershift cluster:
    - `<cluster directory>/auth/api.login` contains the full login command to the cluster.
    - `<cluster directory>/auth/rosa-admin-password` contains the password for the `rosa-admin` user.
- `--parallel`: To create / destroy clusters in parallel
- Pass `--s3-bucket-name` (and optionally `--s3-bucket-path` and `--s3-bucket-object-name`) to back up <cluster directory> in an S3 bucket.
- `--ocm-token`: OCM token, defaults to `OCM_TOKEN` environment variable.
- `--must-gather-output-dir`: Path to must-gather output dir. `must-gather` will try to collect data when cluster installation fails and cluster can be accessed.

- AWS IPI clusters:

  - The installer output is saved in the `<cluster directory>`.
  - The data is used for cluster destroy.
  - `platform=aws`: Must pass in cluster parameters
  - `base-domain`: cluster parameter is mandatory
  - `auto-region=True`: Optional cluster parameter for assigning `region` param to a region which have the least number of VPCs.
  - `log_level`: Log level, defaults to `error` for cluster config to hide the openshift-installer logs which contains kubeadmin password.
  - `--registry-config-file`: registry-config json file path, can be obtained from [openshift local cluster](https://console.redhat.com/openshift/create/local)
  - `--docker-config-file`: Path to Docker config.json file, defaults to `~/.docker/config.json`. File must include token for `registry.ci.openshift.org`
  - `--ssh-key-file`: id_rsa file path, defaults to `/openshift-cli-installer/ssh-key/id_rsa.pub`

- GCP IPI clusters:

  - The installer output is saved in the `<cluster directory>`.
  - The data is used for cluster destroy.
  - `platform=gcp`: Must pass in cluster parameters
  - `base-domain`: cluster parameter is mandatory
  - `--gcp-service-account-file`: Path to GCP service account json. The file will be copied to specific path `~/.gcp/osServiceAccount.json` for installer .
    Follow [these](#steps-to-create-gcp-service-account-file) steps to get the ServiceAccount file.
  - `--registry-config-file`: registry-config json file path, can be obtained from [openshift local cluster](https://console.redhat.com/openshift/create/local)
  - `--docker-config-file`: Path to Docker config.json file, defaults to `~/.docker/config.json`. File must include token for `registry.ci.openshift.org`
  - `--ssh-key-file`: id_rsa file path, defaults to `/openshift-cli-installer/ssh-key/id_rsa.pub`

- ROSA / Hypershift clusters:

  - `platform=rosa`: Must pass in cluster parameters
  - `--aws-account-id`: AWS account ID for Hypershift clusters

- AWS OSD clusters:

  - `platform=aws-osd`: Must pass in cluster parameters
  - `auto-region=True`: Optional cluster parameter for assigning `region` param to a region which have the least number of VPCs.
  - `--aws-access-key-id`: AWS access key ID
  - `--aws-secret-access-key`: AWS secret access key
  - `--aws-account-id`: AWS account ID

- GCP OSD clusters:
  - `platform=gcp-osd`: Must pass in cluster parameters
  - `--gcp-service-account-file`: Path to GCP service account json.
    Follow [these](#steps-to-create-gcp-service-account-file) steps to get the ServiceAccount file.

### Cluster parameters

Every call to the openshift installer cli must have at least one `--cluster` option.

- Mandatory parameters:
  - name or name-prefix: The name of the cluster or the prefix of the name of the cluster, if prefix is used we generate a unique name up to 15 characters.
  - platform: The platform to deploy the cluster on (supported platforms are: aws, rosa and hypershift)
  - region: The region to deploy the cluster. Optional for AWS-IPI and AWS-OSD clusters, but mandatory for other (GCP, ROSA, Hypershift) clusters.
- Optional parameters:
  - Parameter names should be separated by semicolons (`;`)
  - To set cluster create / destroy timeout (not applicable for AWS IPI clusters), pass `--cluster ...timeout=1h'`; default is 60 minutes.
  - `timeout` and `expiration-time` format examples: `1h`, `30m`, `3600s`
  - `ocm-env`: OCM environment to deploy the cluster; available options: `stage` or `production` (defaults to `stage`). AWS-IPI clusters only use `production`.
  - AWS/GCP IPI:
    - To overwrite cluster config, check below manifests for parameters
      - [aws-install-config-template.j2](openshift_cli_installer/manifests/aws-install-config-template.j2)
      - [gcp-install-config-template.j2](openshift_cli_installer/manifests/gcp-install-config-template.j2)
    - Every parameter (marked with double curly brackets in the template) can be overwritten.
    - For example: to overwrite `{{ fips|default("false", true) }}` pass `--cluster '...fips=true'`
  - ROSA / Hypershift:
    - Every supported ROSA CLI create/delete parameter can be passed. Check `rosa create --help` for more details.
    - For example:
      - Pass `--cluster ...fips=true'` to enable FIPS
      - Pass `--cluster ...expiration-time=2h'` to have the cluster expiration time set to 2 hours
  - Hypershift:
    - Cluster VPC CIDR, public and private subnets can be configured from the CLI. Otherwise, values in [setup-vpc.tf](openshift_cli_installer/manifests/setup-vpc.tf) will be used.
      - To set `cidr`, pass `--cluster ...cidr=1.1.0.0/16'`
      - To set `private-subnets`, pass `--cluster ...private-subnets=10.1.1.0/24,10.1.2.0/24'`
      - To set `public-subnets`, pass `--cluster ...public-subnets=10.1.10.0/24,10.1.20.0/24'`

#### Steps to create GCP Service Account File

To create the file, create a service account and download it:

1.  Go to https://console.cloud.google.com/iam-admin/serviceaccounts?project=<project>
2.  Select the service account -> "Create Key"
3.  Select the Key Type as `JSON` and click Create

### ACM (Advanced Cluster Management)

Managed clusters (Rosa, AWS and OSD) can be deployed with ACM and attached to ACM hub.
To deploy ACM on cluster pass `--cluster ... acm=True`
To enable observability on the ACM enabled cluster pass `--cluster ... acm-observability=True`
Attach clusters to ACM cluster hub:

- Support only clusters that created during the run
- To attach cluster to this ACM hub pass `--cluster ... acm-clusters=mycluser1,mycluster2`
  - `mycluser1,mycluster2` needs to be sent with `--cluster ...` for the script to create them.

### Destroy clusters

`--destroy-clusters-from-install-data-directory`, `--destroy-clusters-from-s3-bucket` and `--destroy-clusters-from-install-data-directory-using-s3-bucket` must have:

```bash
  --ocm-token=$OCM_TOKEN \
  --registry-config-file=${HOME}/docker-secrets.json \
  --aws-access-key-id=${AWS_ACCESS_KEY_ID} \
  --aws-secret-access-key=${AWS_SECRET_ACCESS_KEY}
```

## Destroy clusters from clusters data directory

To destroy all clusters locate in `--clusters-install-data-directory` run:

```bash
podman run quay.io/redhat_msi/openshift-cli-installer \
  --destroy-clusters-from-install-data-directory \
  --clusters-install-data-directory=/openshift-cli-installer/clusters-install-data
```

## Destroy clusters from clusters data directory using s3 bucket stored in cluster_data.yaml

```bash
podman run quay.io/redhat_msi/openshift-cli-installer \
  --destroy-clusters-from-install-data-directory-using-s3-bucket \
  --clusters-install-data-directory=/openshift-cli-installer/clusters-install-data
```

## Destroy clusters from S3 bucket

To destroy all clusters from uploaded zip files in S3 bucket run:

```bash
podman run quay.io/redhat_msi/openshift-cli-installer \
  --destroy-clusters-from-s3-bucket \
  --s3-bucket-name="openshift-cli-installer" \
  --s3-bucket-path="openshift-ci"
```

To filter cluster pass `--destroy-clusters-from-s3-bucket-query` query:

```bash
podman run quay.io/redhat_msi/openshift-cli-installer--destroy-clusters-from-s3-bucket \
  --s3-bucket-name=openshift-cli-installer \
  --s3-bucket-path=install-folders \
  --destroy-clusters-from-s3-bucket-query="mycluster"
```

### Usages

```
podman run quay.io/redhat_msi/openshift-cli-installer --help
```

### Local run

Clone the [repository](https://github.com/RedHatQE/openshift-cli-installer)

```
git clone https://github.com/RedHatQE/openshift-cli-installer.git
```

Install [poetry](https://github.com/python-poetry/poetry)

Install [regctl](https://github.com/regclient/regclient)

Install Terraform [how-to](https://computingforgeeks.com/how-to-install-terraform-on-fedora/)

```bash
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
sudo dnf install terraform
```

Use `poetry run python openshift_cli_installer/cli.py` to execute the cli.

```
poetry install
poetry run python openshift_cli_installer/cli.py --help
```

### Create Clusters

Each command can be run via container `podman run quay.io/redhat_msi/openshift-cli-installer` or via poetry command `poetry run python openshift_cli_installer/cli.py`
When using the container pass:
`-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID`
`-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY`
`-v registry-config.json:/registry-config.json`
`-v ./clusters-install-data:/openshift-cli-installer/clusters-install-data`

#### One cluster

##### AWS/GCP IPI cluster

###### Versions

- Supported `streams` are: `stable`, `nightly`, `rc`, `ci` and `ec`, Supported architecture(s): `X86_64`
- If passed exact version this version will be used (if exists), Example: 3.14.9
- If passed partial version, latest version will be used, Example: 4.13 install 4.13.9 (latest)
- If passed `stream=nightly` and version 4.13, latest 4.13 nightly will be used.
  - stream should be passed as part on `--cluster`, `--cluster ...... stream=stable`

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action create \
    --registry-config-file=registry-config.json \
    --s3-bucket-name=openshift-cli-installer \
    --s3-bucket-path=install-folders \
    --s3-bucket-object-name=cluster-backup \
    --cluster 'name=ipi1;base-domain=gcp.interop.ccitredhat.com;platform=gcp;region=us-east1;version=4.14.0-ec.2;worker-flavor=custom-4-16384;log_level=info'
```

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action create \
    --registry-config-file=registry-config.json \
    --s3-bucket-name=openshift-cli-installer \
    --s3-bucket-path=install-folders \
    --cluster 'name=ipi2;base-domain=aws.interop.ccitredhat.com;platform=aws;auto-region=True;version=4.14.0-ec.2;worker-flavor= m5.4xlarge'
```

##### ROSA cluster

###### Versions

[Same for Hypershift clusters]

- Supported `channel-group` are: `stable`, `candidate`, and `nightly`.
- If passed exact version this version will be used (if exists), Example: 3.14.9
- If passed partial version, latest version will be used, Example: 4.13 install 4.13.9 (latest)
- If passed `channel-group=nightly` and version 4.13, latest 4.13 nightly will be used.
  - stream should be passed as part on `--cluster`, `--cluster ...... channel-group=stable`

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action create \
    --ocm-token=$OCM_TOKEN \
    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;compute-machine-type=m5.xlarge;replicas=2;channel-group=candidate;expiration-time=4h;timeout=1h;ocm-env=production
```

##### Hypershift cluster

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action create \
    --ocm-token=$OCM_TOKEN \
    --cluster 'name=hyper;platform=hypershift;region=us-west-2;version=4.13.4;compute-machine-type=m5.4xlarge;replicas=6;channel-group=candidate;expiration-time=4h;timeout=1h'
```

##### Multiple clusters

To run multiple clusters deployments in parallel pass -p,--parallel.

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action create \
    --registry-config-file=registry-config.json \
    --s3-bucket-name=openshift-cli-installer \
    --s3-bucket-path=install-folders \
    --cluster 'name=hyper1;platform=hypershift;region=us-west-2;version=4.13.4;compute-machine-type=m5.4xlarge;replicas=6;channel-group=candidate;expiration-time=2h;timeout=1h' \
    --ocm-token=$OCM_TOKEN \

    --cluster 'name=ipi1;base-domain=aws.interop.ccitredhat.com;platform=aws;region=us-east-2;version=4.14.0-ec.2;worker-flavor=m5.xlarge' \
    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;compute-machine-type=m5.xlarge;replicas=2;channel-group=candidate;expiration-time=4h;timeout=1h' \
    --parallel
```

### Destroy Clusters

#### One cluster

##### AWS IPI cluster

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action destroy \
    --ocm-token=$OCM_TOKEN \
    --cluster 'name=ipi1;region=us-east-2;version=4.14.0-ec.2;timeout=1h'
```

##### ROSA cluster

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action destroy \
    --ocm-token=$OCM_TOKEN \
    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;timeout=1h;ocm-env=production'
```

##### Hypershift cluster

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action destroy \
    --ocm-token=$OCM_TOKEN \
    --cluster 'name=hyper1;platform=hypershift;region=us-east-2;version=4.13.4;timeout=1h'
```

##### Multiple clusters

To run multiple clusters deletion in parallel pass -p,--parallel.

```
podman run quay.io/redhat_msi/openshift-cli-installer \
    --action destroy \
    --ocm-token=$OCM_TOKEN \
    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;timeout=1h' \
    --cluster 'name=hyper1;platform=rosa;region=us-east-2;version=4.13.4;timeout=1h' \
    --cluster 'name=ipi1;region=us-east-2;version=4.14.0-ec.2;timeout=1h'
```


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "openshift-cli-installer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Meni Yakove",
    "author_email": "myakove@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/86/c7/11aac6f9c7f207b143c706471df3b7b0d48fa5926ee34643d43fe2260db3/openshift_cli_installer-3.0.9.tar.gz",
    "platform": null,
    "description": "# openshift-cli-installer\n\nBasic Openshift install CLI wrapper.  \nThe tool allows deploying or deletion of one or more clusters.  \nThe clusters can be deployed on different platforms; currently supported platforms: AWS IPI, AWS OSD, GCP OSD, ROSA and Hypershift.  \nEach cluster can be provided with different configuration options, such as worker type, number of workers etc.\n\n## Tools\n\n- AWS IPI installation uses openshift-installer cli which is extracted from the cluster's target version.  \n  The binary is taken from `quay.io/openshift-release-dev/ocp-release:<target version>`\n- ROSA and Hypershift installation uses the latest ROSA CLI\n\n### Container\n\nImage locate at [openshift-cli-installer](https://quay.io/repository/redhat_msi/openshift-cli-installer)  \nTo pull the image: `podman pull quay.io/redhat_msi/openshift-cli-installer`\n\n### Command line\n\n##### Install inside poetry venv:\n\n```bash\npoetry install\npoetry run python openshift_cli_installer/cli.py --help\n```\n\n##### Install as system cli:\n\n```bash\npipx install .\n```\n\nFor shell complition Add this to ~/.bashrc or ~/.zshrc:\n\n```bash\neval \"$(_OPENSHIFT_CLI_INSTALLER_COMPLETE=zsh_source openshift-cli-installer)\"\n```\n\n### Create clusters from YAML file\n\nUser can create/destroy clusters by sending YAML file instead with CLI args\nExample YAML file can be found [here](openshift_cli_installer/manifests/clusters.example.yaml)\npass `--clusters-yaml-config-file=.local/clusters-example.yaml` to use YAML file.\nAction also can be passed to the CLI as `--action create/destroy` instead of specifying the action in the YAML file.\n`--action create --clusters-yaml-config-file=.local/clusters-example.yaml`\n\n### Global CLI configuration\n\n- `--clusters-install-data-directory`: Clusters configurations are written to `<clusters-install-data-directory><platform><cluster name>`; write permissions are needed.\n  - `<cluster directory>/auth` contains `kubeconfig` and `kubeadmin-password` files\n  - Hypershift cluster:\n    - `<cluster directory>/auth/api.login` contains the full login command to the cluster.\n    - `<cluster directory>/auth/rosa-admin-password` contains the password for the `rosa-admin` user.\n- `--parallel`: To create / destroy clusters in parallel\n- Pass `--s3-bucket-name` (and optionally `--s3-bucket-path` and `--s3-bucket-object-name`) to back up <cluster directory> in an S3 bucket.\n- `--ocm-token`: OCM token, defaults to `OCM_TOKEN` environment variable.\n- `--must-gather-output-dir`: Path to must-gather output dir. `must-gather` will try to collect data when cluster installation fails and cluster can be accessed.\n\n- AWS IPI clusters:\n\n  - The installer output is saved in the `<cluster directory>`.\n  - The data is used for cluster destroy.\n  - `platform=aws`: Must pass in cluster parameters\n  - `base-domain`: cluster parameter is mandatory\n  - `auto-region=True`: Optional cluster parameter for assigning `region` param to a region which have the least number of VPCs.\n  - `log_level`: Log level, defaults to `error` for cluster config to hide the openshift-installer logs which contains kubeadmin password.\n  - `--registry-config-file`: registry-config json file path, can be obtained from [openshift local cluster](https://console.redhat.com/openshift/create/local)\n  - `--docker-config-file`: Path to Docker config.json file, defaults to `~/.docker/config.json`. File must include token for `registry.ci.openshift.org`\n  - `--ssh-key-file`: id_rsa file path, defaults to `/openshift-cli-installer/ssh-key/id_rsa.pub`\n\n- GCP IPI clusters:\n\n  - The installer output is saved in the `<cluster directory>`.\n  - The data is used for cluster destroy.\n  - `platform=gcp`: Must pass in cluster parameters\n  - `base-domain`: cluster parameter is mandatory\n  - `--gcp-service-account-file`: Path to GCP service account json. The file will be copied to specific path `~/.gcp/osServiceAccount.json` for installer .\n    Follow [these](#steps-to-create-gcp-service-account-file) steps to get the ServiceAccount file.\n  - `--registry-config-file`: registry-config json file path, can be obtained from [openshift local cluster](https://console.redhat.com/openshift/create/local)\n  - `--docker-config-file`: Path to Docker config.json file, defaults to `~/.docker/config.json`. File must include token for `registry.ci.openshift.org`\n  - `--ssh-key-file`: id_rsa file path, defaults to `/openshift-cli-installer/ssh-key/id_rsa.pub`\n\n- ROSA / Hypershift clusters:\n\n  - `platform=rosa`: Must pass in cluster parameters\n  - `--aws-account-id`: AWS account ID for Hypershift clusters\n\n- AWS OSD clusters:\n\n  - `platform=aws-osd`: Must pass in cluster parameters\n  - `auto-region=True`: Optional cluster parameter for assigning `region` param to a region which have the least number of VPCs.\n  - `--aws-access-key-id`: AWS access key ID\n  - `--aws-secret-access-key`: AWS secret access key\n  - `--aws-account-id`: AWS account ID\n\n- GCP OSD clusters:\n  - `platform=gcp-osd`: Must pass in cluster parameters\n  - `--gcp-service-account-file`: Path to GCP service account json.\n    Follow [these](#steps-to-create-gcp-service-account-file) steps to get the ServiceAccount file.\n\n### Cluster parameters\n\nEvery call to the openshift installer cli must have at least one `--cluster` option.\n\n- Mandatory parameters:\n  - name or name-prefix: The name of the cluster or the prefix of the name of the cluster, if prefix is used we generate a unique name up to 15 characters.\n  - platform: The platform to deploy the cluster on (supported platforms are: aws, rosa and hypershift)\n  - region: The region to deploy the cluster. Optional for AWS-IPI and AWS-OSD clusters, but mandatory for other (GCP, ROSA, Hypershift) clusters.\n- Optional parameters:\n  - Parameter names should be separated by semicolons (`;`)\n  - To set cluster create / destroy timeout (not applicable for AWS IPI clusters), pass `--cluster ...timeout=1h'`; default is 60 minutes.\n  - `timeout` and `expiration-time` format examples: `1h`, `30m`, `3600s`\n  - `ocm-env`: OCM environment to deploy the cluster; available options: `stage` or `production` (defaults to `stage`). AWS-IPI clusters only use `production`.\n  - AWS/GCP IPI:\n    - To overwrite cluster config, check below manifests for parameters\n      - [aws-install-config-template.j2](openshift_cli_installer/manifests/aws-install-config-template.j2)\n      - [gcp-install-config-template.j2](openshift_cli_installer/manifests/gcp-install-config-template.j2)\n    - Every parameter (marked with double curly brackets in the template) can be overwritten.\n    - For example: to overwrite `{{ fips|default(\"false\", true) }}` pass `--cluster '...fips=true'`\n  - ROSA / Hypershift:\n    - Every supported ROSA CLI create/delete parameter can be passed. Check `rosa create --help` for more details.\n    - For example:\n      - Pass `--cluster ...fips=true'` to enable FIPS\n      - Pass `--cluster ...expiration-time=2h'` to have the cluster expiration time set to 2 hours\n  - Hypershift:\n    - Cluster VPC CIDR, public and private subnets can be configured from the CLI. Otherwise, values in [setup-vpc.tf](openshift_cli_installer/manifests/setup-vpc.tf) will be used.\n      - To set `cidr`, pass `--cluster ...cidr=1.1.0.0/16'`\n      - To set `private-subnets`, pass `--cluster ...private-subnets=10.1.1.0/24,10.1.2.0/24'`\n      - To set `public-subnets`, pass `--cluster ...public-subnets=10.1.10.0/24,10.1.20.0/24'`\n\n#### Steps to create GCP Service Account File\n\nTo create the file, create a service account and download it:\n\n1.  Go to https://console.cloud.google.com/iam-admin/serviceaccounts?project=<project>\n2.  Select the service account -> \"Create Key\"\n3.  Select the Key Type as `JSON` and click Create\n\n### ACM (Advanced Cluster Management)\n\nManaged clusters (Rosa, AWS and OSD) can be deployed with ACM and attached to ACM hub.\nTo deploy ACM on cluster pass `--cluster ... acm=True`\nTo enable observability on the ACM enabled cluster pass `--cluster ... acm-observability=True`\nAttach clusters to ACM cluster hub:\n\n- Support only clusters that created during the run\n- To attach cluster to this ACM hub pass `--cluster ... acm-clusters=mycluser1,mycluster2`\n  - `mycluser1,mycluster2` needs to be sent with `--cluster ...` for the script to create them.\n\n### Destroy clusters\n\n`--destroy-clusters-from-install-data-directory`, `--destroy-clusters-from-s3-bucket` and `--destroy-clusters-from-install-data-directory-using-s3-bucket` must have:\n\n```bash\n  --ocm-token=$OCM_TOKEN \\\n  --registry-config-file=${HOME}/docker-secrets.json \\\n  --aws-access-key-id=${AWS_ACCESS_KEY_ID} \\\n  --aws-secret-access-key=${AWS_SECRET_ACCESS_KEY}\n```\n\n## Destroy clusters from clusters data directory\n\nTo destroy all clusters locate in `--clusters-install-data-directory` run:\n\n```bash\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n  --destroy-clusters-from-install-data-directory \\\n  --clusters-install-data-directory=/openshift-cli-installer/clusters-install-data\n```\n\n## Destroy clusters from clusters data directory using s3 bucket stored in cluster_data.yaml\n\n```bash\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n  --destroy-clusters-from-install-data-directory-using-s3-bucket \\\n  --clusters-install-data-directory=/openshift-cli-installer/clusters-install-data\n```\n\n## Destroy clusters from S3 bucket\n\nTo destroy all clusters from uploaded zip files in S3 bucket run:\n\n```bash\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n  --destroy-clusters-from-s3-bucket \\\n  --s3-bucket-name=\"openshift-cli-installer\" \\\n  --s3-bucket-path=\"openshift-ci\"\n```\n\nTo filter cluster pass `--destroy-clusters-from-s3-bucket-query` query:\n\n```bash\npodman run quay.io/redhat_msi/openshift-cli-installer--destroy-clusters-from-s3-bucket \\\n  --s3-bucket-name=openshift-cli-installer \\\n  --s3-bucket-path=install-folders \\\n  --destroy-clusters-from-s3-bucket-query=\"mycluster\"\n```\n\n### Usages\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer --help\n```\n\n### Local run\n\nClone the [repository](https://github.com/RedHatQE/openshift-cli-installer)\n\n```\ngit clone https://github.com/RedHatQE/openshift-cli-installer.git\n```\n\nInstall [poetry](https://github.com/python-poetry/poetry)\n\nInstall [regctl](https://github.com/regclient/regclient)\n\nInstall Terraform [how-to](https://computingforgeeks.com/how-to-install-terraform-on-fedora/)\n\n```bash\nsudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo\nsudo dnf install terraform\n```\n\nUse `poetry run python openshift_cli_installer/cli.py` to execute the cli.\n\n```\npoetry install\npoetry run python openshift_cli_installer/cli.py --help\n```\n\n### Create Clusters\n\nEach command can be run via container `podman run quay.io/redhat_msi/openshift-cli-installer` or via poetry command `poetry run python openshift_cli_installer/cli.py`\nWhen using the container pass:\n`-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID`\n`-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY`\n`-v registry-config.json:/registry-config.json`\n`-v ./clusters-install-data:/openshift-cli-installer/clusters-install-data`\n\n#### One cluster\n\n##### AWS/GCP IPI cluster\n\n###### Versions\n\n- Supported `streams` are: `stable`, `nightly`, `rc`, `ci` and `ec`, Supported architecture(s): `X86_64`\n- If passed exact version this version will be used (if exists), Example: 3.14.9\n- If passed partial version, latest version will be used, Example: 4.13 install 4.13.9 (latest)\n- If passed `stream=nightly` and version 4.13, latest 4.13 nightly will be used.\n  - stream should be passed as part on `--cluster`, `--cluster ...... stream=stable`\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action create \\\n    --registry-config-file=registry-config.json \\\n    --s3-bucket-name=openshift-cli-installer \\\n    --s3-bucket-path=install-folders \\\n    --s3-bucket-object-name=cluster-backup \\\n    --cluster 'name=ipi1;base-domain=gcp.interop.ccitredhat.com;platform=gcp;region=us-east1;version=4.14.0-ec.2;worker-flavor=custom-4-16384;log_level=info'\n```\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action create \\\n    --registry-config-file=registry-config.json \\\n    --s3-bucket-name=openshift-cli-installer \\\n    --s3-bucket-path=install-folders \\\n    --cluster 'name=ipi2;base-domain=aws.interop.ccitredhat.com;platform=aws;auto-region=True;version=4.14.0-ec.2;worker-flavor= m5.4xlarge'\n```\n\n##### ROSA cluster\n\n###### Versions\n\n[Same for Hypershift clusters]\n\n- Supported `channel-group` are: `stable`, `candidate`, and `nightly`.\n- If passed exact version this version will be used (if exists), Example: 3.14.9\n- If passed partial version, latest version will be used, Example: 4.13 install 4.13.9 (latest)\n- If passed `channel-group=nightly` and version 4.13, latest 4.13 nightly will be used.\n  - stream should be passed as part on `--cluster`, `--cluster ...... channel-group=stable`\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action create \\\n    --ocm-token=$OCM_TOKEN \\\n    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;compute-machine-type=m5.xlarge;replicas=2;channel-group=candidate;expiration-time=4h;timeout=1h;ocm-env=production\n```\n\n##### Hypershift cluster\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action create \\\n    --ocm-token=$OCM_TOKEN \\\n    --cluster 'name=hyper;platform=hypershift;region=us-west-2;version=4.13.4;compute-machine-type=m5.4xlarge;replicas=6;channel-group=candidate;expiration-time=4h;timeout=1h'\n```\n\n##### Multiple clusters\n\nTo run multiple clusters deployments in parallel pass -p,--parallel.\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action create \\\n    --registry-config-file=registry-config.json \\\n    --s3-bucket-name=openshift-cli-installer \\\n    --s3-bucket-path=install-folders \\\n    --cluster 'name=hyper1;platform=hypershift;region=us-west-2;version=4.13.4;compute-machine-type=m5.4xlarge;replicas=6;channel-group=candidate;expiration-time=2h;timeout=1h' \\\n    --ocm-token=$OCM_TOKEN \\\n\n    --cluster 'name=ipi1;base-domain=aws.interop.ccitredhat.com;platform=aws;region=us-east-2;version=4.14.0-ec.2;worker-flavor=m5.xlarge' \\\n    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;compute-machine-type=m5.xlarge;replicas=2;channel-group=candidate;expiration-time=4h;timeout=1h' \\\n    --parallel\n```\n\n### Destroy Clusters\n\n#### One cluster\n\n##### AWS IPI cluster\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action destroy \\\n    --ocm-token=$OCM_TOKEN \\\n    --cluster 'name=ipi1;region=us-east-2;version=4.14.0-ec.2;timeout=1h'\n```\n\n##### ROSA cluster\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action destroy \\\n    --ocm-token=$OCM_TOKEN \\\n    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;timeout=1h;ocm-env=production'\n```\n\n##### Hypershift cluster\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action destroy \\\n    --ocm-token=$OCM_TOKEN \\\n    --cluster 'name=hyper1;platform=hypershift;region=us-east-2;version=4.13.4;timeout=1h'\n```\n\n##### Multiple clusters\n\nTo run multiple clusters deletion in parallel pass -p,--parallel.\n\n```\npodman run quay.io/redhat_msi/openshift-cli-installer \\\n    --action destroy \\\n    --ocm-token=$OCM_TOKEN \\\n    --cluster 'name=rosa1;platform=rosa;region=us-east-2;version=4.13.4;timeout=1h' \\\n    --cluster 'name=hyper1;platform=rosa;region=us-east-2;version=4.13.4;timeout=1h' \\\n    --cluster 'name=ipi1;region=us-east-2;version=4.14.0-ec.2;timeout=1h'\n```\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "CLI to install/uninstall Openshift clusters.",
    "version": "3.0.9",
    "project_urls": {
        "Documentation": "https://github.com/RedHatQE/openshift-cli-installer/blob/main/README.md",
        "Homepage": "https://github.com/RedHatQE/openshift-cli-installer",
        "Repository": "https://github.com/RedHatQE/openshift-cli-installer"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "86c711aac6f9c7f207b143c706471df3b7b0d48fa5926ee34643d43fe2260db3",
                "md5": "b37fe71547eafb1030a3ffc65cb24aa1",
                "sha256": "e11d3736c1fb57d78bb3de16dd7e7b5a79090a4b5267c8959cd4df13259e477d"
            },
            "downloads": -1,
            "filename": "openshift_cli_installer-3.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "b37fe71547eafb1030a3ffc65cb24aa1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 43227,
            "upload_time": "2025-01-27T06:54:03",
            "upload_time_iso_8601": "2025-01-27T06:54:03.728427Z",
            "url": "https://files.pythonhosted.org/packages/86/c7/11aac6f9c7f207b143c706471df3b7b0d48fa5926ee34643d43fe2260db3/openshift_cli_installer-3.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-27 06:54:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RedHatQE",
    "github_project": "openshift-cli-installer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "openshift-cli-installer"
}
        
Elapsed time: 1.02843s