-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added the metrics-operator (#917)
Co-authored-by: Florian Bacher <[email protected]> Co-authored-by: odubajDT <[email protected]> Co-authored-by: Giovanni Liva <[email protected]> Co-authored-by: RealAnna <[email protected]> Co-authored-by: odubajDT <[email protected]>
- Loading branch information
1 parent
39a002d
commit 91e57ca
Showing
370 changed files
with
18,751 additions
and
2,770 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/bash | ||
|
||
getNamespaces() { | ||
out=$(kubectl get ns -o name) | ||
for n in $out | ||
do | ||
nn=${n#"namespace/"} | ||
namespaces+=("$nn") | ||
done | ||
} | ||
|
||
getProvidersOfNamespace() { | ||
out=$(kubectl get keptnevaluationproviders -o name -n "$1") | ||
for n in $out | ||
do | ||
nn=${n#"keptnevaluationprovider.lifecycle.keptn.sh/"} | ||
providers+=("$nn -n $1") | ||
done | ||
} | ||
|
||
echo -e "------------------------------\n" | ||
echo -e "Migrating manifests.\n" | ||
echo -e "------------------------------\n" | ||
|
||
declare -a namespaces | ||
declare -a providers | ||
|
||
DATE=$(date +%s) | ||
MANIFESTS_FILE="manifests-$DATE.yaml" | ||
|
||
getNamespaces | ||
|
||
for n in "${namespaces[@]}" | ||
do | ||
getProvidersOfNamespace "$n" | ||
done | ||
|
||
for n in "${providers[@]}" | ||
do | ||
echo "---" >> $MANIFESTS_FILE | ||
kubectl get keptnevaluationproviders $n -oyaml >> $MANIFESTS_FILE | ||
done | ||
|
||
sed -i 's#lifecycle\.keptn\.sh/v1alpha2#metrics\.keptn\.sh/v1alpha2#g' $MANIFESTS_FILE | ||
sed -i 's/KeptnEvaluationProvider/KeptnMetricsProvider/g' $MANIFESTS_FILE | ||
|
||
echo -e "------------------------------\n" | ||
echo -e "Manifests migrated successfully.\n" | ||
echo -e "To review the newly created manifests, check ./$MANIFESTS_FILE file.\n" | ||
echo -e "------------------------------\n" | ||
|
||
read -p "Do you want to apply the newly created KeptnMetricsProvider resources? [y/N]" -n 1 -r | ||
echo -e "\n" | ||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
then | ||
kubectl apply -f $MANIFESTS_FILE | ||
echo -e "\nManifests applied.\n" | ||
else | ||
echo -e "Manifests not applied.\n" | ||
fi | ||
|
||
echo -e "------------------------------\n" | ||
|
||
read -p "Do you want to delete the old KeptnEvaluationProvider resources? [y/N]" -n 1 -r | ||
echo -e "\n" | ||
if [[ $REPLY =~ ^[Yy]$ ]] | ||
then | ||
for n in "${providers[@]}" | ||
do | ||
kubectl delete keptnevaluationproviders $n | ||
done | ||
echo -e "\nResources deleted.\n" | ||
else | ||
echo -e "Resources not deleted.\n" | ||
fi |
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
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
Oops, something went wrong.