Giter Site home page Giter Site logo

kubernodes's Introduction

#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

kubernodes's People

Contributors

ericuldall avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.