Skip to content
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

fix: move prometheus install into make file #1093

Merged
merged 2 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions .github/actions/deploy-prometheus-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,21 @@ runs:
using: "composite"
steps:
- name: Install and expose Prometheus
working-directory: ./test
shell: bash
run: |
kubectl create namespace monitoring --dry-run=client -o yaml | kubectl apply -f -
kubectl apply --server-side -f ./prometheus/setup
kubectl wait --for=condition=Established --all CustomResourceDefinition --namespace=monitoring
kubectl apply -f ./prometheus/
kubectl wait --for=condition=available deployment/prometheus-operator -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/prometheus-adapter -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/kube-state-metrics -n monitoring --timeout=120s
kubectl wait pod/prometheus-k8s-0 --for=condition=ready --timeout=120s -n monitoring
make install-prometheus

kubectl -n monitoring port-forward svc/prometheus-k8s 9090 &
kubectl -n monitoring port-forward svc/node-exporter 9100 &

# wait for port 9090 to become available
while ! nc -vz localhost 9090 > /dev/null 2>&1 ; do
echo "Sleeping until port-forward for Prometheus at port 9090 is ready..."
sleep 5
echo "Sleeping until port-forward for Prometheus at port 9090 is ready..."
sleep 5
done

# wait until node exporter is available
while ! nc -vz localhost 9100 > /dev/null 2>&1 ; do
echo "Sleeping until port-forward for node exporter at port 9100 is ready..."
sleep 5
echo "Sleeping until port-forward for node exporter at port 9100 is ready..."
sleep 5
done
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ integration-test:
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test.yaml

.PHONY: integration-test-local #these tests should run on a real cluster!
integration-test-local:
integration-test-local: install-prometheus
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test-local.yaml

.PHONY: load-test
Expand All @@ -46,6 +46,19 @@ load-test:
kubectl apply -f ./test/load/assets/templates/provider.yaml
kube-burner init -c ./test/load/cfg.yml --metrics-profile ./test/load/metrics.yml

.PHONY: install-prometheus
install-prometheus:
kubectl create namespace monitoring --dry-run=client -o yaml | kubectl apply -f -
kubectl apply --server-side -f test/prometheus/setup
kubectl wait --for=condition=Established --all CustomResourceDefinition --namespace=monitoring
kubectl apply -f test/prometheus/
kubectl wait --for=condition=available deployment/prometheus-operator -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/prometheus-adapter -n monitoring --timeout=120s
kubectl wait --for=condition=available deployment/kube-state-metrics -n monitoring --timeout=120s
kubectl wait pod/prometheus-k8s-0 --for=condition=ready --timeout=120s -n monitoring



.PHONY: cleanup-manifests
cleanup-manifests:
rm -rf manifests
Expand All @@ -68,7 +81,6 @@ helm-package:
$(MAKE) build-release-manifests CHART_APPVERSION=$(CHART_APPVERSION) RELEASE_REGISTRY=$(RELEASE_REGISTRY)
$(MAKE) release-helm-manifests CHART_APPVERSION=$(CHART_APPVERSION) RELEASE_REGISTRY=$(RELEASE_REGISTRY)


.PHONY: build-release-manifests
build-release-manifests:
$(MAKE) -C operator generate
Expand Down