Skip to content

Commit

Permalink
fix: Install the config map first, when we install grafana add the re…
Browse files Browse the repository at this point in the history
…ference to this config map and

the plugin in the installation rather than having to patch it afterwards, patch will only apply to
existing grafana instances

re-eanble creation of the admin user

Change-Id: I8d9e67e6c12c9694ccb8df701f2216f1eb048f03
  • Loading branch information
mtlljm committed Jan 18, 2024
1 parent 64795e5 commit 910b6fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion install/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data:
accessTokenExpirationCheck = true
[security]
disable_initial_admin_creation = true
disable_initial_admin_creation = false
cookie_secure = true
cookie_samesite = lax
Expand Down
10 changes: 5 additions & 5 deletions install/configure-grafana.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ if [[ "${DRY_RUN}" == true ]]; then
exit 0
fi

echo "Create config-map.yaml"
kubectl -n "${GRAFANA_NAMESPACE}" apply -f ./manifests/config-map.yaml

if [[ "${INSTALL_GRAFANA}" == true ]]; then
echo "Installing grafana"
kubectl -n "${GRAFANA_NAMESPACE}" apply -f ./manifests/grafana.yaml
#No need to patch grafana as it will already be installed with the plugin and config
exit 0
fi

echo "Applying config-map.yaml"

kubectl -n "${GRAFANA_NAMESPACE}" apply -f ./manifests/config-map.yaml

echo "Patching deployment/grafana with patch-grafana.yaml"

kubectl -n "${GRAFANA_NAMESPACE}" patch --patch-file ./manifests/patch-grafana.yaml deployment/grafana
10 changes: 10 additions & 0 deletions install/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
containers:
- name: grafana
image: docker.io/grafana/grafana:TEMPLATE_GRAFANA_VERSION
env:
- name: GF_INSTALL_PLUGINS
value: TEMPLATE_ESP_PLUGIN_SOURCE;sasesp-plugin,volkovlabs-image-panel
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
Expand Down Expand Up @@ -62,10 +65,17 @@ spec:
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-pv
- mountPath: /etc/grafana/grafana.ini
name: grafana-config
subPath: grafana-uaa.ini
volumes:
- name: grafana-pv
persistentVolumeClaim:
claimName: grafana-pvc
- name: grafana-config
configMap:
defaultMode: 420
name: grafana-ini
---
kind: Service
apiVersion: v1
Expand Down

0 comments on commit 910b6fc

Please sign in to comment.