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
The following must be installed before using kube-minion
.
When starting, this application does the following:
- Checks whether or not all the prerequisites are present
- Creates a load balancer for the Kubernetes dashboard, to be accessed at http://localhost:51515
- Starts the minikube tunnel
- Checks whether or not an initialization file (eg,
kube-minion.json
) is present - Starts the application's main loop
The main part of this application is basically a loop which executes the following steps:
- Build a list of options for the user to choose from
- Display these options
- Let the user select an option
- 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.
- Refresh options
- Start over from the top of the loop and rebuild the options list
- Create/Delete Kubernetes dashboard load balancer
- Creates or deletes the load balancer that exposes the Kubernetes dashboard at http://localhost:51515
- Start/Stop minikube tunnel
- Starts or stops the minikube tunnel
- Set the minikube tunnel bind address
- Sets the minikube tunnel bind address and restarts it if it is already started.
- 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
- List load balancers
- Lists the Kubernetes load balancers that have been created by
kube-minion
- Lists the Kubernetes load balancers that have been created by
- Delete load balancer
- Deletes a Kubernetes load balancer that has been created by
kube-minion
- Deletes a Kubernetes load balancer that has been created by
- Delete all load balancers
- Deletes all Kubernetes load balancers that have been created by
kube-minion
- Deletes all Kubernetes load balancers that have been created by
- 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
- List socat tunnels
- Lists the socat tunnels that have been created by
kube-minion
- Lists the socat tunnels that have been created by
- Delete socat tunnel
- Deletes a socat tunnel that has been created by
kube-minion
- Deletes a socat tunnel that has been created by
- Delete all socat tunnels
- Deletes all socat tunnels that have been created by
kube-minion
- Deletes all socat tunnels that have been created by
- Set socat default connect host
- 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
- List minikube mounts
- Lists the minikube mounts that have been created by
kube-minion
- Lists the minikube mounts that have been created by
- Delete minikube mount
- Deletes a minikube mount that has been created by
kube-minion
- Deletes a minikube mount that has been created by
- Delete all minikube mounts
- Deletes all minikube mounts that have been created by
kube-minion
- Deletes all minikube mounts that have been created by
- 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
- Exit without cleaning up
- Exits the application without the cleaning up done by Clean up and exit
- Clean up initialization file configuration and exit (available only when an
initialization file has been found)
- Undoes all the configuration that has been specified in the found initialization file
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
.
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:
- Load balancers to expose applications that run in minikube's Kubernetes cluster.
- socat tunnels
- The default socat connect host at the tunnel's receiving end
- minikube mounts
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
.