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

fix: grafana pvc config not working #736

Closed
wants to merge 4 commits into from
Closed
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
6 changes: 3 additions & 3 deletions addons/grafana/parameter.cue
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ parameter: {
// +usage=The clusters to install
clusters?: [...string]
// +usage=Specify the image of kube-state-metrics
image: *"grafana/grafana:8.5.3" | string
image: *"grafana/grafana:10.2.1" | string
// +usage=Specify the imagePullPolicy of the image
imagePullPolicy: *"IfNotPresent" | "Never" | "Always"
// +usage=Specify the number of CPU units
cpu: *0.5 | number
// +usage=Specifies the attributes of the memory resource required for the container.
memory: *"1024Mi" | string
// +usage=Specify the service type for expose prometheus server. Default to be ClusterIP.
serviceType: *"ClusterIP" | "NodePort" | "LoadBalancer"
serviceType: *"NodePort" | "ClusterIP" | "LoadBalancer"
// +usage=Specify the storage size to use. If empty, emptyDir will be used. Otherwise pvc will be used.
storage?: =~"^([1-9][0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$"
// +usage=Specify the storage class to use.
storageClassName?: string
// +usage=Specify the admin user for grafana
adminUser: *"admin" | string
// +usage=Specify the admin password for grafana
adminPassword: *"kubevela" | string
adminPassword: *"admin" | string
}
18 changes: 14 additions & 4 deletions addons/grafana/resources/grafana.cue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ grafana: {
path: "/api/health"
port: 3000
}
volumeMounts: emptyDir: [{
name: "storage"
mountPath: "/var/lib/grafana"
}]

if parameter.storage == _|_ {
volumeMounts: emptyDir: [{
name: "storage-volume"
mountPath: "/var/lib/grafana"
}]
}
if parameter.storage != _|_ {
volumeMounts: pvc: [{
name: "storage-volume"
mountPath: "/var/lib/grafana"
claimName: "grafana-storage"
}]
}
env: [{
name: "GF_SECURITY_ADMIN_USER"
valueFrom: secretKeyRef: {
Expand Down
2 changes: 1 addition & 1 deletion addons/grafana/template.cue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ output: {
policies: commonPolicies + [{
type: "override"
name: "grafana-core"
properties: selector: [o11yNamespace.name, grafanaAccess.name, grafana.name]
properties: selector: [o11yNamespace.name, grafanaStorage.name,grafanaAccess.name, grafana.name]
}, {
type: "override"
name: "grafana-dashboards"
Expand Down
Loading