github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/pulsar/templates/clusterdefinition.yaml (about)

     1  apiVersion: apps.kubeblocks.io/v1alpha1
     2  kind: ClusterDefinition
     3  metadata:
     4    name: pulsar
     5    labels:
     6      {{- include "pulsar.labels" . | nindent 4 }}
     7  spec:
     8    type: pulsar
     9    connectionCredential:
    10      username: "admin"
    11      password: ""
    12      httpEndpoint: "http://$(SVC_FQDN):$(SVC_PORT_http)"
    13      pulsarEndpoint: "pulsar://$(SVC_FQDN):$(SVC_PORT_pulsar)"
    14      kafkaEndpoint: "$(SVC_FQDN):$(SVC_PORT_kafka-client)"
    15    componentDefs:
    16      - name: pulsar-broker
    17        workloadType: Stateful
    18        characterType: pulsar-broker
    19        statefulSpec:
    20          updateStrategy: BestEffortParallel
    21        serviceRefDeclarations:
    22        - name: pulsarZookeeper
    23          serviceRefDeclarationSpecs:
    24            - serviceKind: zookeeper
    25              serviceVersion: ^3.8.\d{1,2}$
    26        monitor:
    27          builtIn: false
    28          exporterConfig:
    29            scrapePath: /metrics
    30            scrapePort: {{ .Values.metrics.service.port }}
    31        configSpecs:
    32          - name: agamotto-configuration
    33            templateRef: {{ include "pulsar.name" . }}-agamotto-conf-tpl
    34            namespace: {{ .Release.Namespace }}
    35            volumeName: agamotto-configuration
    36          - name: broker-env
    37            templateRef: {{ include "pulsar.name" . }}-broker-env-tpl
    38            namespace: {{ .Release.Namespace }}
    39            constraintRef: pulsar-env-constraints
    40            keys:
    41              - conf
    42            asEnvFrom:
    43              - init-broker-cluster
    44              - broker
    45              - init-pulsar-client-config
    46            volumeName: broker-env
    47          - name: broker-config
    48            templateRef: {{ include "pulsar.name" . }}-broker-config-tpl
    49            namespace: {{ .Release.Namespace }}
    50            constraintRef: brokers-config-constraints
    51            volumeName: pulsar-broker-config
    52          - name: client-config
    53            templateRef: {{ include "pulsar.name" . }}-client-config-tpl
    54            namespace: {{ .Release.Namespace }}
    55            constraintRef: pulsar-common-constraints
    56            volumeName: pulsar-client-config
    57        scriptSpecs:
    58          - name: pulsar-scripts
    59            templateRef: {{ include "pulsar.name" . }}-scripts
    60            namespace: {{ .Release.Namespace }}
    61            volumeName: scripts
    62            defaultMode: 0555
    63        service:
    64          ports:
    65          - name: pulsar
    66            port: 6650
    67            targetPort: pulsar
    68          - name: http
    69            port: 80
    70            targetPort: http
    71          - name: http-alt
    72            port: 8080
    73            targetPort: http
    74          - name: kafka-client
    75            port: 9092
    76            targetPort: kafka-client
    77        podSpec:
    78          securityContext:
    79            runAsNonRoot: true
    80            runAsUser: 10000
    81            fsGroup: 0
    82            runAsGroup: 0
    83          initContainers:
    84            - name: init-broker-cluster
    85              command:
    86                - /kb-scripts/init-broker.sh
    87              env:
    88              {{- if .Values.debugEnabled }}
    89              - name: PULSAR_LOG_ROOT_LEVEL
    90                value: DEBUG
    91              - name: PULSAR_LOG_LEVEL
    92                value: DEBUG
    93              {{- end }}
    94              - name: brokerServiceUrl
    95                value: pulsar://$(KB_CLUSTER_COMP_NAME).$(KB_NAMESPACE).svc{{ .Values.clusterDomain }}:6650
    96              - name: clusterName
    97                value: $(KB_NAMESPACE)-$(KB_CLUSTER_COMP_NAME)
    98              - name: webServiceUrl
    99                value: http://$(KB_CLUSTER_COMP_NAME).$(KB_NAMESPACE).svc{{ .Values.clusterDomain }}:80
   100              volumeMounts:
   101                - name: scripts
   102                  mountPath: /kb-scripts
   103            - name: init-sysctl
   104              command:
   105                - /kb-scripts/init-broker-sysctl.sh
   106              securityContext:
   107                privileged: true
   108                runAsNonRoot: false
   109                runAsUser: 0
   110              volumeMounts:
   111                - name: scripts
   112                  mountPath: /kb-scripts
   113          containers:
   114            - name: broker
   115              securityContext:
   116                allowPrivilegeEscalation: false
   117                runAsNonRoot: true
   118                runAsUser: 10000
   119                capabilities:
   120                  drop:
   121                  - ALL
   122                privileged: false
   123                runAsGroup: 0
   124              command:
   125                - sh
   126                - -c
   127              args:
   128              - |
   129                set -x
   130                /kb-scripts/merge_pulsar_config.py conf/client.conf /opt/pulsar/client-conf/client.conf && \
   131                /kb-scripts/merge_pulsar_config.py conf/broker.conf /opt/pulsar/conf/broker.conf && \
   132                bin/apply-config-from-env.py conf/broker.conf && \
   133                bin/apply-config-from-env.py conf/client.conf && \
   134                echo 'OK' > status;exec bin/pulsar broker
   135              resources:
   136                requests:
   137                  cpu: 200m
   138                  memory: 512Mi
   139              env:
   140              {{- if .Values.debugEnabled }}
   141              - name: PULSAR_LOG_ROOT_LEVEL
   142                value: DEBUG
   143              - name: PULSAR_LOG_LEVEL
   144                value: DEBUG
   145              {{- end }}
   146              - name: SERVICE_PORT
   147                value: "8080"
   148              - name: POD_NAME
   149                value: $(KB_POD_NAME)
   150              - name: PULSAR_PREFIX_brokerServicePort
   151                value: "6650"
   152              - name: PULSAR_PREFIX_internalListenerName
   153                value: cluster
   154              - name: PULSAR_PREFIX_advertisedListeners
   155                value: cluster:pulsar://$(POD_NAME).$(KB_CLUSTER_COMP_NAME)-headless.$(KB_NAMESPACE).svc{{ .Values.clusterDomain }}:6650
   156              # KoP configs
   157              - name: PULSAR_PREFIX_allowAutoTopicCreationType
   158                value: partitioned
   159              - name: PULSAR_PREFIX_kafkaListeners
   160                value: PLAINTEXT://0.0.0.0:9092
   161              - name: PULSAR_PREFIX_kafkaAdvertisedListeners
   162                value: PLAINTEXT://$(POD_NAME).$(KB_CLUSTER_COMP_NAME)-headless.$(KB_NAMESPACE).svc{{ .Values.clusterDomain }}:9092
   163              - name: brokerServiceUrl
   164                value: pulsar://$(KB_CLUSTER_COMP_NAME).$(KB_NAMESPACE).svc{{ .Values.clusterDomain }}:6650
   165              - name: clusterName
   166                value: $(KB_NAMESPACE)-$(KB_CLUSTER_COMP_NAME)
   167              - name: webServiceUrl
   168                value: http://$(KB_CLUSTER_COMP_NAME).$(KB_NAMESPACE).svc{{ .Values.clusterDomain }}:80
   169              ports:
   170                - name: pulsar
   171                  containerPort: 6650
   172                - name: http
   173                  containerPort: 8080
   174                - name: kafka-client
   175                  containerPort: 9092
   176              livenessProbe:
   177                failureThreshold: 30
   178                httpGet:
   179                  path: /status.html
   180                  port: http
   181                  scheme: HTTP
   182                initialDelaySeconds: 5
   183                periodSeconds: 10
   184                successThreshold: 1
   185                timeoutSeconds: 100
   186              readinessProbe:
   187                failureThreshold: 3
   188                httpGet:
   189                  path: /status.html
   190                  port: http
   191                  scheme: HTTP
   192                initialDelaySeconds: 30
   193                periodSeconds: 10
   194                successThreshold: 1
   195                timeoutSeconds: 100
   196              startupProbe:
   197                failureThreshold: 30
   198                httpGet:
   199                  path: /status.html
   200                  port: http
   201                  scheme: HTTP
   202                initialDelaySeconds: 5
   203                periodSeconds: 10
   204                successThreshold: 1
   205                timeoutSeconds: 100
   206              volumeMounts:
   207              - name: scripts
   208                mountPath: /kb-scripts
   209              - name: pulsar-broker-config
   210                mountPath: /opt/pulsar/conf
   211              - name: broker-env
   212                mountPath: /opt/pulsar/none
   213              - name: pulsar-client-config
   214                mountPath: /opt/pulsar/client-conf
   215            - name: metrics
   216              image: {{ .Values.images.metrics.registry }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }}
   217              imagePullPolicy: {{ default "IfNotPresent" .Values.images.metrics.pullPolicy }}
   218              securityContext:
   219                runAsNonRoot: false
   220                runAsUser: 0
   221              env:
   222                - name: JOB_NAME
   223                  value: broker
   224                - name: SERVICE_PORT
   225                  value: "8080"
   226                - name: POD_NAME
   227                  value: $(KB_POD_NAME)
   228                - name: POD_NAMESPACE
   229                  value: $(KB_NAMESPACE)
   230                {{- if .Values.debugEnabled }}
   231                - name: LOG_LEVEL
   232                  value: debug
   233                {{- else }}
   234                - name: LOG_LEVEL
   235                  value: info
   236                {{- end }}
   237              command:
   238                - "/bin/agamotto"
   239                - "--config=/opt/agamotto/agamotto-config.yaml"
   240                - "--feature-gates=-pkg.translator.prometheus.NormalizeName"
   241              ports:
   242                - name: http-metrics
   243                  containerPort: {{ .Values.metrics.service.port }}
   244              volumeMounts:
   245                - name: agamotto-configuration
   246                  mountPath: /opt/agamotto
   247      - name: pulsar-proxy
   248        workloadType: Stateful
   249        characterType: pulsar-proxy
   250        statefulSpec:
   251          updateStrategy: BestEffortParallel
   252        componentDefRef:
   253        - componentDefName: pulsar-broker
   254          componentRefEnv:
   255          - name: brokerSVC
   256            valueFrom:
   257              type: ServiceRef
   258        monitor:
   259          builtIn: false
   260          exporterConfig:
   261            scrapePath: /metrics
   262            scrapePort: {{ .Values.metrics.service.port }}
   263        configSpecs:
   264          - name: agamotto-configuration
   265            templateRef: {{ include "pulsar.name" . }}-agamotto-conf-tpl
   266            namespace: {{ .Release.Namespace }}
   267            volumeName: agamotto-configuration
   268          - name: proxy-env
   269            templateRef: {{ include "pulsar.name" . }}-proxy-env-tpl
   270            namespace: {{ .Release.Namespace }}
   271            volumeName: proxy-env
   272            constraintRef: pulsar-env-constraints
   273            keys:
   274              - conf
   275            asEnvFrom:
   276              - proxy
   277          - name: proxy-config
   278            templateRef: {{ include "pulsar.name" . }}-proxy-config-tpl
   279            namespace: {{ .Release.Namespace }}
   280            volumeName: pulsar-proxy-config
   281            constraintRef: pulsar-common-constraints
   282        scriptSpecs:
   283          - name: pulsar-scripts
   284            templateRef: {{ include "pulsar.name" . }}-scripts
   285            namespace: {{ .Release.Namespace }}
   286            volumeName: scripts
   287            defaultMode: 0555
   288        service:
   289          ports:
   290          - name: pulsar
   291            port: 6650
   292            targetPort: pulsar
   293          - name: http
   294            port: 80
   295            targetPort: http
   296        podSpec:
   297          securityContext:
   298            runAsNonRoot: true
   299            runAsUser: 10000
   300            fsGroup: 0
   301            runAsGroup: 0
   302          initContainers:
   303            - name: check-broker
   304              command:
   305                - /kb-scripts/init-proxy.sh
   306              volumeMounts:
   307                - name: scripts
   308                  mountPath: /kb-scripts
   309              env:
   310              {{- if .Values.debugEnabled }}
   311              - name: PULSAR_LOG_ROOT_LEVEL
   312                value: DEBUG
   313              - name: PULSAR_LOG_LEVEL
   314                value: DEBUG
   315              {{- end }}
   316          containers:
   317            - name: proxy
   318              command:
   319                - /kb-scripts/start-proxy.sh
   320              securityContext:
   321                allowPrivilegeEscalation: false
   322                runAsNonRoot: true
   323                runAsUser: 10000
   324                capabilities:
   325                  drop:
   326                  - ALL
   327                privileged: false
   328                runAsGroup: 0
   329              env:
   330              {{- if .Values.debugEnabled }}
   331              - name: PULSAR_LOG_ROOT_LEVEL
   332                value: DEBUG
   333              - name: PULSAR_LOG_LEVEL
   334                value: DEBUG
   335              {{- end }}
   336              - name: SERVICE_PORT
   337                value: "8080"
   338              - name: brokerWebServiceURL
   339                value: http://$(brokerSVC):80
   340              - name: brokerServiceURL
   341                value: pulsar://$(brokerSVC):6650
   342              - name: clusterName
   343                value: $(KB_NAMESPACE)-$(KB_CLUSTER_COMP_NAME)
   344              - name: webServicePort
   345                value: "8080"
   346              ports:
   347              - name: pulsar
   348                containerPort: 6650
   349              - name: http
   350                containerPort: 8080
   351              livenessProbe:
   352                failureThreshold: 3
   353                httpGet:
   354                  path: /status.html
   355                  port: http
   356                  scheme: HTTP
   357                initialDelaySeconds: 30
   358                periodSeconds: 10
   359                successThreshold: 1
   360                timeoutSeconds: 100
   361              readinessProbe:
   362                failureThreshold: 3
   363                httpGet:
   364                  path: /status.html
   365                  port: http
   366                  scheme: HTTP
   367                initialDelaySeconds: 30
   368                periodSeconds: 10
   369                successThreshold: 1
   370                timeoutSeconds: 100
   371              startupProbe:
   372                failureThreshold: 20
   373                httpGet:
   374                  path: /status.html
   375                  port: http
   376                  scheme: HTTP
   377                initialDelaySeconds: 5
   378                periodSeconds: 10
   379                successThreshold: 1
   380                timeoutSeconds: 100
   381              volumeMounts:
   382                - name: scripts
   383                  mountPath: /kb-scripts
   384                - name: proxy-env
   385                  mountPath: /opt/pulsar/none
   386                - name: pulsar-proxy-config
   387                  mountPath: /opt/pulsar/conf
   388            - name: metrics
   389              image: {{ .Values.images.metrics.registry }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }}
   390              imagePullPolicy: {{ default "IfNotPresent" .Values.images.metrics.pullPolicy }}
   391              securityContext:
   392                runAsNonRoot: false
   393                runAsUser: 0
   394              env:
   395                - name: JOB_NAME
   396                  value: proxy
   397                - name: SERVICE_PORT
   398                  value: "8080"
   399                - name: POD_NAME
   400                  value: $(KB_POD_NAME)
   401                - name: POD_NAMESPACE
   402                  value: $(KB_NAMESPACE)
   403                {{- if .Values.debugEnabled }}
   404                - name: LOG_LEVEL
   405                  value: debug
   406                {{- else }}
   407                - name: LOG_LEVEL
   408                  value: info
   409                {{- end }}
   410              command:
   411                - "/bin/agamotto"
   412                - "--config=/opt/agamotto/agamotto-config.yaml"
   413                - "--feature-gates=-pkg.translator.prometheus.NormalizeName"
   414              ports:
   415                - name: http-metrics
   416                  containerPort: {{ .Values.metrics.service.port }}
   417              volumeMounts:
   418                - name: agamotto-configuration
   419                  mountPath: /opt/agamotto
   420      - name: bookies
   421        workloadType: Stateful
   422        characterType: bookkeeper
   423        statefulSpec:
   424          updateStrategy: BestEffortParallel
   425        serviceRefDeclarations:
   426        - name: pulsarZookeeper
   427          serviceRefDeclarationSpecs:
   428          - serviceKind: zookeeper
   429            serviceVersion: ^3.8.\d{1,2}$
   430        monitor:
   431          builtIn: false
   432          exporterConfig:
   433            scrapePath: /metrics
   434            scrapePort: {{ .Values.metrics.service.port }}
   435        configSpecs:
   436          - name: agamotto-configuration
   437            templateRef: {{ include "pulsar.name" . }}-agamotto-conf-tpl
   438            namespace: {{ .Release.Namespace }}
   439            volumeName: agamotto-configuration
   440          - name: bookies-env
   441            templateRef: {{ include "pulsar.name" . }}-bookies-env-tpl
   442            namespace: {{ .Release.Namespace }}
   443            constraintRef: pulsar-env-constraints
   444            volumeName: bookies-env
   445            keys:
   446              - conf
   447            asEnvFrom:
   448              - init-bookies
   449              - bookies
   450          - name: bookies-config
   451            templateRef: {{ include "pulsar.name" . }}-bookies-config-tpl
   452            namespace: {{ .Release.Namespace }}
   453            volumeName: pulsar-bookies-config
   454            constraintRef: pulsar-common-constraints
   455        scriptSpecs:
   456          - name: pulsar-scripts
   457            templateRef: {{ include "pulsar.name" . }}-scripts
   458            namespace: {{ .Release.Namespace }}
   459            volumeName: scripts
   460            defaultMode: 0555
   461        podSpec:
   462          initContainers:
   463            - name: init-bookies
   464              command:
   465                - /kb-scripts/init-bookies.sh
   466              env:
   467              {{- if .Values.debugEnabled }}
   468              - name: PULSAR_LOG_ROOT_LEVEL
   469                value: DEBUG
   470              - name: PULSAR_LOG_LEVEL
   471                value: DEBUG
   472              {{- end }}
   473              terminationMessagePath: /dev/termination-log
   474              terminationMessagePolicy: File
   475              volumeMounts:
   476                - name: scripts
   477                  mountPath: /kb-scripts
   478          containers:
   479            - name: bookies
   480              command:
   481                - /kb-scripts/start-bookies.sh
   482              env:
   483              {{- if .Values.debugEnabled }}
   484              - name: PULSAR_LOG_ROOT_LEVEL
   485                value: DEBUG
   486              - name: PULSAR_LOG_LEVEL
   487                value: DEBUG
   488              {{- end }}
   489              - name: SERVICE_PORT
   490                value: "8000"
   491              - name: cluster_domain
   492                value: {{ .Values.clusterDomain }}
   493              lifecycle:
   494                preStop:
   495                  exec:
   496                    command: ["/kb-scripts/prestop-bookies.sh"]
   497              livenessProbe:
   498                failureThreshold: 60
   499                httpGet:
   500                  path: /api/v1/bookie/state
   501                  port: http
   502                  scheme: HTTP
   503                initialDelaySeconds: 10
   504                periodSeconds: 30
   505                successThreshold: 1
   506                timeoutSeconds: 5
   507              ports:
   508                - name: http
   509                  containerPort: 8000
   510                - name: bookie
   511                  containerPort: 3181
   512              readinessProbe:
   513                failureThreshold: 60
   514                httpGet:
   515                  path: /api/v1/bookie/is_ready
   516                  port: http
   517                  scheme: HTTP
   518                initialDelaySeconds: 10
   519                periodSeconds: 30
   520                successThreshold: 1
   521                timeoutSeconds: 5
   522              resources:
   523                requests:
   524                  cpu: 200m
   525                  memory: 512Mi
   526              securityContext:
   527                runAsUser: 0
   528                runAsGroup: 10000
   529              terminationMessagePath: /dev/termination-log
   530              terminationMessagePolicy: File
   531              volumeMounts:
   532                - mountPath: /pulsar/data/bookkeeper/journal
   533                  name: journal
   534                - mountPath: /pulsar/data/bookkeeper/ledgers
   535                  name: ledgers
   536                - name: scripts
   537                  mountPath: /kb-scripts
   538                - name: annotations
   539                  mountPath: /etc/annotations
   540                - name: bookies-env
   541                  mountPath: /opt/pulsar/none
   542                - name: pulsar-bookies-config
   543                  mountPath: /opt/pulsar/conf
   544            - name: metrics
   545              image: {{ .Values.images.metrics.registry }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }}
   546              imagePullPolicy: {{ default "IfNotPresent" .Values.images.metrics.pullPolicy }}
   547              securityContext:
   548                runAsNonRoot: false
   549                runAsUser: 0
   550              env:
   551                - name: JOB_NAME
   552                  value: bookie
   553                - name: SERVICE_PORT
   554                  value: "8000"
   555                - name: POD_NAME
   556                  value: $(KB_POD_NAME)
   557                - name: POD_NAMESPACE
   558                  value: $(KB_NAMESPACE)
   559                {{- if .Values.debugEnabled }}
   560                - name: LOG_LEVEL
   561                  value: debug
   562                {{- else }}
   563                - name: LOG_LEVEL
   564                  value: info
   565                {{- end }}
   566              command:
   567                - "/bin/agamotto"
   568                - "--config=/opt/agamotto/agamotto-config.yaml"
   569                - "--feature-gates=-pkg.translator.prometheus.NormalizeName"
   570              ports:
   571                - name: http-metrics
   572                  containerPort: {{ .Values.metrics.service.port }}
   573              volumeMounts:
   574                - name: agamotto-configuration
   575                  mountPath: /opt/agamotto
   576          volumes:
   577            - name: annotations
   578              downwardAPI:
   579                items:
   580                  - path: "component-replicas"
   581                    fieldRef:
   582                      fieldPath: metadata.annotations['apps.kubeblocks.io/component-replicas']
   583      - name: bookies-recovery
   584        workloadType: Stateful
   585        characterType: pulsar-bookie-recovery
   586        statefulSpec:
   587          updateStrategy: BestEffortParallel
   588        monitor:
   589          builtIn: false
   590          exporterConfig:
   591            scrapePath: /metrics
   592            scrapePort: {{ .Values.metrics.service.port }}
   593        configSpecs:
   594        - name: agamotto-configuration
   595          templateRef: {{ include "pulsar.name" . }}-agamotto-conf-tpl
   596          namespace: {{ .Release.Namespace }}
   597          volumeName: agamotto-configuration
   598        - name: bookies-recovery-env
   599          templateRef: {{ include "pulsar.name" . }}-recovery-env-tpl
   600          namespace: {{ .Release.Namespace }}
   601          constraintRef: pulsar-env-constraints
   602          keys:
   603            - conf
   604          asEnvFrom:
   605            - bookies-recovery
   606            - check-bookies
   607          volumeName: recovery-config-env
   608        scriptSpecs:
   609          - name: pulsar-scripts
   610            templateRef: {{ include "pulsar.name" . }}-scripts
   611            namespace: {{ .Release.Namespace }}
   612            volumeName: scripts
   613            defaultMode: 0555
   614        podSpec:
   615          securityContext:
   616            runAsNonRoot: true
   617            runAsUser: 10000
   618            fsGroup: 0
   619            runAsGroup: 0
   620          initContainers:
   621            - name: check-bookies
   622              command:
   623              - /kb-scripts/check-bookies.sh
   624              env:
   625              {{- if .Values.debugEnabled }}
   626              - name: PULSAR_LOG_ROOT_LEVEL
   627                value: DEBUG
   628              - name: PULSAR_LOG_LEVEL
   629                value: DEBUG
   630              {{- end }}
   631              volumeMounts:
   632              - name: scripts
   633                mountPath: /kb-scripts
   634              securityContext:
   635                privileged: true
   636                runAsNonRoot: false
   637                runAsUser: 0
   638          containers:
   639            - name: bookies-recovery
   640              securityContext:
   641                allowPrivilegeEscalation: false
   642                runAsNonRoot: true
   643                runAsUser: 10000
   644                capabilities:
   645                  drop:
   646                  - ALL
   647                privileged: false
   648                runAsGroup: 0
   649              command:
   650                - /kb-scripts/start-bookies-recovery.sh
   651              env:
   652              {{- if .Values.debugEnabled }}
   653              - name: PULSAR_LOG_ROOT_LEVEL
   654                value: DEBUG
   655              - name: PULSAR_LOG_LEVEL
   656                value: DEBUG
   657              {{- end }}
   658              - name: SERVICE_PORT
   659                value: "8000"
   660              - name: httpServerEnabled
   661                value: "true"
   662              - name: httpServerPort
   663                value: "8000"
   664              - name: prometheusStatsHttpPort
   665                value: "8000"
   666              - name: useHostNameAsBookieID
   667                value: "true"
   668              ports:
   669              - name: http
   670                containerPort: 8000
   671              - name: bookie
   672                containerPort: 3181
   673              volumeMounts:
   674              - name: scripts
   675                mountPath: /kb-scripts
   676              - name: recovery-config-env
   677                mountPath: /opt/pulsar/none
   678            - name: metrics
   679              image: {{ .Values.images.metrics.registry }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }}
   680              imagePullPolicy: {{ default "IfNotPresent" .Values.images.metrics.pullPolicy }}
   681              securityContext:
   682                runAsNonRoot: false
   683                runAsUser: 0
   684              env:
   685                - name: JOB_NAME
   686                  value: recovery
   687                - name: SERVICE_PORT
   688                  value: "8000"
   689                - name: POD_NAME
   690                  value: $(KB_POD_NAME)
   691                - name: POD_NAMESPACE
   692                  value: $(KB_NAMESPACE)
   693                {{- if .Values.debugEnabled }}
   694                - name: LOG_LEVEL
   695                  value: debug
   696                {{- else }}
   697                - name: LOG_LEVEL
   698                  value: info
   699                {{- end }}
   700              command:
   701                - "/bin/agamotto"
   702                - "--config=/opt/agamotto/agamotto-config.yaml"
   703                - "--feature-gates=-pkg.translator.prometheus.NormalizeName"
   704              ports:
   705                - name: http-metrics
   706                  containerPort: {{ .Values.metrics.service.port }}
   707              volumeMounts:
   708                - name: agamotto-configuration
   709                  mountPath: /opt/agamotto
   710      - name: zookeeper
   711        workloadType: Stateful
   712        characterType: zookeeper
   713        statefulSpec:
   714          updateStrategy: BestEffortParallel
   715        monitor:
   716          builtIn: false
   717          exporterConfig:
   718            scrapePath: /metrics
   719            scrapePort: {{ .Values.metrics.service.port }}
   720        configSpecs:
   721          - name: agamotto-configuration
   722            templateRef: {{ include "pulsar.name" . }}-agamotto-conf-tpl
   723            namespace: {{ .Release.Namespace }}
   724            volumeName: agamotto-configuration
   725          - name: zookeeper-env
   726            templateRef: {{ include "pulsar.name" . }}-zookeeper-env-tpl
   727            namespace: {{ .Release.Namespace }}
   728            volumeName: zookeeper-config-env
   729            constraintRef: pulsar-env-constraints
   730            keys:
   731              - conf
   732            asEnvFrom:
   733              - zookeeper
   734        scriptSpecs:
   735          - name: pulsar-scripts
   736            templateRef: {{ include "pulsar.name" . }}-scripts
   737            namespace: {{ .Release.Namespace }}
   738            volumeName: scripts
   739            defaultMode: 0555
   740        service:
   741          ports:
   742            - name: client
   743              port: 2181
   744              targetPort: client
   745        podSpec:
   746          securityContext:
   747            fsGroup: 0
   748            runAsGroup: 0
   749            runAsNonRoot: true
   750            runAsUser: 10000
   751          containers:
   752            - name: zookeeper
   753              command:
   754                - /kb-scripts/start-zookeeper.sh
   755              env:
   756                {{- if .Values.debugEnabled }}
   757                - name: PULSAR_LOG_ROOT_LEVEL
   758                  value: DEBUG
   759                - name: PULSAR_LOG_LEVEL
   760                  value: DEBUG
   761                {{- end }}
   762                - name: SERVICE_PORT
   763                  value: "8000"
   764                - name: EXTERNAL_PROVIDED_SERVERS
   765                  value: "false"
   766                - name: OPTS
   767                  value: "-Dlog4j2.formatMsgNoLookups=true"
   768              ports:
   769                - name: client
   770                  containerPort: 2181
   771                - name: tcp-quorum
   772                  containerPort: 2888
   773                - name: tcp-election
   774                  containerPort: 3888
   775                - name: http
   776                  containerPort: 8000
   777              livenessProbe:
   778                exec:
   779                  command:
   780                    - bash
   781                    - -c
   782                    - echo ruok | nc -q 1 localhost 2181 | grep imok
   783                failureThreshold: 10
   784                initialDelaySeconds: 5
   785                periodSeconds: 30
   786                successThreshold: 1
   787                timeoutSeconds: 30
   788              resources:
   789                requests:
   790                  cpu: 50m
   791                  memory: 256Mi
   792              securityContext:
   793                allowPrivilegeEscalation: false
   794                capabilities:
   795                  drop:
   796                    - ALL
   797                privileged: false
   798                runAsGroup: 0
   799                runAsNonRoot: true
   800                runAsUser: 10000
   801              terminationMessagePath: /dev/termination-log
   802              terminationMessagePolicy: File
   803              volumeMounts:
   804                - mountPath: /pulsar/data
   805                  name: data
   806                - mountPath: /pulsar/data-log
   807                  name: data-log
   808                - name: scripts
   809                  mountPath: /kb-scripts
   810                - name: zookeeper-config-env
   811                  mountPath: /opt/pulsar/none
   812            - name: metrics
   813              image: {{ .Values.images.metrics.registry }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }}
   814              imagePullPolicy: {{ default "IfNotPresent" .Values.images.metrics.pullPolicy }}
   815              securityContext:
   816                runAsNonRoot: false
   817                runAsUser: 0
   818              env:
   819                - name: JOB_NAME
   820                  value: zookeeper
   821                - name: SERVICE_PORT
   822                  value: "8000"
   823                - name: POD_NAME
   824                  value: $(KB_POD_NAME)
   825                - name: POD_NAMESPACE
   826                  value: $(KB_NAMESPACE)
   827                {{- if .Values.debugEnabled }}
   828                - name: LOG_LEVEL
   829                  value: debug
   830                {{- else }}
   831                - name: LOG_LEVEL
   832                  value: info
   833                {{- end }}
   834              command:
   835                - "/bin/agamotto"
   836                - "--config=/opt/agamotto/agamotto-config.yaml"
   837                - "--feature-gates=-pkg.translator.prometheus.NormalizeName"
   838              ports:
   839                - name: http-metrics
   840                  containerPort: {{ .Values.metrics.service.port }}
   841              volumeMounts:
   842                - name: agamotto-configuration
   843                  mountPath: /opt/agamotto