Kubernetes
Hoop.dev can be configured to use the kubectl command line to manage resources and execute actions on workloads in Kubernetes.
Prerequisites
To get the most out of this guide, you will need to:
- Either create an account in our managed instance or deploy your own hoop.dev instance
- You must be your account administrator to perform the following commands
Connection Configuration
Name | Type | Description |
---|---|---|
KUBECONFIG | filesystem | A Kubeconfig File with permission to access the cluster |
Connection Setup
There are multiple ways to set up a connection to Kubernetes. It will depend how do you want users to interact with it.
Cluster administration is done through the kubectl
command line.
- Connection Setup
The command above will allow users to execute kubectl
commands from the Web Console.
This is useful for cluster administration tasks.
Note that xargs
is used to pass the command line arguments to kubectl
.
The input is passed to xargs
and then to kubectl
as arguments.
- Command Line Usage Example
Cluster administration is done through the kubectl
command line.
- Connection Setup
The command above will allow users to execute kubectl
commands from the Web Console.
This is useful for cluster administration tasks.
Note that xargs
is used to pass the command line arguments to kubectl
.
The input is passed to xargs
and then to kubectl
as arguments.
- Command Line Usage Example
One-off commands can be executed inside a container using the kubectl exec
command.
The Web Console would accept inputs that is executed inside the container.
- Connection Setup
The command above will allow users to execute commands inside the myapp
deployment.
This is useful for running scripts inside a container.
- Command Line Usage Example
Interactive access can be achieved by using the kubectl exec
command with the --stdin
and --tty
flags.
- Connection Setup
To narrow down the scope to a specific command, you can use the name of the command you want to run.
E.g.: -- bash
or -- rails console
.
In this example users could use any runtime command inside the myapp
deployment.
This will allow users to open an interactive shell inside the myapp
deployment.
This is useful for debugging or running commands interactively inside a container.
- Command Line Usage Example
Note that kubectl exec
is used with -tty
and --stdin
arguments.
These flags are required when using hoop connect