/ dot_config / television / cable / k8s-deployments.toml
k8s-deployments.toml
 1  [metadata]
 2  name = "k8s-deployments"
 3  description = '''List and preview Deployments in a Kubernetes Cluster.
 4  
 5  The first source lists only from the current namespace, while the second lists from all.
 6  
 7  Keybindings
 8  
 9  Press `ctrl-d` to delete the selected Deployment.
10  '''
11  requirements = ["kubectl"]
12  
13  [source]
14  command = [
15    '''
16    kubectl get deployments -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{"\n"}}{{end}}'
17    ''',
18    '''
19    kubectl get deployments -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}}{{"\n"}}{{end}}' --all-namespaces
20    ''',
21  ]
22  output = "{1}"
23  
24  [preview]
25  command = "kubectl describe -n {0} deployments/{1}"
26  
27  [ui.preview_panel]
28  size = 60
29  
30  [keybindings]
31  ctrl-d = "actions:delete"
32  
33  [actions.delete]
34  description = "Delete the selected Deployment"
35  command = "kubectl delete -n {0} deployments/{1}"
36  mode = "execute"