Giter Site home page Giter Site logo

highwayoflife / kube-manager Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 15 KB

Manage all your Kubernetes clusters with one container with all your favorite CLI tools

Shell 52.26% Dockerfile 26.46% Makefile 7.27% Python 14.02%
kubectl kubernetes docker k9s kubectx kube-manager kubernetes-management kubie fluxcd fluxctl

kube-manager's Introduction

Kube Manager

Access all of your Kubernetes Clusters with one container of all your favorite Kubernetes CLI tools. Negates the need to configure a workstation or environment to manage clusters. Ease onboarding kubectl access for all of your SRE / DevOps Engineers. Allows easy creation of a kube config from a manifest file.

Todo

  • Use GoLang instead of Python for the kubeconfig generation
  • Support editing the kube config within the KUBECONFIG environment var
  • Expand usage manifest examples
  • Create k9s base config? -- or persist across containers/sessions
  • Persist container command history across containers/sessions
  • Manifest certificates can point to URL, relative path, or absolute path of certificate file that is retrieved (copied) into the local repo.

Installation

  1. Clone this repo.
  2. Configure the cluster_manifest.yaml file with all the clusters you need access to.
  3. Run make generate to generate a kube_config.yaml file.
    • This can be used locally or within the Docker container.
    • Locally on your workstation using export KUBECONFIG=$PWD/kube_config.yaml
    • Within a Docker container by running make run

Note:

You can combine multiple kube configs using the following command:

export KUBECONFIG=$PWD:kube_config.yaml:$HOME/.kube/config

To persist this config across terminal sessions, place the export command in your .bash_profile or .zshrc file.

Usage

  • Run make build to rebuild the container.
  • Run make generate to regenerate the kube_config.yaml from the cluster_manifest.yaml at any time.
  • Run make run to run the container.

The container will load in the kube config from the value of the KUBECONFIG environment variable if it exists. If not, it will load the generated kube_config.yaml. Therefore, you can use any kube config within the kubectl container to manage that cluster.

Project Manifest (local)

  • cluster_manifest.yaml

manifest spec

This example shows with using with an Azure OIDC provider

clusters:
  - cluster:
      certificate-authority: ./certs/<cluster-1-cert-ca.cert>
      server: https://<cluster-1-ip-or-hostname>
    name: cluster-1
  - cluster:
      certificate-authority: ./certs/<cluster-2-cert-ca.cert>
      server: https://<cluster-2-ip-or-hostname>
    name: cluster-2
  - cluster:
      certificate-authority: ./certs/<cluster-3-cert-ca.cert>
      server: https://<cluster-3-ip-or-hostname>
    name: cluster-3
auth-provider:
  config:
    apiserver-id: <api-server-app-id>
    client-id: <client-id>
    environment: AzurePublicCloud
    tenant-id: <tenant-id>
  name: azure

Components

3 Scenarios. Problem Statements - what are we trying to solve with this container?

  1. I have a fully configured environment, but need cluster access
    • I need cluster access
    • I have my own kubectl/k9s
    • I care about Tooling component, and project manifest
    • Maybe I want the kube config to be optionally stored in ~/.kube/config
  2. I don't want a fully configured environment to manage my clusters
    • I need cluster access
    • I don't have my own kubectl/k9s
    • I care about Upstream (Docker), Tooling, and Project
  3. I have a kube-config, but just want k8s tooling.
    • I don't need cluster access created for me
    • I have my own kube config
    • I don't have my own kubectl/k9s
    • I care about: Upstream tools (Docker)

Included Tools

This repo contains an image build for managing Kubernetes clusters using the following tools:

  • kubectl - Kubernetes CLI tool
  • k9s - Provides a terminal UI to interact with your Kubernetes clusters.
  • kubectx - Kubernetes config context utility
  • kubens - Kubernetes context-namespace utility
  • kubie - Improved and expanded kubectx/ns alternative
  • fluxctl - FluxCD CTL tool
  • kube-ps1 - Kubernetes prompt

kube-manager's People

Contributors

highwayoflife avatar

Watchers

 avatar  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.