-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Grafana setting files to Persistent Volume (#84)
Previously the Grafana settings will be lost if pod is restarted. This PR modifies the Grafana volumes to keep the settings persistent. Signed-off-by: Yanjun Zhou <[email protected]>
- Loading branch information
Showing
11 changed files
with
159 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
build/charts/theia/templates/grafana/hostpath-persistentvolume.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if .Values.grafana.enable }} | ||
{{- $customizedPV := or .Values.grafana.storage.createPersistentVolume.type .Values.grafana.storage.persistentVolumeClaimSpec }} | ||
{{- if or (eq .Values.grafana.storage.createPersistentVolume.type "HostPath") (not $customizedPV) }} | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: grafana-pv | ||
spec: | ||
storageClassName: grafana-storage | ||
capacity: | ||
storage: {{ .Values.grafana.storage.size }} | ||
accessModes: | ||
- ReadWriteOnce | ||
hostPath: | ||
path: {{ .Values.grafana.storage.createPersistentVolume.hostPath.path }} | ||
{{- end }} | ||
{{- end}} |
29 changes: 29 additions & 0 deletions
29
build/charts/theia/templates/grafana/local-persistentvolume.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{{- if .Values.grafana.enable }} | ||
{{- if eq .Values.grafana.storage.createPersistentVolume.type "Local" }} | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: grafana-pv | ||
spec: | ||
storageClassName: grafana-storage | ||
capacity: | ||
storage: {{ .Values.grafana.storage.size }} | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
local: | ||
path: {{ .Values.grafana.storage.createPersistentVolume.local.path }} | ||
nodeAffinity: | ||
{{- if .Values.grafana.storage.createPersistentVolume.local.affinity }} | ||
{{- with .Values.grafana.storage.createPersistentVolume.local.affinity }} | ||
{{- toYaml . | trim | nindent 4 }} | ||
{{- end }} | ||
{{- else }} | ||
required: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: antrea.io/grafana-config-node | ||
operator: Exists | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
18 changes: 18 additions & 0 deletions
18
build/charts/theia/templates/grafana/nfs-persistentvolume.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{- if .Values.grafana.enable }} | ||
{{- if eq .Values.grafana.storage.createPersistentVolume.type "NFS" }} | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: grafana-pv | ||
spec: | ||
storageClassName: grafana-storage | ||
capacity: | ||
storage: {{ .Values.grafana.storage.size }} | ||
accessModes: | ||
- ReadWriteOnce | ||
volumeMode: Filesystem | ||
nfs: | ||
path: {{ .Values.grafana.storage.createPersistentVolume.nfs.path }} | ||
server: {{ .Values.grafana.storage.createPersistentVolume.nfs.host }} | ||
{{- end }} | ||
{{- end }} |
14 changes: 0 additions & 14 deletions
14
build/charts/theia/templates/grafana/persistentvolume.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters