Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MAIN-2842] added kubectl action in runner #1677

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

Avi-Robusta
Copy link
Contributor

Screen Shot 2025-01-05 at 14 43 59
example config

customPlaybooks:
- actions:
  - create_finding:
      aggregation_key: "DeploymentScaledDown"
      title: "Pod $name on namespace $namespace crashed 3 times"
  - kubectl_command:
      command: kubectl scale --replicas=0 deployment/$(kubectl get pod $name -n $namespace -o jsonpath='{.metadata.ownerReferences[?(@.kind=="ReplicaSet")].name}' | sed 's/-[a-f0-9]\{9,10\}$//') -n $namespace
  name: DeploymentScaledDown
  triggers:
  - on_pod_crash_loop:
      restart_count: 3
      
runner:
  customClusterRoleRules: 
  - apiGroups: ["apps"]
    resources: ["deployments/scale"]
    verbs: ["get", "list", "watch", "update", "patch"]

* Update event_enrichments.py

* Update event_enrichments.py

* Update event_enrichments.py

* Update event_enrichments.py

* Update event_enrichments.py
@Avi-Robusta Avi-Robusta changed the title added kubectl action in runner [MAIN-2842] added kubectl action in runner Jan 7, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants