-
Notifications
You must be signed in to change notification settings - Fork 13
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 '[Add] Kubernetes-Prometheus v0.14.0 and Add Versi…
…on Script' (#409) from add/kube-prom-v0.14.0 into master Reviewed-on: https://gitea.obmondo.com/EnableIT/KubeAid/pulls/409
- Loading branch information
Showing
1,251 changed files
with
350,767 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
|
||
# This script sets up a new version directory for jsonnet-bundler dependencies. | ||
# It performs the following tasks: | ||
# 1. Checks for correct usage and ensures the script is run from the correct (root of KubeAid repo) location. | ||
# 2. Verifies that the 'jb' command (jsonnet-bundler) is installed. | ||
# 3. Checks if a directory for the specified version already exists. | ||
# 4. Creates the directory if it does not exist. | ||
# 5. Initializes jsonnet-bundler and installs the required dependencies for the specified version. | ||
# Usage: ./build/kube-prometheus/script.sh <version-tag> | ||
|
||
set -euo pipefail | ||
|
||
# Ensure correct usage | ||
if [[ $# -ne 1 ]]; then | ||
echo "Usage: $0 <version-tag>" | ||
exit 1 | ||
fi | ||
|
||
# sanity checks | ||
BUILDPATH=build/kube-prometheus/ | ||
if [ ! -e "$BUILDPATH" ]; then | ||
echo "I cannot find $BUILDPATH - this script MUST be run from root of git repo" | ||
exit 1 | ||
fi | ||
|
||
# Check if 'jb' is installed | ||
if ! command -v jb &> /dev/null; then | ||
echo "'jb' command not found. Please install jsonnet-bundler." | ||
exit 1 | ||
fi | ||
|
||
VERSION=$1 | ||
INSTALLPATH="${BUILDPATH}/libraries/${VERSION}" | ||
|
||
# Check if the version directory already exists | ||
if [[ -e "$INSTALLPATH" ]]; then | ||
echo "Version $VERSION already exists. Exiting." | ||
exit 1 | ||
fi | ||
|
||
# Create the new version directory | ||
mkdir -p "$INSTALLPATH" | ||
|
||
# Navigate to the new directory and initialize jb | ||
cd "$INSTALLPATH" || { echo "Failed to change directory to $INSTALLPATH"; exit 1; } | ||
|
||
# Initialize jsonnet-bundler and install dependencies | ||
jb init | ||
jb install "github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus@${VERSION}" | ||
jb install "github.com/bitnami-labs/sealed-secrets/contrib/prometheus-mixin@main" | ||
jb install "github.com/ceph/ceph/monitoring/ceph-mixin@main" | ||
jb install "gitlab.com/uneeq-oss/cert-manager-mixin@master" | ||
jb install "github.com/grafana/jsonnet-libs/opensearch-mixin@master" | ||
|
||
echo "Version ${VERSION} added 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"version": 1, | ||
"dependencies": [ | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/bitnami-labs/sealed-secrets.git", | ||
"subdir": "contrib/prometheus-mixin" | ||
} | ||
}, | ||
"version": "main" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/ceph/ceph.git", | ||
"subdir": "monitoring/ceph-mixin" | ||
} | ||
}, | ||
"version": "main" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/grafana/jsonnet-libs.git", | ||
"subdir": "opensearch-mixin" | ||
} | ||
}, | ||
"version": "master" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://github.com/prometheus-operator/kube-prometheus.git", | ||
"subdir": "jsonnet/kube-prometheus" | ||
} | ||
}, | ||
"version": "v0.14.0" | ||
}, | ||
{ | ||
"source": { | ||
"git": { | ||
"remote": "https://gitlab.com/uneeq-oss/cert-manager-mixin.git", | ||
"subdir": "" | ||
} | ||
}, | ||
"version": "master" | ||
} | ||
], | ||
"legacyImports": true | ||
} |
Oops, something went wrong.