LATEST VERSION: v1.1 - RELEASE NOTES
Pivotal Container Service v1.1

PKS CLI

Page last updated:

This topic describes how to use the Pivotal Container Service Command Line Interface (PKS CLI) to interact with the PKS API.

The PKS CLI is used to create, manage, and delete Kubernetes clusters. To deploy workloads to a Kubernetes cluster created using the PKS CLI, use the Kubernetes CLI, kubectl.

Current Version: 1.1.0-build297

pks login

Login to PKS

Synopsis

The login command requires -a to target the IP of your PKS API, -u for username and -p for password

pks login [flags]

Examples

pks login -a <API> -u <USERNAME> -p <PASSWORD> [--ca-cert <PATH TO CERT> | -k]

Options

  -a, --api string              The PKS API server URI
      --ca-cert string          Path to CA Cert for PKS API
  -h, --help                    help for login
  -p, --password string         Password
  -k, --skip-ssl-verification   Skip SSL Verification
  -u, --username string         Username

pks get-credentials

Allows you to connect to a cluster and use kubectl

Synopsis

Run this command in order to update a kubeconfig file so you can access the cluster through kubectl

pks get-credentials <CLUSTER-NAME> [flags]

Examples

pks get-credentials my-cluster

Options

-h, --help   help for get-credentials

pks cluster

View the details of the cluster

Synopsis

Run this command to see details of your cluster such as name, host, port, ID, number of worker nodes, last operation, etc.

pks cluster [flags]

Examples

pks cluster my-cluster

Options

  -h, --help   help for cluster
      --json   Return the PKS-API output as json

pks clusters

Show all clusters created with PKS

Synopsis

This command describes the clusters created via PKS, and the last action taken on the cluster

pks clusters [flags]

Examples

pks clusters

Options

  -h, --help   help for clusters
      --json   Return the PKS-API output as json

pks create-cluster

Creates a kubernetes cluster, requires cluster name and an external host name

Synopsis

Create-cluster requires a cluster name, as well as an external hostname. External hostname can be a loadbalancer, from which you access your kubernetes API (aka, your cluster control plane)

pks create-cluster <CLUSTER-NAME> [flags]

Examples

pks create-cluster my-cluster --external-hostname example.hostname --plan production

Options

  -e, --external-hostname string   Address from which to access Kubernetes API
  -h, --help                       help for create-cluster
      --json                       Return the PKS-API output as json
      --non-interactive            Don't ask for user input
  -n, --num-nodes string           Number of worker nodes
  -p, --plan string                Preconfigured plans. Run pks plans for more details
      --wait                       Wait for the operation to finish

pks delete-cluster

Deletes a kubernetes cluster, requires cluster name

Synopsis

Delete-cluster requires a cluster name.

pks delete-cluster <CLUSTER-NAME> [flags]

Examples

pks delete-cluster my-cluster

Options

  -h, --help              help for delete-cluster
      --non-interactive   Don't ask for user input
      --wait              Wait for the operation to finish

pks plans

View the preconfigured plans available

Synopsis

This command describes the preconfigured plans available

pks plans [flags]

Examples

pks plans

Options

  -h, --help   help for plans
      --json   Return the PKS-API output as json

pks resize

Increases the number of worker nodes for a cluster

Synopsis

Resize requires a cluster name, and the number of desired worker nodes. Users can only scale UP clusters, to a maximum of 50 worker nodes and not scale down By default, the resize command prompts for interactive confirmation.

pks resize <CLUSTER-NAME> [flags]

Examples

pks resize my-cluster --num-nodes 5

Options

  -h, --help              help for resize
      --json              Return the PKS-API output as json. Only applicable when used with --wait flag
      --non-interactive   Don't ask for user input
  -n, --num-nodes int32   Number of worker nodes (default 1)
      --wait              Wait for the operation to finish

pks logout

Logs user out of the PKS API

Synopsis

Logs user out of the PKS API. Does not remove kubeconfig credentials or kubectl access.

pks logout [flags]

Examples

pks logout 

Options

-h, --help   help for logout

Please send any feedback you have to pks-feedback@pivotal.io.

Create a pull request or raise an issue on the source for this page in GitHub