Skip to content

Commit c98da89

Browse files
authored
chore(addons): plans optimization
1 parent 4a615ba commit c98da89

54 files changed

Lines changed: 1477 additions & 255 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.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
annotations:
2+
category: Infrastructure
3+
apiVersion: v2
4+
appVersion: 23.2.5
5+
dependencies:
6+
- name: common
7+
repository: oci://registry.drycc.cc/charts
8+
tags:
9+
- drycc-common
10+
version: ~1.1.2
11+
description: Cloud Database Manager
12+
engine: gotpl
13+
home: https://github.com/drycc-addons/addons
14+
icon: https://github.com/dbeaver/cloudbeaver/wiki/images/cloudbeaver-logo.png
15+
keywords:
16+
- cloudbeaver
17+
- database
18+
maintainers:
19+
- name: drycc
20+
url: https://github.com/drycc-addons/addons
21+
name: cloudbeaver
22+
sources:
23+
- https://github.com/dbeaver/cloudbeaver
24+
version: 23.2.5

addons/cloudbeaver/23/chart/cloudbeaver/README.md

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
3+
4+
{{/*
5+
Return the proper cloudbeaver image name
6+
*/}}
7+
{{- define "cloudbeaver.image" -}}
8+
{{- include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) -}}
9+
{{- end -}}
10+
11+
12+
{{/*
13+
Return the proper Docker Image Registry Secret Names
14+
*/}}
15+
{{- define "cloudbeaver.imagePullSecrets" -}}
16+
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) -}}
17+
{{- end -}}
18+
19+
{{/*
20+
Create the name of the service account to use
21+
*/}}
22+
{{- define "cloudbeaver.serviceAccountName" -}}
23+
{{- if .Values.serviceAccount.create -}}
24+
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
25+
{{- else -}}
26+
{{ default "default" .Values.serviceAccount.name }}
27+
{{- end -}}
28+
{{- end -}}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "common.names.fullname" . }}
5+
namespace: {{ include "common.names.namespace" . | quote }}
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
9+
{{- end }}
10+
{{- if .Values.commonAnnotations }}
11+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
12+
{{- end }}
13+
spec:
14+
{{- if .Values.updateStrategy }}
15+
strategy: {{- toYaml .Values.updateStrategy | nindent 4 }}
16+
{{- end }}
17+
selector:
18+
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
19+
replicas: {{ .Values.replicaCount }}
20+
template:
21+
metadata:
22+
{{- if .Values.podAnnotations }}
23+
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
24+
{{- end }}
25+
labels: {{- include "common.labels.standard" . | nindent 8 }}
26+
{{- if .Values.podLabels }}
27+
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
28+
{{- end }}
29+
spec:
30+
serviceAccountName: {{ include "cloudbeaver.serviceAccountName" . }}
31+
{{- include "cloudbeaver.imagePullSecrets" . | nindent 6 }}
32+
{{- if .Values.hostAliases }}
33+
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
34+
{{- end }}
35+
{{- if .Values.affinity }}
36+
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
37+
{{- else }}
38+
affinity:
39+
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
40+
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
41+
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
42+
{{- end }}
43+
{{- if .Values.nodeSelector }}
44+
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
45+
{{- end }}
46+
{{- if .Values.tolerations }}
47+
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
48+
{{- end }}
49+
{{- if .Values.topologySpreadConstraints }}
50+
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }}
51+
{{- end }}
52+
{{- if .Values.priorityClassName }}
53+
priorityClassName: {{ .Values.priorityClassName | quote }}
54+
{{- end }}
55+
{{- if .Values.schedulerName }}
56+
schedulerName: {{ .Values.schedulerName | quote }}
57+
{{- end }}
58+
{{- if .Values.terminationGracePeriodSeconds }}
59+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
60+
{{- end }}
61+
{{- if .Values.podSecurityContext.enabled }}
62+
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
63+
{{- end }}
64+
containers:
65+
- name: cloudbeaver
66+
image: {{ include "cloudbeaver.image" . }}
67+
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
68+
{{- if .Values.containerSecurityContext.enabled }}
69+
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
70+
{{- end }}
71+
workingDir: /opt/drycc/cloudbeaver/
72+
ports:
73+
- name: http
74+
containerPort: {{ .Values.containerPorts.http }}
75+
{{- if not .Values.diagnosticMode.enabled }}
76+
{{- if .Values.customLivenessProbe }}
77+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
78+
{{- else if .Values.livenessProbe.enabled }}
79+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit (omit .Values.livenessProbe "enabled") "path") "context" $) | nindent 12 }}
80+
httpGet:
81+
path: {{ .Values.livenessProbe.path }}
82+
port: http
83+
{{- end }}
84+
{{- if .Values.customReadinessProbe }}
85+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
86+
{{- else if .Values.readinessProbe.enabled }}
87+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit (omit .Values.readinessProbe "enabled") "path") "context" $) | nindent 12 }}
88+
httpGet:
89+
path: {{ .Values.readinessProbe.path }}
90+
port: http
91+
{{- end }}
92+
{{- if .Values.customStartupProbe }}
93+
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }}
94+
{{- else if .Values.startupProbe.enabled }}
95+
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit (omit .Values.startupProbe "enabled") "path") "context" $) | nindent 12 }}
96+
httpGet:
97+
path: {{ .Values.startupProbe.path }}
98+
port: http
99+
{{- end }}
100+
{{- end }}
101+
{{- if .Values.resources }}
102+
resources: {{- toYaml .Values.resources | nindent 12 }}
103+
{{- end }}
104+
volumeMounts:
105+
- name: data
106+
mountPath: {{ .Values.persistence.mountPath | quote }}
107+
volumes:
108+
{{- if not .Values.persistence.enabled }}
109+
- name: data
110+
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 }}
119+
{{- 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 }}
138+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- range .Values.extraDeploy }}
2+
---
3+
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
4+
{{- end }}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{{- if .Values.ingress.enabled }}
2+
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
3+
kind: Ingress
4+
metadata:
5+
name: {{ include "common.names.fullname" . }}
6+
namespace: {{ include "common.names.namespace" . | quote }}
7+
labels: {{- include "common.labels.standard" . | nindent 4 }}
8+
{{- if .Values.commonLabels }}
9+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
10+
{{- end }}
11+
annotations:
12+
{{- if .Values.ingress.annotations }}
13+
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
14+
{{- end }}
15+
{{- if .Values.commonAnnotations }}
16+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
18+
spec:
19+
{{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }}
20+
ingressClassName: {{ .Values.ingress.ingressClassName | quote }}
21+
{{- end }}
22+
rules:
23+
{{- if .Values.ingress.hostname }}
24+
- host: {{ .Values.ingress.hostname | quote }}
25+
http:
26+
paths:
27+
{{- if .Values.ingress.extraPaths }}
28+
{{- toYaml .Values.ingress.extraPaths | nindent 10 }}
29+
{{- end }}
30+
- path: {{ .Values.ingress.path }}
31+
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
32+
pathType: {{ .Values.ingress.pathType }}
33+
{{- end }}
34+
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "http" "context" $) | nindent 14 }}
35+
{{- end }}
36+
{{- range .Values.ingress.extraHosts }}
37+
- host: {{ .name | quote }}
38+
http:
39+
paths:
40+
- path: {{ default "/" .path }}
41+
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
42+
pathType: {{ default "ImplementationSpecific" .pathType }}
43+
{{- end }}
44+
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }}
45+
{{- end }}
46+
{{- if .Values.ingress.extraRules }}
47+
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
48+
{{- end }}
49+
{{- if or (and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned)) .Values.ingress.extraTls }}
50+
tls:
51+
{{- if and .Values.ingress.tls (or (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) .Values.ingress.selfSigned) }}
52+
- hosts:
53+
- {{ .Values.ingress.hostname | quote }}
54+
{{- range .Values.ingress.extraHosts }}
55+
- {{ .name }}
56+
{{- end }}
57+
secretName: {{ printf "%s-tls" .Values.ingress.hostname }}
58+
{{- end }}
59+
{{- if .Values.ingress.extraTls }}
60+
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraTls "context" $) | nindent 4 }}
61+
{{- end }}
62+
{{- end }}
63+
{{- end }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
name: {{ printf "%s-binding" (include "common.names.fullname" .) }}
6+
namespace: {{ include "common.names.namespace" . | quote }}
7+
labels: {{- include "common.labels.standard" . | nindent 4 }}
8+
{{- if .Values.commonLabels }}
9+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
10+
{{- end }}
11+
{{- if or .Values.persistence.annotations .Values.commonAnnotations .Values.persistence.resourcePolicy }}
12+
annotations:
13+
{{- if .Values.commonAnnotations }}
14+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
15+
{{- end }}
16+
{{- if .Values.persistence.annotations }}
17+
{{- include "common.tplvalues.render" ( dict "value" .Values.persistence.annotations "context" $) | nindent 4 }}
18+
{{- end }}
19+
{{- if .Values.persistence.resourcePolicy }}
20+
helm.sh/resource-policy: {{ .Values.persistence.resourcePolicy | quote }}
21+
{{- end }}
22+
{{- end }}
23+
spec:
24+
accessModes:
25+
{{- range .Values.persistence.accessModes }}
26+
- {{ . | quote }}
27+
{{- end }}
28+
resources:
29+
requests:
30+
storage: {{ .Values.persistence.size | quote }}
31+
{{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}
32+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
5+
metadata:
6+
name: {{ include "node.serviceAccountName" . }}
7+
namespace: {{ include "common.names.namespace" . | quote }}
8+
labels: {{- include "common.labels.standard" . | nindent 4 }}
9+
{{- if .Values.commonLabels }}
10+
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
11+
{{- end }}
12+
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
13+
annotations:
14+
{{- if .Values.commonAnnotations }}
15+
{{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
16+
{{- end }}
17+
{{- if .Values.serviceAccount.annotations }}
18+
{{- include "common.tplvalues.render" (dict "value" .Values.serviceAccount.annotations "context" $) | nindent 4 }}
19+
{{- end }}
20+
{{- end }}
21+
{{- end -}}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "common.names.fullname" . }}
5+
namespace: {{ include "common.names.namespace" . | quote }}
6+
labels: {{- include "common.labels.standard" . | nindent 4 }}
7+
{{- if .Values.commonLabels }}
8+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
9+
{{- end }}
10+
{{- if .Values.commonAnnotations }}
11+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
12+
{{- end }}
13+
{{- if .Values.service.annotations }}
14+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }}
15+
{{- end }}
16+
spec:
17+
type: {{ .Values.service.type }}
18+
sessionAffinity: {{ default "None" .Values.service.sessionAffinity }}
19+
{{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }}
20+
clusterIP: {{ .Values.service.clusterIP }}
21+
{{- end }}
22+
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
23+
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
24+
{{- end }}
25+
{{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP)) }}
26+
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
27+
{{- end }}
28+
{{- if and (eq .Values.service.type "LoadBalancer") .Values.service.loadBalancerSourceRanges }}
29+
loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
30+
{{- end }}
31+
{{- if .Values.service.sessionAffinityConfig }}
32+
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }}
33+
{{- end }}
34+
ports:
35+
- name: http
36+
port: {{ .Values.service.ports.http }}
37+
targetPort: http
38+
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http)) }}
39+
nodePort: {{ .Values.service.nodePorts.http }}
40+
{{- else if eq .Values.service.type "ClusterIP" }}
41+
nodePort: null
42+
{{- end }}
43+
{{- if .Values.service.extraPorts }}
44+
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
45+
{{- end }}
46+
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}

0 commit comments

Comments
 (0)