Skip to content

Commit

Permalink
added kustomization file to generate configmaps for example dashboards (
Browse files Browse the repository at this point in the history
#633)

* added kustomization file to generate configmaps for example dashboards

* added new line to keep linter happy :)

* removed tab on new line

* added configmaps and volume mounts for grafana dashboards

* disabled suffix hash

* added dashboard import to observability stack

* oh mr. linty, please enjoy your new line :)
  • Loading branch information
ehearneRedHat authored May 9, 2024
1 parent c525838 commit 038f4fb
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
36 changes: 36 additions & 0 deletions config/observability/grafana_deployment_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@
configMap:
defaultMode: 420
name: grafana-udproutes
- op: add
path: /spec/template/spec/volumes/-
value:
name: grafana-appdeveloper
configMap:
defaultMode: 420
name: grafana-appdeveloper
- op: add
path: /spec/template/spec/volumes/-
value:
name: grafana-platformengineer
configMap:
defaultMode: 420
name: grafana-platformengineer
- op: add
path: /spec/template/spec/volumes/-
value:
name: grafana-businessuser
configMap:
defaultMode: 420
name: grafana-businessuser
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
Expand Down Expand Up @@ -82,3 +103,18 @@
value:
name: grafana-udproutes
mountPath: /grafana-dashboard-definitions/0/grafana-udproutes
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: grafana-appdeveloper
mountPath: /grafana-dashboard-definitions/0/grafana-appdeveloper
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: grafana-businessuser
mountPath: /grafana-dashboard-definitions/0/grafana-businessuser
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: grafana-platformengineer
mountPath: /grafana-dashboard-definitions/0/grafana-platformengineer
20 changes: 20 additions & 0 deletions examples/dashboards/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

# Grafana dashboards as configmaps
configMapGenerator:
- name: grafana-appdeveloper
namespace: monitoring
files:
- ./app_developer.json
- name: grafana-businessuser
namespace: monitoring
files:
- ./business_user.json
- name: grafana-platformengineer
namespace: monitoring
files:
- ./platform_engineer.json

generatorOptions:
disableNameSuffixHash: true
2 changes: 2 additions & 0 deletions hack/quickstart-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ KUADRANT_ISTIO_KUSTOMIZATION="${KUADRANT_REPO}/config/dependencies/istio/sail?re
KUADRANT_CERT_MANAGER_KUSTOMIZATION="${KUADRANT_REPO}/config/dependencies/cert-manager?ref=${KUADRANT_REF}"
KUADRANT_METALLB_KUSTOMIZATION="${KUADRANT_REPO}/config/metallb?ref=${KUADRANT_REF}"
KUADARNT_OBSERVABILITY_KUSTOMIZATION="${KUADRANT_REPO}/config/observability?ref=${KUADRANT_REF}"
KUADRANT_DASHBOARDS_KUSTOMIZATION="${KUADRANT_REPO}/examples/dashboards?ref=${KUADRANT_REF}"
MGC_REPO="github.com/${KUADRANT_ORG}/multicluster-gateway-controller.git"
MGC_ISTIO_KUSTOMIZATION="${MGC_REPO}/config/istio?ref=${MGC_REF}"

Expand Down Expand Up @@ -507,6 +508,7 @@ success "Kuadrant sample configuration deployed."
info "Installing observability stack in ${KUADRANT_CLUSTER_NAME}..."
kubectl kustomize ${KUADARNT_OBSERVABILITY_KUSTOMIZATION} | docker run --rm -i ryane/kfilt -i kind=CustomResourceDefinition | kubectl apply --server-side -f -
kubectl kustomize ${KUADARNT_OBSERVABILITY_KUSTOMIZATION} | docker run --rm -i ryane/kfilt -x kind=CustomResourceDefinition | kubectl apply -f -
kubectl kustomize ${KUADRANT_DASHBOARDS_KUSTOMIZATION} | kubectl apply --server-side -f -
success "observability stack installed successfully."

info "✨🌟 Setup Complete! Your Kuadrant Quick Start environment has been successfully created. 🌟✨"
Expand Down

0 comments on commit 038f4fb

Please sign in to comment.