Skip to content
Merged
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
11 changes: 9 additions & 2 deletions addons/apecloud-postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ apecloud-postgresql-14-configuration-{{ .Chart.Version }}
{{/*
Define apecloud postgresql 14 component config constraint name
*/}}
{{- define "apecloud-postgresql-14.configConstraint" -}}
apecloud-postgresql-14-cc-{{ .Chart.Version }}
{{- define "apecloud-postgresql-14.pdName" -}}
apecloud-postgresql-14-pd
{{- end -}}

{{/*
Define apecloud postgresql 14 component config constraint name
*/}}
{{- define "apecloud-postgresql-14.pcrName" -}}
apecloud-postgresql-14-pcr
{{- end -}}

{{/*
Expand Down
3 changes: 0 additions & 3 deletions addons/apecloud-postgresql/templates/cmpd-apepg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ spec:
configs:
- name: postgresql-consensusset-configuration
templateRef: {{ include "apecloud-postgresql-14.configurationTemplate" . }}
constraintRef: {{ include "apecloud-postgresql-14.configConstraint" . }}
keys:
- postgresql.conf
namespace: {{ .Release.Namespace }}
volumeName: postgresql-config
defaultMode: 0444
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{{- $cc := .Files.Get "config/pg14-config-effect-scope.yaml" | fromYaml }}
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
{{- $pd := .Files.Get "config/pg14-config-effect-scope.yaml" | fromYaml }}
apiVersion: parameters.kubeblocks.io/v1alpha1
kind: ParametersDefinition
metadata:
name: {{ include "apecloud-postgresql-14.configConstraint" . }}
name: {{ include "apecloud-postgresql-14.pdName" . }}
labels:
{{- include "apecloud-postgresql.labels" . | nindent 4 }}
annotations:
{{- include "apecloud-postgresql.annotations" . | nindent 4 }}
spec:
fileName: postgresql.conf
reloadAction:
shellTrigger:
sync: true
Expand All @@ -34,24 +35,21 @@ spec:
# example: ../../pkg/configuration/testdata/mysql_openapi.json
cue: |-
{{- .Files.Get "config/pg14-config-constraint.cue" | nindent 6 }}
# configuration file format
fileFormatConfig:
format: properties
## require db instance restart
## staticParameters
{{- if hasKey $cc "staticParameters" }}
{{- if hasKey $pd "staticParameters" }}
staticParameters:
{{- $params := get $cc "staticParameters" }}
{{- $params := get $pd "staticParameters" }}
{{- range $params }}
- {{ . }}
{{- end }}
{{- end}}

## define immutable parameter list, this feature is not currently supported.
{{- if hasKey $cc "immutableParameters" }}
{{- if hasKey $pd "immutableParameters" }}
immutableParameters:
{{- $params := get $cc "immutableParameters" }}
{{- $params := get $pd "immutableParameters" }}
{{- range $params }}
- {{ . }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions addons/apecloud-postgresql/templates/pcr-14.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: parameters.kubeblocks.io/v1alpha1
kind: ParamConfigRenderer
metadata:
name: {{ include "apecloud-postgresql-14.pcrName" . }}
labels:
{{- include "apecloud-postgresql.labels" . | nindent 4 }}
spec:
componentDef: {{ include "apecloud-postgresql-14.cmpdName" . }}
parametersDefs:
- {{ include "apecloud-postgresql-14.pdName" . }}

configs:
- name: postgresql.conf
fileFormatConfig:
format: properties
13 changes: 10 additions & 3 deletions addons/mogdb/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,17 @@ mogdb-configuration-tpl
{{- end -}}

{{/*
Define mogdb config constraint name
Define mogdb parameters definition name
*/}}
{{- define "mogdb.constraintTplName" -}}
mogdb-cc
{{- define "mogdb.pdName" -}}
mogdb-pd
{{- end -}}

{{/*
Define mogdb parameter config rendered name
*/}}
{{- define "mogdb.pcrName" -}}
mogdb-pcr
{{- end -}}

