Skip to content

Commit 7deb202

Browse files
sbordeyneSimon Bordeynederailed
authored
plugins: add a plugin to start an alpine:latest container in current context/namespace (#3265)
* plugins: add a plugin to start an alpine:latest container in current context/namespace * start-alpine: Update plugins README * add: plugins root key to address lint issues, kubectl annotation for default container * removed label that disables istio's sidecar injection pattern --------- Co-authored-by: Simon Bordeyne <[email protected]> Co-authored-by: Fernand Galiana <[email protected]>
1 parent 8807dc0 commit 7deb202

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

plugins/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Following is an example of some plugin files in this directory. Other files are
2424
| szero.yaml | Temporarily scale down/up all deployments, statefulsets, and daemonsets | namespaces | Shift-d/u | [szero](https://github.com/jadolg/szero) |
2525
| trace-dns.yaml | Trace DNS resolution using Inspektor Gadget (4) | containers/pods/nodes | Shift-d | |
2626
| vector-dev-top.yaml | Run `vector top` in vector.dev container | pods/container | h | [vector top](https://vector.dev/highlights/2020-12-23-vector-top/) |
27+
| start-alpine.yaml | Starts a deployment for the `alpine:latest` docker image in the current namespace/context | deployments/pods | Ctrl-T | |
2728

2829
[1]: https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-container
2930
[2]: https://github.com/nicolaka/netshoot

plugins/start-alpine.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
plugins:
2+
start-alpine-pod:
3+
shortCut: Ctrl-T
4+
confirm: true
5+
description: "Start an alpine:latest pod in current context/namespace"
6+
scopes:
7+
- pods
8+
- deployments
9+
command: bash
10+
background: true
11+
args:
12+
- -c
13+
- |
14+
echo '{"apiVersion": "apps/v1", "kind": "Deployment", "metadata": {"name": "alpine", "labels": {"app": "alpine", "debug": "1"}}, "spec": {"selector": {"matchLabels": {"app": "alpine"}}, "replicas": 1, "template": {"metadata": {"labels": {"app": "alpine", "debug": "1"}, "annotations": {"kubectl.kubernetes.io/default-container": "alpine"}}, "spec": {"containers": [{"name": "alpine", "image": "alpine:latest", "imagePullPolicy": "Always", "securityContext": {"runAsUser": 0, "runAsGroup": 0}, "stdin": true, "tty": true, "stdinOnce": true, "terminationMessagePath": "/dev/termination-log", "terminationMessagePolicy": "File", "resources": {"requests": {"cpu": "100m", "memory": "100Mi"}, "limits": {"cpu": "100m", "memory": "100Mi"}}}], "restartPolicy": "Always"}}}}' | kubectl apply -f - --context $CONTEXT --namespace $NAMESPACE

0 commit comments

Comments
 (0)