https://github.com/chrede88/alfred-kubectl
Alfred workflow for interacting with a Kubernetes cluster
https://github.com/chrede88/alfred-kubectl
alfred alfred-workflow alfred5-workflow kubernetes
Last synced: about 1 month ago
JSON representation
Alfred workflow for interacting with a Kubernetes cluster
- Host: GitHub
- URL: https://github.com/chrede88/alfred-kubectl
- Owner: chrede88
- License: mit
- Created: 2024-01-17T18:46:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-31T18:24:58.000Z (over 1 year ago)
- Last Synced: 2025-04-14T00:15:11.700Z (about 1 month ago)
- Topics: alfred, alfred-workflow, alfred5-workflow, kubernetes
- Language: Python
- Homepage:
- Size: 17.7 MB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alfred-kubectl
Alfred workflow that can interact with a Kubernetes cluster.
## Table of contents
- [Installation](#installation)
- [Usage](#usage)
- [Action Modifiers](#action-modifiers)
- [Workflow Screenshots](#workflow-screenshots)
- [Dependencies](#dependencies)## Installation
You can install this workflow by downloading the most recent release from [Github](https://github.com/chrede88/alfred-kubectl/releases) or get it through [Alfred Gallery](https://alfred.app/) (not possible yet).You will be asked to set two variables when first installing the workflow:
1) The path to your kube configuration file.
2) The name of the default kubernetes context you want to use.The default values will work out of the box for most people.
## Usage
The workflow has two keyword methods:
1) kube
2) kube-contextThe latter makes it easy to switch context. This can also be done by pressing `Configure Workflow...` under this workflow in Alfred preferences.
The main keyword `kube` will fire a series of api calls which guides the user through retrieving the resources on the cluster.
The supported global resource types are:
- Node
- Namespace
- PVThe supported namespaced resource types are:
- Pod
- Deployment
- Configmap
- Secret
- Statefulset
- PVC### Action Modifiers
More details about a resource can be displyed in a Terminal window by hitting ⌘⏎ on a selected resource.Pod resources have two further options:
1) ⌥⏎ displays the logs in a Terminal window.
2) ⌃⏎ opens an interactive session in a pod, using `/bin/sh`, in a Terminal window.### Workflow screenshots
Inital prompt - pick a resource type
Pick a namespace or choose all namespaces
Get resources
## Dependencies
This workflow relies on Python 3 and the following python packages (all shipped with the workflow):
- os
- sys
- json
- kubernetesThe workflow furthermore relies on the `Kubectl` CLI package for fetching details about the resources, pod logs and for executing code in pods (kubectl exec). Both resource details and pod logs will be moved away from kubectl in a later release, but opening interactive sessions into pods can't be done through the python client.
Kubectl can be [installed](https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/) with Homebrew and from binaries.