1.6.0 • Published 5 years ago

kubernodes v1.6.0

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

#KuberNodes

A convenience wrapper for kubectl, gcloud, gsutil and bq command line utils

!! Requires Docker !!

##Getting Started Guide

Step 1: Install kubernodes

npm install -g kubernodes

Step 2: Create a Google Cloud Service Account

  1. Browse to Gcloud IAM
  2. Click the "Create Service Account" Button
  3. Fill out the resulting form:
    1. Service Account Name: A label for the account
    2. Service Account ID: Client Email ID
    3. Check the box "Furnish a new private key"
    4. Click the "Create" button
    5. Save the downloaded json file in your working dir: ./.keys/[GCLOUD_PROJECT_ID]_service_key.json

Step 3: Generate your first Dockerfile

Run the following code in your cli

kn-dockerfile -p [GCLOUD_PROJECT_ID] -z [COMPUTE_ZONE] -c [CLUSTER_NAME] > .[KN_PROJECT_NAME]kube.docker

//example
kn-dockerfile -p sites -z us-central1-b -c kubernetes > .siteskube.docker

Note: Repeat this step for each project you want to configure

Step 4: Build all docker files

kn-build [DOCKERHUB_USER/ORGANIZATION]

Optional: Push your files to your repo kn-push [DOCKERHUB_USER/ORGANIZATION]

Step 5: Run some commands

//get all k8s pods
kn [KN_PROJECT_NAME] -r [DOCKERHUB_USER/ORG] -- get pods

//exec into a pod
kn [KN_PROJECT_NAME] -r [DOCKERHUB_USER/ORG] -- exec -it [POD_NAME] bash

//run a query in big query
kn [KN_PROJECT_NAME] -r [DOCKERHUB_USER/ORG] bq -- query 'select count(*) from publicdata:samples.shakespeare'

//enter a big query interactive shell
kn [KN_PROJECT_NAME] -r [DOCKERHUB_USER/ORG] bq -- shell

Step 6: Enjoy easily switching between all of your google projects, with Kubernodes!

##Special Features

Kubernodes Repo Environment: Instead of passing the -r flag with every kn command, you can set the following env var

export KUBERNODES_REPO=[DOCKERHUB_USER/ORGANIZATION]

Kubernodes Watch Mode: For commands that don't require tty or stdin you can use kubernodes watch mode. Watch mode will overtake your terminal and refresh the ouptut of your command every (n) seconds.

Here's how to watch your pods with a 5 second refresh rate

kn [KN_PROJECT_NAME] --watch 5 -- get pods

Kubernodes Proxy: We've made the kubectl proxy command easitly accesible as a positional argument in kubernodes. It currently allows all paths and binds to all ip's by default and is not configurable via this shortcut, but can still be invoked as you normally would any kn command.

Start your proxy

kn [KN_PROJECT_NAME] proxy
1.6.0

5 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago