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

Expose grafana as NodePort service and open it on k3d #655

Merged
merged 1 commit into from
Oct 14, 2021
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
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,17 @@ deploy-grafana:
@echo "\n$(YELLOW)Local cluster $(CYAN)$(CLUSTER_GSLB1)$(NC)"
@echo "\n$(YELLOW)install grafana $(NC)"
@$(eval PREVIOUS_CONTEXT := $(shell kubectl config current-context))
kubectl config use-context k3d-$(CLUSTER_GSLB1)
kubectl apply -f deploy/grafana/dashboard-cm.yaml
@kubectl config use-context $(PREVIOUS_CONTEXT)
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm -n k8gb upgrade -i grafana grafana/grafana -f deploy/grafana/values.yaml \
--wait --timeout=2m0s \
--kube-context=k3d-$(CLUSTER_GSLB1)
kubectl config use-context k3d-$(CLUSTER_GSLB1)
kubectl apply -f deploy/grafana/dashboard-cm.yaml -n k8gb
@kubectl config use-context $(PREVIOUS_CONTEXT)
@echo "\nGrafana is listening on http://localhost:3000\n"
@echo "🖖 credentials are admin:admin\n"


.PHONY: uninstall-grafana
uninstall-grafana:
Expand Down
7 changes: 7 additions & 0 deletions deploy/grafana/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
adminUser: admin
adminPassword: admin # don't use in production (1st login to web ui will ask for the password change)
service:
nodePort: 30030 # allowed port range between 30000 and 32768
targetPort: 3000
port: 3000
type: NodePort
sidecar:
dashboards:
enabled: true
Expand Down
3 changes: 3 additions & 0 deletions k3d/test-gslb1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ports:
- port: 443:443
nodeFilters:
- agent[0]
- port: 3000:30030
nodeFilters:
- agent[0]
- port: 8080:30090
nodeFilters:
- agent[0]
Expand Down