Giter Site home page Giter Site logo

get-kube's Introduction

get-kube

get-kube is a CLI tool designed to retrieve Kubernetes authentication tokens from various environments and update the local .kube/config file. It supports EKS clusters, EC2-hosted Kubernetes and Kind clusters.

Table of Contents

Prerequisites

Dependencies

Before using get-kube, ensure you have the following tools installed:

  • Kind: For running local Kubernetes clusters using Docker container nodes.
  • AWS CLI: Required for interacting with Amazon EKS and EC2.
  • Kubectl: Kubernetes command-line tool.

You can install these dependencies using package managers like apt for Linux, brew for macOS, or by downloading them from their respective official websites.

Setup

  • AWS Account: Ensure you have an AWS account and are authenticated.
  • SSH Private key: Ensure you have SSH Private key for your instances.
  • Environment Variables: Set up the following environment variables:
    • AWS_ACCESS_KEY_ID: Your AWS access key.
    • AWS_SECRET_ACCESS_KEY: Your AWS secret key.
    • AWS_DEFAULT_REGION: The default AWS region (e.g., us-west-1).

Usage

EKS

To fetch tokens from all EKS clusters you have access to:

get-kube eks

EC2

To fetch tokens from a Kubernetes cluster hosted on an EC2 instance, provide the master node's name, IP, or FQDN:

get-kube ec2 <master-node-name/IP/FQDN>

Kind

To fetch tokens from all local Kind clusters:

get-kube kind

Building and Installation

Linux

To build for Linux:

make build

After building, make the binary executable:

chmod a+x ./dist/get-kube_linux_amd64/get-kube

Then, install the binary:

sudo mv ./dist/get-kube_linux_amd64/get-kube /usr/local/bin/

macOS

To build for macOS:

make build

After building, make the binary executable:

chmod a+x ./dist/get-kube_darwin_arm64/get-kube

Then, install the binary:

sudo mv ./dist/get-kube_darwin_arm64/get-kube /usr/local/bin/

Extending the Code

If you wish to extend the functionality of get-kube, follow these steps:

  1. Setup the Development Environment: Ensure you have Go installed and set up on your machine.
  2. Clone the Repository: git clone https://github.com/hemzaz/get-kube.git
  3. Navigate to the Code Directory: cd get-kube
  4. Make Changes: Add new features or modify existing ones in the pkg directory or the main application in the cmd directory.
  5. Build and Test: Use the provided Makefile to build and test your changes.
  6. Contribute: If you believe your changes could benefit others, consider creating a pull request to merge your changes back into the main repository.

Authored by: hemzaz the frogodile 🐸🐊

get-kube's People

Contributors

hemzaz avatar

Stargazers

Yuki Dvir avatar

Watchers

 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.