Skip to main content

IBM Cloud Pak Operations CLI

Project description

IBM Cloud Pak Operations CLI

GitHub license GitHub issues GitHub stars Twitter URL GitHub Workflow Status (branch)

The IBM Cloud Pak Operations CLI provides basic functionality to manage Red Hat OpenShift clusters and IBM Cloud Pak for Data on various cloud platforms on top of the OpenShift CLI (oc) and the IBM Cloud Pak for Data CLI (cpd-cli).

For IBM-internal users, the IBM Cloud Pak Operations CLI additionally supports managing OpenShift clusters on Fyre.

Installation & Configuration

Installation

Python installation (3.8 or higher)

  • macOS (requires Homebrew):

    brew install python
    
  • Windows:

    • Winget:

      winget install --exact --id=Python.Python.3.11
      
    • Chocolatey

      choco install python
      

IBM Cloud Pak Operations CLI installation and update (latest release build)

Action Command
Installation (provides cpo command)
pip3 install cloud-pak-operations-cli
Update
pip3 install --upgrade cloud-pak-operations-cli

IBM Cloud Pak Operations CLI installation and update (latest development code)

Action Command
Installation (provides cpo command)
pip3 install git+https://git@github.com/IBM/cloud-pak-operations-cli.git
Update
cpo adm update-dev

Configuration

Dependency download

  • Downloads dependencies (IBM Cloud CLI, IBM Cloud Pak CLI, OpenShift CLI)

    cpo adm download-dependencies
    

Shell completion (Linux/macOS)

  • Bash: Add the following code to .bashrc:

    . $(cpo adm get-shell-completion-script-location --shell bash)
    
  • zsh: Add the following code to .zshrc:

    . $(cpo adm get-shell-completion-script-location --shell zsh)
    

Running inside a Docker container

The latest version of the IBM Cloud Pak Operations CLI on the master branch can also be run inside a Docker container:

docker run -it quay.io/ibm/cloud-pak-operations-cli:latest bash

Usage

Cluster management

Registering a generic OpenShift cluster

  • Register cluster:

    cpo cluster add --alias $ALIAS --server $SERVER --username $USERNAME --password $PASSWORD
    
  • Use cluster:

    cpo cluster use $ALIAS
    
  • Use cluster and log in using the OpenShift CLI:

    cpo cluster use $ALIAS --login
    

Registering a Red Hat OpenShift on IBM Cloud cluster

  • Log in to IBM Cloud:

    cpo ibmcloud login
    
  • Register cluster:

    cpo ibmcloud oc cluster add --alias $ALIAS --cluster-name $CLUSTER_NAME
    

Security management

  • Obtain an OAuth access token for the current OpenShift cluster:

    cpo cluster get-cluster-access-token
    
  • Manage the global pull secret:

    cpo cluster pull-secret
    

Storage management

  • Deploy Kubernetes NFS Subdir External Provisioner:

    cpo cluster install-nfs-storage-class
    
  • Deploy OpenShift Data Foundation (Linux and macOS):

    cpo cluster install-odf-storage-classes
    

    Note: Currently, opinionated configuration values are used for deploying the StorageCluster custom resource (see Ansible playbook).

IBM-internal

  • Enable Fyre-specific commands:

    cpo adm config set --key fyre_commands --value true
    

Development

Known issues

OpenShift CLI (macOS)

Unable to connect to the server: dial tcp: lookup  on …:53: no such host
  • GitHub issue

  • Workaround: Edit /etc/hosts and add IP address of OpenShift cluster

    • Example:

      9.AA.BBB.CC your.cluster.domain.com
      

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloud-pak-operations-cli-0.3.2.tar.gz (101.1 kB view hashes)

Uploaded Source

Built Distribution

cloud_pak_operations_cli-0.3.2-py3-none-any.whl (275.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page