Skip to content

Commit

Permalink
Kubectl command documentation (#154)
Browse files Browse the repository at this point in the history
* kubectl documentation

* update documentation: configure and shell commands

* Apply suggestions from code review

Co-authored-by: Angelo Fenoglio <angelofenoglio@gmail.com>

---------

Co-authored-by: Angelo Fenoglio <angelofenoglio@gmail.com>
  • Loading branch information
Franr and angelofenoglio authored Mar 20, 2023
1 parent 293028a commit 6cd62c2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/user-guide/leverage-cli/install-leverage-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Options:
Commands:
aws Run AWS CLI commands in a custom containerized environment.
credentials Manage AWS cli credentials.
kubectl Run Kubectl commands in a custom containerized environment.
project Manage a Leverage project.
run Perform specified task(s) and all of its dependencies.
terraform Run Terraform commands in a custom containerized...
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/leverage-cli/reference/basic-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Options:
Commands:
aws Run AWS CLI commands in a custom containerized environment.
credentials Manage AWS cli credentials.
kubectl Run Kubectl commands in a custom containerized environment.
project Manage a Leverage project.
run Perform specified task(s) and all of its dependencies.
terraform Run Terraform commands in a custom containerized...
Expand Down
52 changes: 52 additions & 0 deletions docs/user-guide/leverage-cli/reference/kubectl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Command: `kubectl`

!!! info "Regarding Leverage Toolbox versions"
To have this feature available, Leverage Toolbox versions `1.2.7-0.1.7` and up, or `1.3.5-0.1.7` and up must be used.

The `kubectl` command is a wrapper for a containerized installation of [kubectl](https://kubernetes.io/docs/reference/kubectl/). It provides the kubectl executable with specific configuration values required by Leverage.

It transparently handles authentication, whether it is Multi-Factor or via Single Sign-On, on behalf of the user in the commands that require it. SSO Authentication takes precedence over MFA when both are active.

The sub-commands can only be run at **layer** level and will not run anywhere else in the project.
The sub-command `configure` can only be run at an **EKS cluster layer** level. Usually called `cluster`.

The command can also be invoked via its shortened version `kc`.

---
## `run`

### Usage
``` bash
leverage kubectl [commands] [arguments]
```

Equivalent to `kubectl`.

All arguments given are passed as received to kubectl.

**Example:**

```bash
leverage kubectl get pods --namespace monitoring
```

---
## `shell`

### Usage
``` bash
leverage kubectl shell
```

Open a shell into the Kubectl container in the current directory.

---
## `configure`

### Usage
``` bash
leverage kubectl configure
```

Add the cluster from the EKS layer into your kubectl config file.
Equivalent to `aws eks update-kubeconfig ...`.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ nav:
- layers: "user-guide/leverage-cli/reference/terraform/layers.md"
- tfautomv: "user-guide/leverage-cli/reference/tfautomv.md"
- run: "user-guide/leverage-cli/reference/run.md"
- kubectl: "user-guide/leverage-cli/reference/kubectl.md"
- Extending Leverage:
- Overview: "user-guide/leverage-cli/extending-leverage/index.md"
- build.env : "user-guide/leverage-cli/extending-leverage/build.env.md"
Expand Down

0 comments on commit 6cd62c2

Please sign in to comment.