Skip to content

Commit

Permalink
Merge pull request #60 from Ramilito/feat/use_kube_rs_for_config_mngmt
Browse files Browse the repository at this point in the history
feat: sessions for namespaces
  • Loading branch information
Ramilito authored Oct 20, 2024
2 parents 1a0ccc0 + bf34d6a commit aeeb250
Show file tree
Hide file tree
Showing 13 changed files with 1,932 additions and 648 deletions.
29 changes: 18 additions & 11 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Probably most of the speed gains are because I am bypassing kubectl and just edi
#### Binary
Download and extract the binary.
```zsh
KUBESESS_VERSION=1.2.11 && \
KUBESESS_VERSION=2.0.0 && \
KUBESESS_OS=x86_64-unknown-linux-gnu && \
wget "https://github.com/Ramilito/kubesess/releases/download/${KUBESESS_VERSION}/kubesess_${KUBESESS_VERSION}_${KUBESESS_OS}.tar.gz" && \
mkdir -p $HOME/.kube/kubesess && tar zxpf kubesess_${KUBESESS_VERSION}_${KUBESESS_OS}.tar.gz -C $HOME/.kube/kubesess && \
Expand Down Expand Up @@ -159,7 +159,7 @@ export KUBECONFIG=$HOME/.kube/config:$HOME/.kube/config-demo:$HOME/.kube/config-

> :Note: **The order is important*: the first file will be the master config!
The second way is to let Kubesess handle it by adding one or more .yaml files under the $HOME/.kube folder and it will be automatically merged.
The second way is to let Kubesess handle it by adding one or more config files under the $HOME/.kube folder and it will be automatically merged.

#### Add information to prompt (there are other good tools for this, kube-ps1 and p10k)
```
Expand Down Expand Up @@ -202,8 +202,8 @@ RPROMPT='$(prompt_context)'
- [x] Add tab completion - https://github.com/clap-rs/clap/issues/1232
- [x] Add to brew
- [x] Add support for multiple .kube/config files
- [ ] Add support for multiple namespace per session
- [ ] Add error handling
- [x] Add support for multiple namespace per session
- [x] Add error handling

## Troubleshooting

Expand All @@ -224,14 +224,21 @@ This is how the ```$KUBECONFIG``` should look like (replace ```${USER}``` with y

This is how the generated file should look like:
```yaml
kind: Config
apiVersion: v1
current-context: docker-desktop
clusters:
- name: docker-desktop
cluster:
server: https://kubernetes.docker.internal:6443
certificate-authority-data: REDACTED
users:
- name: docker-desktop
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
contexts:
- context:
namespace: default
- name: docker-desktop
context:
cluster: docker-desktop
user: docker-desktop
name: docker-desktop
namespace: default
current-context: docker-desktop
```
5 changes: 0 additions & 5 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: tale/kubectl-action@v1
with:
base64-kube-config: ${{ inputs.KUBECONFIG }}
- name: Test
run: |
cargo check
cargo test --all
env:
KUBECONFIG: "/home/runner/.kube/config"
Loading

0 comments on commit aeeb250

Please sign in to comment.