ChristianOlsen Posted January 24 Share Posted January 24 (edited) alfred-kubectl This workflow can be used to query a Kubernetes cluster and retrieve resources. Currently the following global resource types are supported: Node Namespace PV And namespaced resource types: Pod Deployment Configmap Secret Statefulset PVC Link to workflow Link to the Github repo. Usage The main workflow keyword is kube. The workflow will guide the user through a series of api calls that will end up with a list of resources of the chosen type. From here the user can use action modifiers to get further info about a resource (describe) using CMD+Enter. For resource type pod two additional action modifiers are available: OPTION+Enter: get pod logs CTL+Enter: open an interactive session in the pod using /bin/sh Another keyword (kube-context) can be used to quickly change context. This can also be set in the workflow configuration. Screenshots Initial 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 kubernetes The 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 with Homebrew and from binaries. Edited January 24 by ChristianOlsen Forgot link to workflow on Github Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now