Skip to content

Commit 8ecd902

Browse files
committed
chore(addons): update support
1 parent 5a4f70f commit 8ecd902

35 files changed

Lines changed: 438 additions & 63 deletions

File tree

addons/grafana/10/chart/grafana/templates/_helpers.tpl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ Return the Grafana admin password key
5757
{{- end -}}
5858
{{- end -}}
5959

60+
{{- define "admin.passwordValue" -}}
61+
{{- if .Values.admin.password }}
62+
{{- .Values.admin.password -}}
63+
{{- else -}}
64+
{{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "GF_SECURITY_ADMIN_PASSWORD") -}}
65+
{{- end -}}
66+
{{- end }}
67+
6068
{{/*
6169
Return true if a secret object should be created
6270
*/}}
@@ -67,6 +75,20 @@ Return true if a secret object should be created
6775
{{- end -}}
6876
{{- end -}}
6977

78+
{{/*
79+
Returns the available value for certain key in an existing secret (if it exists),
80+
otherwise it generates a random value.
81+
*/}}
82+
{{- define "getValueFromSecret" }}
83+
{{- $len := (default 16 .Length) | int -}}
84+
{{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}}
85+
{{- if $obj }}
86+
{{- index $obj .Key | b64dec -}}
87+
{{- else -}}
88+
{{- randAlphaNum $len -}}
89+
{{- end -}}
90+
{{- end }}
91+
7092
{{/*
7193
Return the Grafana SMTP credentials secret
7294
*/}}

addons/grafana/10/chart/grafana/templates/secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ metadata:
1111
app.kubernetes.io/component: grafana
1212
type: Opaque
1313
data:
14-
GF_SECURITY_ADMIN_PASSWORD: {{ ternary (randAlphaNum 10) .Values.admin.password (empty .Values.admin.password) | b64enc | quote }}
14+
GF_SECURITY_ADMIN_PASSWORD: {{ include "admin.passwordValue" . | b64enc | quote }}
1515
GF_SECURITY_ADMIN_USER: {{ .Values.admin.user | b64enc |quote }}
1616
{{- end }}

addons/grafana/10/chart/grafana/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ serviceAccount:
575575
service:
576576
## @param service.type Kubernetes Service type
577577
##
578-
type: ClusterIP
578+
type: LoadBalancer
579579
## @param service.clusterIP Grafana service Cluster IP
580580
## e.g.:
581581
## clusterIP: None

addons/grafana/10/meta.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: Grafana
2-
version: 7.0
1+
name: grafana
2+
version: "10"
33
id: fff5b6c7-ed85-429b-8265-493e40cc53c7
44
description: "grafana"
55
displayName: "grafana"
@@ -9,12 +9,14 @@ metadata:
99
name: drycc
1010
supportURL: http://grafana.io/
1111
documentationURL: https://github.com/drycc-addons/
12-
tags: cloudbeaver
12+
tags: grafana
1313
bindable: true
1414
instances_retrievable: true
1515
bindings_retrievable: true
16-
plan_updateable: false
16+
plan_updateable: true
1717
allow_parameters:
18+
- name: "networkPolicy.allowNamespaces"
19+
description: "networkPolicy allowNamespaces config for values.yaml"
1820
- name: "service.type"
1921
description: "service type config for values.yaml"
2022
archive: false
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
credential:
2-
{{- if (eq .Values.router.service.type "LoadBalancer") }}
3-
- name: HOST
2+
{{- if (eq .Values.service.type "LoadBalancer") }}
3+
- name: EXTRANET_HOST
44
valueFrom:
55
serviceRef:
6-
name: {{ printf "%s-router" (include "common.names.fullname" .) }}
6+
name: {{ include "common.names.fullname" . }}
77
jsonpath: '{ .status.loadBalancer.ingress[*].ip }'
8-
{{- else if (eq .Values.service.type "ClusterIP") }}
8+
{{- end }}
99
- name: HOST
1010
valueFrom:
1111
serviceRef:
1212
name: {{ include "common.names.fullname" . }}
1313
jsonpath: '{ .spec.clusterIP }'
14-
{{- end }}
1514
- name: PASSWORD
1615
valueFrom:
1716
secretKeyRef:
18-
name: {{ template "common.names.fullname" . }}-admin
17+
name: {{ include "common.names.fullname" . }}-admin
1918
jsonpath: '{ .data.GF_SECURITY_ADMIN_PASSWORD }'
2019
- name: USERNAME
2120
valueFrom:
2221
secretKeyRef:
23-
name: {{ template "common.names.fullname" . }}-admin
22+
name: {{ include "common.names.fullname" . }}-admin
2423
jsonpath: '{ .data.GF_SECURITY_ADMIN_USER }'
2524
- name: PORT
2625
valueFrom:
2726
serviceRef:
28-
name: {{ template "common.names.fullname" . }}
27+
name: {{ include "common.names.fullname" . }}
2928
jsonpath: '{ .spec.ports[?(@.name=="http")].port }'
3029

addons/postgresql-cluster/15/chart/postgresql-cluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ name: postgresql
2525
sources:
2626
- https://github.com/drycc-addons/
2727
- https://www.postgresql.org/
28-
version: 15.3.1
28+
version: 15.4.1

addons/postgresql-cluster/15/plans/standard-10/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ resources:
7272

7373
persistentVolume:
7474
enabled: true
75-
size: 10G
75+
size: 10Gi
7676

addons/postgresql-cluster/15/plans/standard-100/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ resources:
7272

7373
persistentVolume:
7474
enabled: true
75-
size: 100G
75+
size: 100Gi

addons/postgresql-cluster/15/plans/standard-20/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ resources:
7474

7575
persistentVolume:
7676
enabled: true
77-
size: 20G
77+
size: 20Gi

addons/postgresql-cluster/15/plans/standard-200/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ resources:
7171

7272
persistentVolume:
7373
enabled: true
74-
size: 200G
74+
size: 200Gi

0 commit comments

Comments
 (0)