{{/*
Expand Down
3 changes: 0 additions & 3 deletions addons/mogdb/templates/cmpd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ spec:
configs:
- name: mogdb-configuration
templateRef: {{ include "mogdb.configTplName" . }}
constraintRef: {{ include "mogdb.constraintTplName" . }}
keys:
- postgresql.conf
namespace: {{ .Release.Namespace }}
volumeName: mogdb-config
defaultMode: 0777
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{{- $cc := .Files.Get "config/mogdb-config-effect-scope.yaml" | fromYaml }}
apiVersion: apps.kubeblocks.io/v1beta1
kind: ConfigConstraint
{{- $pd := .Files.Get "config/mogdb-config-effect-scope.yaml" | fromYaml }}
apiVersion: parameters.kubeblocks.io/v1alpha1
kind: ParametersDefinition
metadata:
name: {{ include "mogdb.constraintTplName" . }}
name: {{ include "mogdb.pdName" . }}
labels:
{{- include "mogdb.labels" . | nindent 4 }}
spec:
fileName: postgresql.conf

# ConfigurationSchema that impose restrictions on engine parameter's rule
parametersSchema:
Expand All @@ -19,25 +20,19 @@ spec:
## require db instance restart
## staticParameters
{{- if hasKey $cc "staticParameters" }}
{{- if hasKey $pd "staticParameters" }}
staticParameters:
{{- $params := get $cc "staticParameters" }}
{{- $params := get $pd "staticParameters" }}
{{- range $params }}
- {{ . }}
{{- end }}
{{- end}}

## define immutable parameter list, this feature is not currently supported.
{{- if hasKey $cc "immutableParameters" }}
{{- if hasKey $pd "immutableParameters" }}
immutableParameters:
{{- $params := get $cc "immutableParameters" }}
{{- $params := get $pd "immutableParameters" }}
{{- range $params }}
- {{ . }}
{{- end }}
{{- end}}



# configuration file format
fileFormatConfig:
format: properties
{{- end}}
15 changes: 15 additions & 0 deletions addons/mogdb/templates/pcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: parameters.kubeblocks.io/v1alpha1
kind: ParamConfigRenderer
metadata:
name: {{ include "mogdb.pcrName" . }}
labels:
{{- include "mogdb.labels" . | nindent 4 }}
spec:
componentDef: {{ include "mogdb.cmpdName" . }}
parametersDefs:
- {{ include "mogdb.pdName" . }}

configs:
- name: postgresql.conf
fileFormatConfig:
format: properties
11 changes: 5 additions & 6 deletions addons/oceanbase-ce/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,18 @@ oceanbase-ce-{{ .Chart.Version }}
^oceanbase-ce-
{{- end -}}

{{- define "oceanbase-ce.cc.sysvars" -}}
{{- define "oceanbase-ce.pdVarName" -}}
oceanbase-ce-sysvars-cc
{{- end -}}


{{- define "oceanbase-ce.cc.parameters" -}}
{{- define "oceanbase-ce.pdParamName" -}}
oceanbase-ce-parameters-cc
{{- end -}}

{{- define "oceanbase-ce.pcrName" -}}
oceanbase-ce-pcr
{{- end -}}

{{- define "oceanbase-ce.clusterDefinition" -}}
oceanbase-ce
Expand Down Expand Up @@ -216,17 +219,13 @@ configs:
- name: oceanbase-sysvars
templateRef: {{ include "oceanbase-ce.cm.sysvars" .}}
volumeName: oceanbase-sysvars
constraintRef: {{ include "oceanbase-ce.cc.sysvars" .}}
namespace: {{ .Release.Namespace }}
defaultMode: 0555
- name: oceanbase-config
templateRef: {{ include "oceanbase-ce.cm.config" .}}
volumeName: oceanbase-config
constraintRef: {{ include "oceanbase-ce.cc.parameters" .}}
namespace: {{ .Release.Namespace }}
defaultMode: 0555
reRenderResourceTypes:
- vscale
scripts:
- name: oceanbase-scripts
templateRef: {{ include "oceanbase-ce.scripts.bootscripts" .}}
Expand Down
135 changes: 0 additions & 135 deletions addons/oceanbase-ce/templates/configconstraint.yaml

This file was deleted.

Loading
Loading