Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from h3adex/dev
Browse files Browse the repository at this point in the history
core: add grafana integration
  • Loading branch information
h3adex authored Dec 27, 2023
2 parents da4b908 + cf5c956 commit 50202dd
Show file tree
Hide file tree
Showing 8 changed files with 979 additions and 33 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.idea/
bin/
# Testing context behavior here
cmd/server/main_test.go
# Testing helm
# helm install guardgress --dry-run . > tmp.yaml
helm/guardgress/tmp.yaml

# used to determine my test coverage
c.out
coverage.out
coverage.out
# test certs
tls.key
tls.crt
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ load-image:
kind load docker-image --name="${DEV_CLUSTER}" "${DEV_IMAGE}"

deploy:
@if [ ! -f "bin/tls.key" ] || [ ! -f "bin/tls.crt" ]; then \
mkdir -p bin; \
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout bin/tls.key -out bin/tls.crt; \
kubectl create secret tls ingress-tls --key bin/tls.key --cert bin/tls.crt; \
@if [ ! -f "build/tls.key" ] || [ ! -f "build/tls.crt" ]; then \
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout build/tls.key -out build/tls.crt; \
kubectl create secret tls ingress-tls --key build/tls.key --cert build/tls.crt; \
else \
echo "[dev-env] TLS secret files already exist. Skipping generation."; \
fi; \
Expand Down Expand Up @@ -83,7 +82,7 @@ build-azure:
az acr build --image "${DEV_IMAGE}" --registry "${ACR_REGISTRY}" --file Dockerfile .

load-test:
echo "GET https://0.0.0.0:443/" | vegeta attack -duration=5s -insecure -rate=100/1s -header="Host: whoami.local"
echo "GET https://0.0.0.0:443" | vegeta attack -duration=10m -insecure -rate=15/1s -header="Host: whoami.local" -header="User-Agent: chrome101"

clean:
@kind delete cluster --name ${DEV_CLUSTER}
Expand All @@ -93,7 +92,7 @@ help:
@echo "Usage: make [target]"
@echo ""
@echo "Available targets:"
@echo " all - Run the complete development environment setup, including Kind cluster deployment and Azure image building."
@echo " deploy-kind - Run the complete development environment setup, including Kind cluster deployment and image building."
@echo " setup - Check and set up necessary dependencies (kind, kubectl, helm)."
@echo " build-image - Build the Docker image using the provided Dockerfile. Image name: ${DEV_IMAGE}."
@echo " create-cluster - Create a new Kind Kubernetes cluster if it doesn't exist, or use the existing cluster. Cluster name: ${DEV_CLUSTER}."
Expand Down
7 changes: 7 additions & 0 deletions build/grafana-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ datasources:
url: http://prometheus-server.prometheus.svc.cluster.local
access: proxy
isDefault: true
persistence:
enabled: true
#dashboards:
# default:
# custom-dashboard:
# file: /build/guardgress-dashboard.json

Loading

0 comments on commit 50202dd

Please sign in to comment.