-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Install monitoring-satellite with obs-installer #12701
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,48 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_PATH=$(realpath "$(dirname "$0")") | ||
|
||
if [[ -z "${PREVIEW_NAME}" ]]; then | ||
echo "Must set PREVIEW_NAME variable" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "${KUBE_PATH}" ]]; then | ||
echo "Must set KUBE_PATH variable" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# exports all vars | ||
shopt -os allexport | ||
|
||
kubectl --kubeconfig "${KUBE_PATH}" create ns monitoring-satellite || true | ||
kubectl --kubeconfig "${KUBE_PATH}" create ns certmanager || true | ||
|
||
if ! command -v envsubst; then | ||
go install github.com/a8m/envsubst/cmd/envsubst@latest | ||
fi | ||
|
||
obsDir="${SCRIPT_PATH}/observability" | ||
mkdir -p "${obsDir}" | ||
git clone https://roboquat:"$(cat /mnt/secrets/monitoring-satellite-preview-token/token)"@github.com/gitpod-io/observability.git "${obsDir}" | ||
cd "${obsDir}/installer" | ||
|
||
tmpdir=$(mktemp -d) | ||
|
||
envsubst <"${SCRIPT_PATH}/manifests/monitoring-satellite.yaml" | go run main.go render --output-split-files "${tmpdir}" --config - | ||
|
||
pushd "${tmpdir}" | ||
|
||
# we have to apply the CRDs first and wait until they are available before we can apply the rest | ||
find . -name "*CustomResourceDefinition*" -exec kubectl --kubeconfig "${KUBE_PATH}" apply -f {} --server-side \; | ||
|
||
# wait for the CRDs | ||
kubectl --kubeconfig "${KUBE_PATH}" -n monitoring-satellite wait --for condition=established --timeout=60s crd/servicemonitors.monitoring.coreos.com | ||
|
||
kubectl --kubeconfig "${KUBE_PATH}" apply --server-side -f . | ||
|
||
kubectl --kubeconfig "${KUBE_PATH}" patch deployments.apps -n monitoring-satellite grafana --type=json -p="[{'op': 'remove', 'path': '/spec/template/spec/nodeSelector'}]" | ||
vulkoingim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
popd |
This file contains hidden or 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,46 @@ | ||
namespace: monitoring-satellite | ||
tracing: | ||
install: true | ||
honeycombAPIKey: ${HONEYCOMB_API_KEY} | ||
honeycombDataset: preview-environments | ||
certmanager: | ||
installServiceMonitors: true | ||
pyrra: | ||
install: true | ||
prometheus: | ||
externalLabels: | ||
cluster: ${PREVIEW_NAME} | ||
environment: preview-environments | ||
resources: | ||
requests: | ||
cpu: 50m | ||
memory: 200Mi | ||
remoteWrite: | ||
- username: ${PROM_REMOTE_WRITE_USER} | ||
password: ${PROM_REMOTE_WRITE_PASSWORD} | ||
url: "https://victoriametrics.gitpod.io/api/v1/write" | ||
writeRelabelConfigs: | ||
- action: keep | ||
regex: "rest_client_requests_total.*|http_prober_.*" | ||
separator: ";" | ||
sourceLabels: | ||
- __name__ | ||
- job | ||
imports: | ||
yaml: | ||
- gitURL: https://github.com/gitpod-io/observability | ||
path: monitoring-satellite/manifests/kube-prometheus-rules | ||
- gitURL: https://github.com/gitpod-io/observability | ||
path: monitoring-satellite/manifests/kubescape | ||
- gitURL: https://github.com/gitpod-io/observability | ||
path: monitoring-satellite/manifests/grafana | ||
- gitURL: https://github.com/gitpod-io/observability | ||
path: monitoring-satellite/manifests/probers | ||
- gitURL: https://github.com/gitpod-io/gitpod | ||
path: operations/observability/mixins/workspace/rules | ||
- gitURL: https://github.com/gitpod-io/gitpod | ||
path: operations/observability/mixins/meta/rules | ||
- gitURL: https://github.com/gitpod-io/gitpod | ||
path: operations/observability/mixins/IDE/rules | ||
- gitURL: https://github.com/gitpod-io/observability | ||
path: monitoring-satellite/manifests/crds |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should replace this with
go install
, if this fixes the issue #12703