Skip to content

Commit

Permalink
chore: udpate postgresql examples (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanshanying authored Nov 8, 2024
1 parent a0fd2d5 commit 5d3b61e
Show file tree
Hide file tree
Showing 28 changed files with 661 additions and 247 deletions.
6 changes: 3 additions & 3 deletions addons-cluster/postgresql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Define postgresql ComponentSpec with ComponentDefinition.
topology: {{ .Values.mode }}
componentSpecs:
- name: {{ include "postgresql-cluster.component-name" . }}
serviceVersion: {{ .Values.version }}
labels:
{{- include "postgresql-cluster.patroni-scope-label" . | indent 8 }}
{{- include "postgresql-cluster.replicaCount" . | indent 6 }}
serviceAccountName: {{ include "kblib.serviceAccountName" . }}
{{- include "kblib.componentMonitor" . | indent 6 }}
{{- include "postgresql-cluster.replicaCount" . | indent 6 }}
{{- include "kblib.componentResources" . | indent 6 }}
{{- include "kblib.componentStorages" . | indent 6 }}
{{- if .Values.etcd.proxyEnabled }}
{{- if .Values.etcd.enabled }}
serviceRefs:
{{ include "postgresql-cluster.serviceRef" . | indent 6 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if and .Values.etcd.enabled (eq .Values.etcd.meta.mode "serviceref") }}
apiVersion: apps.kubeblocks.io/v1
kind: ServiceDescriptor
metadata:
Expand All @@ -8,4 +9,4 @@ spec:
serviceVersion: 3.5.6
endpoint:
value: "etcd-cluster-etcd.default.svc.cluster.local:2379" # etcd service endpoint
{{- end }}
18 changes: 7 additions & 11 deletions addons-cluster/postgresql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,16 @@ requests:
##
storage: 20

## @param monitor sidecar
sidecars:
- exporter

etcd:
proxyEnabled: false
enabled: false
meta:
mode: serviceref # optional: incluster, serviceref
serviceRef:
namespace:
cluster:
name:
component:
service:
port:
namespace:
cluster:
name:
component:
service:
port:
credential:
serviceDescriptor: postgres-etcd-descriptor # example: postgres-etcd-descriptor
6 changes: 1 addition & 5 deletions addons/postgresql/templates/clusterdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ metadata:
{{- include "postgresql.labels" . | nindent 4 }}
spec:
topologies:
- name: standalone
components:
- name: postgresql
compDef: {{ include "postgresql.componentDefNamePrefix" . }}
default: true
- name: replication
components:
- name: postgresql
compDef: {{ include "postgresql.componentDefNamePrefix" . }}
default: true
2 changes: 1 addition & 1 deletion examples/apecloud-mysql/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Cluster
metadata:
name: acmysql-cluster
namespace: default
labels:
labels:
auditLogEnabled: "false"
spec:
# Specifies the behavior when a Cluster is deleted.
Expand Down
Loading

0 comments on commit 5d3b61e

Please sign in to comment.