-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test script update to fox next step var sub * revert prev change and fix echo * update next steps for unready kustomizations * add reproduce_hint * fix typo, another next step * deployment logs update * update next steps for deployments
- Loading branch information
1 parent
8c86b9b
commit fcfc064
Showing
7 changed files
with
134 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
codebundles/k8s-fluxcd-kustomization-health/workload_next_steps.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Script Information and Metadata | ||
# ----------------------------------------------------------------------------- | ||
# Author: @stewartshea | ||
# Description: This script takes in event message strings captured from a | ||
# Kubernetes based system and provides some generalized next steps based on the | ||
# content and frequency of the message. | ||
# ----------------------------------------------------------------------------- | ||
# Input: List of event messages, related owner kind, and related owner name | ||
messages="$1" | ||
|
||
|
||
# Try to parse out object details | ||
# Splitting the extracted string to get individual parts | ||
matched=$(echo "$messages" | grep -oP "\[\K(\w+\/\w+\/.+?)(?=\])") | ||
owner_kind=$(echo "$matched" | cut -d'/' -f1) | ||
owner_name=$(echo "$matched" | cut -d'/' -f2) | ||
additional_details=$(echo "$matched" | cut -d'/' -f3-) | ||
|
||
# Initialize an empty array to store recommendations | ||
next_steps=() | ||
|
||
|
||
if [[ $messages =~ "Health check failed" ]]; then | ||
next_steps+=("Troubleshoot $owner_kind Replicas for \`$owner_name\`") | ||
next_steps+=("Troubleshoot $owner_kind Warning Events for \`$owner_name\`") | ||
fi | ||
|
||
|
||
|
||
# Display the list of recommendations | ||
printf "%s\n" "${next_steps[@]}" | sort | uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters