Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Merged
merged 10 commits into from
Jan 9, 2025
Merged

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

merged 10 commits into from
Jan 9, 2025

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
@Avi-Robusta Avi-Robusta enabled auto-merge (squash) January 9, 2025 07:40
@Avi-Robusta Avi-Robusta merged commit 6a8baca into master Jan 9, 2025
7 checks passed
@Avi-Robusta Avi-Robusta deleted the kubectl-job branch January 9, 2025 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants