Skip to content

Commit 8b14e6c

Browse files
authored
chore(addons): support update addons (#21)
1 parent 781ba2c commit 8b14e6c

53 files changed

Lines changed: 505 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

addons/cloudbeaver/23/chart/cloudbeaver/templates/deployment.yaml

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -105,34 +105,11 @@ spec:
105105
- name: data
106106
mountPath: {{ .Values.persistence.mountPath | quote }}
107107
volumes:
108-
{{- if not .Values.persistence.enabled }}
109108
- name: data
109+
{{- if .Values.persistence.enabled }}
110+
persistentVolumeClaim:
111+
claimName: {{ .Values.persistence.existingClaim | default (include "common.names.fullname" .) }}
112+
{{- else }}
110113
emptyDir: {}
111-
{{- end }}
112-
{{- if .Values.persistence.enabled }}
113-
volumeClaimTemplates:
114-
- metadata:
115-
name: data
116-
annotations:
117-
{{- if .Values.persistence.annotations }}
118-
{{ toYaml .Values.persistence.annotations | indent 8 }}
119114
{{- end }}
120-
labels:
121-
application: {{ include "common.names.fullname" . }}
122-
release: {{ .Release.Name }}
123-
heritage: {{ .Release.Service }}
124-
spec:
125-
accessModes:
126-
{{ toYaml .Values.persistence.accessModes | indent 8 }}
127-
resources:
128-
requests:
129-
storage: "{{ .Values.persistence.size }}"
130-
{{- if .Values.persistence.storageClass }}
131-
{{- if (eq "-" .Values.persistence.storageClass) }}
132-
storageClassName: ""
133-
{{- else }}
134-
storageClassName: "{{ .Values.persistence.storageClass }}"
135-
{{- end }}
136-
{{- end }}
137-
{{- end }}
138115

addons/cloudbeaver/23/chart/cloudbeaver/templates/pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
kind: PersistentVolumeClaim
33
apiVersion: v1
44
metadata:
5-
name: {{ printf "%s-binding" (include "common.names.fullname" .) }}
5+
name: {{ include "common.names.fullname" . }}
66
namespace: {{ include "common.names.namespace" . | quote }}
77
labels: {{- include "common.labels.standard" . | nindent 4 }}
88
{{- if .Values.commonLabels }}

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/chart/postgresql-cluster/README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,23 @@ backup:
7171

7272
- Login database web with admin user & password
7373

74+
- Change administrator initial password
75+
```
76+
ALTER USER administrator WITH ENCRYPTED PASSWORD 'newpassword';
77+
```
78+
- View total connections number in postgresql cluster;
79+
```
80+
show max_connections ;
81+
```
7482
- CREATE APP USER
7583
```
76-
CREATE USER `my_user` WITH CONNECTION LIMIT `conn_limit` LOGIN ENCRYPTED PASSWORD 'password';
84+
CREATE USER `myuser` WITH CONNECTION LIMIT `conn limit` LOGIN ENCRYPTED PASSWORD 'password';
85+
GRANT `myuser` to administrator ;
7786
```
7887
- CREATE APP DATABASE
7988
```
80-
CREATE DATABASE `my_db` OWNER `my_user`;
89+
CREATE DATABASE `mydb` OWNER `myuser`;
90+
8191
```
8292
- CREATE EXTENSIONS
8393
```

addons/postgresql-cluster/15/chart/postgresql-cluster/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Get the administrator password ;
189189
{{- if .Values.adminRole.password }}
190190
{{- .Values.adminRole.password -}}
191191
{{- else -}}
192-
{{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "password-replication") -}}
192+
{{- include "getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "common.names.fullname" .) "Length" 10 "Key" "admin-password") -}}
193193
{{- end -}}
194194
{{- end }}
195195

0 commit comments

Comments
 (0)