Skip to content

Commit

Permalink
fix: move prometheus install into make file (keptn#1093)
Browse files Browse the repository at this point in the history
Signed-off-by: realanna <anna.reale@dynatrace.com>
  • Loading branch information
RealAnna authored and aepfli committed Mar 30, 2023
1 parent 6867395 commit e859bd3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
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

0 comments on commit e859bd3

Please sign in to comment.