https://github.com/jiri-otoupal/abst
Manage your bastion sessions automatically, and simplify your connection to k8s cluster
https://github.com/jiri-otoupal/abst
bastion cli kubernetes kubernetes-cluster kubernetes-pod kubernetes-pods oci oracle oracle-cloud oracle-cloud-infrastructure python ssh ssh-tunnel
Last synced: 18 days ago
JSON representation
Manage your bastion sessions automatically, and simplify your connection to k8s cluster
- Host: GitHub
- URL: https://github.com/jiri-otoupal/abst
- Owner: jiri-otoupal
- License: mit
- Created: 2022-09-07T15:33:51.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T10:37:53.000Z (12 months ago)
- Last Synced: 2025-04-18T02:47:10.450Z (about 1 month ago)
- Topics: bastion, cli, kubernetes, kubernetes-cluster, kubernetes-pod, kubernetes-pods, oci, oracle, oracle-cloud, oracle-cloud-infrastructure, python, ssh, ssh-tunnel
- Language: Python
- Homepage:
- Size: 314 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Auto Bastion
Manage your bastion sessions automatically without
pain of creating them by clicking and copy pasting commands[](https://pypi.org/project/abst/)
[](https://pypi.org/project/abst/)
[](https://pepy.tech/project/abst)### Supported
#### OS
No specific requirements here, whatever runs Python
#### Cloud Providers
* **Oracle Cloud**
## Requirements
### Python
* 3.7+
#### Configuration of OCI SDK
* Add key in your Oracle cloud profile
* Generate new key
* Copy configuration file generated in your profile to `~/.oci/config`
* Replace path of your `*.pem` key on line with **#TODO**## Installing
### MacOS
On most MacOS machines there is `pip3` instead of `pip` **use pip3 for install**
Install and update using [pip](https://pip.pypa.io/en/stable/quickstart/):
```bash
pip install abstor
pip3 install abst
```## How to set up
* Use `abst ctx fill {context}` to fill your credentials for usage, you can find all the
credentials on
cloud provider site, leave context empty if you want to fill default
* Use `abst ctx generate {context}` to generate default config for context, leave context empty if you
want to generate to
default## Usage
###### Both commands do automatic reconnect on idle SSH Tunnel termination
* `abst create forward/managed {context}` for automatic Bastion session creation once
deleted, will keep your,
leave context empty if you want to use default
connection alive till you kill this script
* `abst do forward/managed {context}` alias for `abst create`
* `abst clean` for removal all the saved credentials
* `abst use {context}` for using different config that you had filled, `default` is the default
context in `creds.json`
* Use `abst ctx locate {context}` to locate your configs, leave context empty if you want to locate
default### Context commands
* `abst ctx list` to list contexts
* `abst ctx upgrade ` to upgrade context you can use `--all` flag to upgrade all contexts
* `abst ctx locate ` to get a full path of context
* `abst ctx share ` to copy context contents into clipboard and display it, you can use `--raw` to just
get json
* `abst ctx paste ` to paste contents into context file provided from name### Session commands
* `abst ssh` facilitates selecting an instance to connect to. The optional `port` argument can be specified partially; a
connection is established if only one match is found. Use `-n ` to filter a connection, where the name
can be a partial match. `abst` employs the `in` operator for searching and proceeds with SSH if a single matching
instance exists.### Parallel execution
If you are more demanding and need to have connection to your SSH Tunnels ready at all times
you can use parallel executed Bastions that currently work for full-auto forwarded settingChange local port in the setting to port that is unique to other configs, and it will be running on
all the added ports
Until you kill the `abst` command, it will automatically remove all generated Bastion sessions by
this program* `abst parallel add {context}` will add context from your `context folder` to stack that will be
executed
* `abst parallel remove {context}` will remove context from your `context folder` to stack that
will be executed
* `abst parallel run {context}` will run all the stacked contexts
* `abst parallel display` will display current stacked contexts
* `abst parallel list` will list all sets with contexts### Helm registry commands
* `abst helm login` will log you in with credentials set in config.json, you set these credentials
when running this command first time. Edit with flag --edit 1-n number is the index of credential
in list
* `abst helm push ` will push to specified remote branch, if more credentials preset it
will let you pick which one to use### Kubectl commands
* `abst pod ssh ` will ssh into pod with similar name, if multiple found it will display select
* `abst cp secret secret_namespace target_namespace source_namespace(optional)` this will copy
secret to target namespace, without providing source namespace it will use current as a source
Did I made your life less painful ?
Support my coffee addiction ;)
![]()