-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from uche-madu/develop
add prometheus monitoring
- Loading branch information
Showing
8 changed files
with
70 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,8 @@ spec: | |
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- allowEmpty=true | ||
- CreateNamespace=true | ||
|
||
|
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 |
---|---|---|
|
@@ -28,3 +28,6 @@ spec: | |
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- allowEmpty=true | ||
- CreateNamespace=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments were provided | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <namespace>" | ||
exit 1 | ||
fi | ||
|
||
# Assign the first argument to a variable called 'namespace' | ||
namespace=$1 | ||
|
||
# Fetch namespace details | ||
# Fetch the details of the namespace and write them to a temporary file | ||
# If the command fails, print an error message and exit | ||
if ! kubectl get namespace "$namespace" -o json > /tmp/temp.json; then | ||
echo "Failed to fetch namespace details." | ||
exit 1 | ||
fi | ||
|
||
# Modify finalizers | ||
# Use 'jq' to set the 'finalizers' array to an empty array, indicating that we want to remove all finalizers | ||
# Write the modified JSON to another temporary file | ||
# If the command fails, print an error message and exit | ||
if ! jq '.spec.finalizers=[]' /tmp/temp.json > /tmp/temp_final.json; then | ||
echo "Failed to modify finalizers." | ||
exit 1 | ||
fi | ||
|
||
# Replace namespace finalize endpoint | ||
# Use 'kubectl replace' to update the namespace with the modified JSON that has the finalizers removed | ||
# This is done by sending a request to the namespace's finalize endpoint | ||
# If the command fails, print an error message and exit | ||
if ! kubectl replace --raw "/api/v1/namespaces/$namespace/finalize" -f /tmp/temp_final.json; then | ||
echo "Failed to replace namespace finalize endpoint." | ||
exit 1 | ||
fi | ||
|
||
# Cleanup temporary files | ||
# Remove the temporary files created during the process | ||
rm -f /tmp/temp.json /tmp/temp_final.json | ||
|
||
# Print a success message | ||
echo "Finalizers removed successfully." |
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