From f1f1feb66933c3352c2b16b0428b3865d93cc700 Mon Sep 17 00:00:00 2001 From: ericsyh Date: Wed, 8 Jun 2022 13:44:38 +0800 Subject: [PATCH 1/2] fix(sn-platform): remove legacy adopt existing configs Signed-off-by: ericsyh --- charts/sn-platform/values.yaml | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 8a4c3a28e..b3c979837 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -778,13 +778,9 @@ zookeeper: OPTS: "" secrets: use: false -# aws: -# secretName: "restore-aws-secret" - ## Operator Controller - ## templates/zookeeper-cluster.yaml - operator: - adopt_existing: false - updatePolicy: [] + # aws: + # secretName: "restore-aws-secret" + ## Retention Policy resourcePolicy: keep: false @@ -932,12 +928,6 @@ bookkeeper: gcLoggingOptions: [] custom: {} configData: {} - ## Operator Controller - ## templates/bookkeeper-cluster.yaml - operator: - adopt_existing: false - updatePolicy: > - - finalizers ## Retention Policy resourcePolicy: keep: false @@ -981,11 +971,6 @@ autorecovery: extraOptions: [] gcLoggingOptions: [] configData: {} - ## Operator Controller - ## templates/bookkeeper-cluster.yaml - operator: - adopt_existing: false - updatePolicy: [] ## Retention Policy resourcePolicy: keep: false @@ -1225,12 +1210,6 @@ broker: # [secret name] # ``` # secret: [k8s secret that stores azure credentials] - ## Operator Controller - ## templates/broker-cluster.yaml - operator: - adopt_existing: false - updatePolicy: > - - finalizers ## Retention Policy resourcePolicy: keep: false @@ -1462,12 +1441,6 @@ proxy: pulsarssl: 6651 websocket: 9090 websockettls: 9443 - ## Operator Controller - ## templates/broker-cluster.yaml - operator: - adopt_existing: false - updatePolicy: > - - finalizers ## Retention Policy resourcePolicy: keep: false From 742b55dc9caf7fad9955e0b356ba3461c5b6d33f Mon Sep 17 00:00:00 2001 From: ericsyh Date: Thu, 16 Jun 2022 10:03:16 +0800 Subject: [PATCH 2/2] fix(sn-platform): remove legacy manifests Signed-off-by: ericsyh --- .../bookkeeper/bookkeeper-cluster.yaml | 58 +------------------ .../zookeeper/zookeeper-cluster.yaml | 37 +----------- 2 files changed, 4 insertions(+), 91 deletions(-) diff --git a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml index fef366469..c4c617db8 100644 --- a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml @@ -124,18 +124,7 @@ spec: imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | indent 6 }} {{- end }} - {{- if .Values.bookkeeper.operator.adopt_existing }} - volumes: - {{- if not (and .Values.volumes.persistence .Values.bookkeeper.volumes.persistence) }} - - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.journal.name }}" - emptyDir: {} - - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.ledgers.name }}" - emptyDir: {} - {{- end }} - {{- include "pulsar.bookkeeper.certs.volumes" . | nindent 4 }} - {{- include "pulsar.bookkeeper.log.volumes" . | nindent 4 }} - {{- end }} - {{- if and (not .Values.bookkeeper.operator.adopt_existing) .Values.tls.bookie.enabled }} + {{- if .Values.tls.bookie.enabled }} volumes: {{- include "pulsar.bookkeeper.certs.volumes" . | nindent 4 }} {{- end }} @@ -185,13 +174,6 @@ spec: {{- end }} # Do not retain journal files as it increase the disk utilization journalMaxBackups: "0" - {{- if .Values.bookkeeper.operator.adopt_existing }} - # if adopting existing bk cluster then also keep existing ledger/journal dir setting - journalDirectories: "/pulsar/data/bookkeeper/journal" - PULSAR_PREFIX_journalDirectories: "/pulsar/data/bookkeeper/journal" - ledgerDirectories: "/pulsar/data/bookkeeper/ledgers" - PULSAR_PREFIX_ledgerDirectories: "/pulsar/data/bookkeeper/ledgers" - {{- end }} {{- include "pulsar.bookkeeper.config.tls" . | nindent 6 }} {{ (.Files.Glob "conf/bookie/log4j2.yaml").AsConfig | indent 6 }} autoRecovery: @@ -334,40 +316,8 @@ spec: metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" updatePolicy: - {{- if .Values.bookkeeper.operator.adopt_existing }} - {{ .Values.bookkeeper.operator.updatePolicy }} - {{- else }} - all - {{- end }} - {{- if .Values.bookkeeper.operator.adopt_existing }} - {{- if and .Values.volumes.persistence .Values.bookkeeper.volumes.persistence}} - volumeClaimTemplates: - - metadata: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.journal.name }}" - spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: {{ .Values.bookkeeper.volumes.journal.size }} - {{- include "pulsar.bookkeeper.journal.storage.class" . | nindent 10 }} - - metadata: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.ledgers.name }}" - spec: - accessModes: [ "ReadWriteOnce" ] - resources: - requests: - storage: {{ .Values.bookkeeper.volumes.ledgers.size }} - {{- include "pulsar.bookkeeper.ledgers.storage.class" . | nindent 10 }} - {{- end }} - volumeMounts: - - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.journal.name }}" - mountPath: /pulsar/data/bookkeeper/journal - - name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}-{{ .Values.bookkeeper.volumes.ledgers.name }}" - mountPath: /pulsar/data/bookkeeper/ledgers - {{- include "pulsar.bookkeeper.certs.volumeMounts" . | nindent 6 }} - {{- include "pulsar.bookkeeper.log.volumeMounts" . | nindent 6 }} - {{- end }} - {{- if and (not .Values.bookkeeper.operator.adopt_existing) .Values.tls.bookie.enabled }} + {{- if .Values.tls.bookie.enabled }} volumeMounts: {{- include "pulsar.bookkeeper.certs.volumeMounts" . | nindent 6 }} {{- end }} @@ -375,11 +325,7 @@ spec: metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.autorecovery.component }}" updatePolicy: - {{- if .Values.autorecovery.operator.adopt_existing }} - {{ .Values.autorecovery.operator.updatePolicy }} - {{- else }} - all - {{- end }} configMap: metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" diff --git a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml index 538a1376a..7113dc1fa 100644 --- a/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml +++ b/charts/sn-platform/templates/zookeeper/zookeeper-cluster.yaml @@ -159,19 +159,7 @@ spec: imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | indent 6 }} {{- end }} - {{- if .Values.zookeeper.operator.adopt_existing }} - volumes: - {{- include "pulsar.zookeeper.data.volumes" . | nindent 4 }} - {{- include "pulsar.zookeeper.certs.volumes" . | nindent 4 }} - {{- include "pulsar.zookeeper.log.volumes" . | nindent 4 }} - {{- include "pulsar.zookeeper.genzkconf.volumes" . | nindent 4 }} - {{- if .Values.zookeeper.customTools.restore.enable }} - - name: restore-config - configMap: - name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" - {{- end }} - {{- end }} - {{- if and (not .Values.zookeeper.operator.adopt_existing) .Values.tls.zookeeper.enabled }} + {{- if .Values.tls.zookeeper.enabled }} volumes: {{- include "pulsar.zookeeper.certs.volumes" . | nindent 4 }} {{- end }} @@ -201,14 +189,6 @@ spec: serverCnxnFactory: {{ .Values.zookeeper.serverCnxnFactory }} # copy from configmap custom: - {{- if .Values.zookeeper.operator.adopt_existing }} - # if adopting existing zk cluster then also keep existing data/data-log dir setting - PULSAR_PREFIX_dataDir: /pulsar/data/zookeeper - {{- if .Values.zookeeper.volumes.useSeparateDiskForTxlog }} - # use a separate disk for tx log - PULSAR_PREFIX_dataLogDir: /pulsar/data/zookeeper-datalog - {{- end }} - {{- end }} # enable zookeeper tls {{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }} secureClientPort: "{{ .Values.zookeeper.ports.clientTls }}" @@ -234,21 +214,8 @@ spec: metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.component }}" updatePolicy: - {{- if .Values.zookeeper.operator.adopt_existing }} - {{ .Values.zookeeper.operator.updatePolicy }} - {{- else }} - all - {{- end }} - {{- if .Values.zookeeper.operator.adopt_existing }} - volumeClaimTemplates: - {{- include "pulsar.zookeeper.data.volumeClaimTemplates" . | nindent 6 }} - volumeMounts: - {{- include "pulsar.zookeeper.data.volumeMounts" . | nindent 6 }} - {{- include "pulsar.zookeeper.certs.volumeMounts" . | nindent 6 }} - {{- include "pulsar.zookeeper.log.volumeMounts" . | nindent 6 }} - {{- include "pulsar.zookeeper.genzkconf.volumeMounts" . | nindent 6 }} - {{- end }} - {{- if and (not .Values.zookeeper.operator.adopt_existing) .Values.tls.zookeeper.enabled }} + {{- if .Values.tls.zookeeper.enabled }} volumeMounts: {{- include "pulsar.zookeeper.certs.volumeMounts" . | nindent 6 }} {{- end }}