Code Monkey home page Code Monkey logo

kube-minion's Introduction

kube-minion

A console application which is meant to be used with minikube and facilitates:

  • Exposing the Kubernetes dashboard through a load balancer service
  • Starting the minikube tunnel in the background
  • Setting up load balancers for exposing applications from inside a Kubernetes cluster
  • Setting up socat tunnels
  • Mounting directories from minikube's host onto the minikube's filesystem

Prerequisites

The following must be installed before using kube-minion.

How-to

When starting, this application does the following:

  1. Checks whether or not all the prerequisites are present
  2. Creates a load balancer for the Kubernetes dashboard, to be accessed at http://localhost:51515
  3. Starts the minikube tunnel
  4. Checks whether or not an initialization file (eg, kube-minion.json) is present
  5. Starts the application's main loop

The main part of this application is basically a loop which executes the following steps:

  1. Build a list of options for the user to choose from
  2. Display these options
  3. Let the user select an option
  4. Execute the function that is related with the selected option

The options menu can be refreshed by selecting option 0.

The application ignores Ctrl-C (SIGINT), so that the user has to explicitly choose whether to clean up or not when exiting the application.

Options

  1. Refresh options
    • Start over from the top of the loop and rebuild the options list
  2. Create/Delete Kubernetes dashboard load balancer
  3. Start/Stop minikube tunnel
  4. Set the minikube tunnel bind address
    • Sets the minikube tunnel bind address and restarts it if it is already started.
  5. Create load balancer
    • Creates a Kubernetes load balancer to expose an application
    • This requires the minikube tunnel to also be running for the application to become reachable
  6. List load balancers
    • Lists the Kubernetes load balancers that have been created by kube-minion
  7. Delete load balancer
    • Deletes a Kubernetes load balancer that has been created by kube-minion
  8. Delete all load balancers
    • Deletes all Kubernetes load balancers that have been created by kube-minion
  9. Create socat tunnel
    • Creates a socat tunnel
    • This is useful when trying to access an application from the Windows environment while the application has been proxied inside WSL
  10. List socat tunnels
    • Lists the socat tunnels that have been created by kube-minion
  11. Delete socat tunnel
    • Deletes a socat tunnel that has been created by kube-minion
  12. Delete all socat tunnels
    • Deletes all socat tunnels that have been created by kube-minion
  13. Set socat default connect host
    • Sets the default socat connect host for connecting to the receiving end of the socat tunnel
    • By default, this is localhost
    • As an example, this can be used to configure kube-minion to use the required WSL interface by default
  14. Create minikube mount
    • Creates a minikube mount
    • As an example, this can be used to mount a configuration or source code directory inside a pod
  15. List minikube mounts
  16. Delete minikube mount
  17. Delete all minikube mounts
  18. Clean up and exit
    • Deletes the load balancer that exposes the Kubernetes dashboard at http://localhost:51515
    • Deletes all Kubernetes load balancers that have been created by kube-minion
    • Deletes all socat tunnels that have been created by kube-minion
    • Deletes all minikube mounts that have been created by kube-minion
    • Exits the application
  19. Exit without cleaning up
    • Exits the application without the cleaning up done by Clean up and exit
  20. Clean up initialization file configuration and exit (available only when an initialization file has been found)

Configuration

To see the available command line options, use kube-minion -h.

The -p | --dashboard-port command line parameter sets the port on which to expose the Kubernetes dashboard load balancer service.

The -f | --initialization-file-path command line parameter sets the initialization file from which to read initial configuration. When used, the KUBE_MINION_ENVIRONMENT environment variable is not considered.

Additionally, the application can be configured with an initialization file.

This file is a JSON file for which, a schema has been provided.

This schema exists in file kube-minion.schema.json and an exhaustive template exists in file kube-minion.template.json.

Initialization file

The initialization file is expected to be found in the same directory as the one in which kube-minion has been started in.

This file can configure the following:

Environment variable KUBE_MINION_ENVIRONMENT

This environment variable makes kube-minion search for an initialization file with a name of kube-minion.$KUBE_MINION_ENVIRONMENT.json, instead of the default name of kube-minion.json.

kube-minion's People

Contributors

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