prow-cluster-operation

command
v0.0.0-...-9fda5bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

README

prow-cluster-operation

prow-cluster-operation is a tool for creating, deleting, getting a GKE cluster

Prerequisite

  • GOOGLE_APPLICATION_CREDENTIALS set

Usage

This tool can be invoked from command line with following parameters:

  • --min-nodes: minumum number of nodes, default 1
  • --max-nodes: maximum number of nodes, default 3
  • --node-type: GCE node type, default "n1-standard-4"
  • --region: GKE region, default "us-central1"
  • --zone: GKE zone, default empty
  • --project: GCP project, default empty
  • --name: cluster name, default empty
  • --backup-regions: backup regions to be used if cluster creation in primary region failed, comma separated list, default "us-west1,us-east1"
  • --addons: GKE addons, comma separated list, default empty

Flow

Create

  1. Acquiring cluster if kubeconfig already points to it

  2. Get GCP project name if not provided as a parameter:

    • [In Prow] Acquire from Boskos
    • [Not in Prow] Read from gcloud config

    Failed obtaining project name will fail the tool

  3. Get default cluster name if not provided as a parameter

  4. Delete cluster if cluster with same name and location already exists in GKE

  5. Create cluster

  6. Write cluster metadata to ${ARTIFACT}/metadata.json

Delete

  1. Acquiring cluster if kubeconfig already points to it
  2. If cluster name is defined then getting cluster by its name
  3. If no cluster is found from previous step then it fails
  4. Delete:
    • [In Prow] Release Boskos project
    • [Not in Prow] Delete cluster

Get

  1. Acquiring cluster if kubeconfig already points to it
  2. If cluster name is defined then getting cluster by its name
  3. If no cluster is found from previous step then it fails

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL