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

     1  apiVersion: apps.kubeblocks.io/v1alpha1
     2  kind: ClusterDefinition
     3  metadata:
     4    name: pulsar-zookeeper
     5    labels:
     6      {{- include "pulsar.labels" . | nindent 4 }}
     7  spec:
     8    type: zookeeper
     9    connectionCredential:
    10      username: ""
    11      password: ""
    12      endpoint: "$(SVC_FQDN)"
    13      port: "$(SVC_PORT_client)"
    14    componentDefs:
    15      - name: zookeeper
    16        workloadType: Stateful
    17        characterType: zookeeper
    18        statefulSpec:
    19          updateStrategy: BestEffortParallel
    20        monitor:
    21          builtIn: false
    22          exporterConfig:
    23            scrapePath: /metrics
    24            scrapePort: {{ .Values.metrics.service.port }}
    25        configSpecs:
    26          - name: agamotto-configuration
    27            templateRef: {{ include "pulsar.name" . }}-agamotto-conf-tpl
    28            namespace: {{ .Release.Namespace }}
    29            volumeName: agamotto-configuration
    30          - name: zookeeper-env
    31            templateRef: {{ include "pulsar.name" . }}-zookeeper-env-tpl
    32            namespace: {{ .Release.Namespace }}
    33            volumeName: zookeeper-config-env
    34            constraintRef: pulsar-env-constraints
    35            keys:
    36              - conf
    37            asEnvFrom:
    38              - zookeeper
    39        scriptSpecs:
    40          - name: pulsar-scripts
    41            templateRef: {{ include "pulsar.name" . }}-scripts
    42            namespace: {{ .Release.Namespace }}
    43            volumeName: scripts
    44            defaultMode: 0555
    45        service:
    46          ports:
    47            - name: client
    48              port: 2181
    49              targetPort: client
    50        podSpec:
    51          securityContext:
    52            fsGroup: 0
    53            runAsGroup: 0
    54            runAsNonRoot: true
    55            runAsUser: 10000
    56          containers:
    57            - name: zookeeper
    58              command:
    59                - /kb-scripts/start-zookeeper.sh
    60              env:
    61                {{- if .Values.debugEnabled }}
    62                - name: PULSAR_LOG_ROOT_LEVEL
    63                  value: DEBUG
    64                - name: PULSAR_LOG_LEVEL
    65                  value: DEBUG
    66                {{- end }}
    67                - name: EXTERNAL_PROVIDED_SERVERS
    68                  value: "false"
    69                - name: OPTS
    70                  value: "-Dlog4j2.formatMsgNoLookups=true"
    71              ports:
    72                - name: client
    73                  containerPort: 2181
    74                - name: tcp-quorum
    75                  containerPort: 2888
    76                - name: tcp-election
    77                  containerPort: 3888
    78                - name: http
    79                  containerPort: 8000
    80              livenessProbe:
    81                exec:
    82                  command:
    83                    - bash
    84                    - -c
    85                    - echo ruok | nc -q 1 localhost 2181 | grep imok
    86                failureThreshold: 10
    87                initialDelaySeconds: 5
    88                periodSeconds: 30
    89                successThreshold: 1
    90                timeoutSeconds: 30
    91              resources:
    92                requests:
    93                  cpu: 50m
    94                  memory: 256Mi
    95              securityContext:
    96                allowPrivilegeEscalation: false
    97                capabilities:
    98                  drop:
    99                    - ALL
   100                privileged: false
   101                runAsGroup: 0
   102                runAsNonRoot: true
   103                runAsUser: 10000
   104              terminationMessagePath: /dev/termination-log
   105              terminationMessagePolicy: File
   106              volumeMounts:
   107                - mountPath: /pulsar/data
   108                  name: data
   109                - mountPath: /pulsar/data-log
   110                  name: data-log
   111                - name: scripts
   112                  mountPath: /kb-scripts
   113                - name: zookeeper-config-env
   114                  mountPath: /opt/pulsar/none
   115            - name: metrics
   116              image: {{ .Values.images.metrics.registry }}/{{ .Values.images.metrics.repository }}:{{ .Values.images.metrics.tag }}
   117              imagePullPolicy: {{ default "IfNotPresent" .Values.images.metrics.pullPolicy }}
   118              securityContext:
   119                runAsNonRoot: false
   120                runAsUser: 0
   121              env:
   122                - name: JOB_NAME
   123                  value: zookeeper
   124                - name: SERVICE_PORT
   125                  value: "8000"
   126                - name: POD_NAME
   127                  value: $(KB_POD_NAME)
   128                - name: POD_NAMESPACE
   129                  value: $(KB_NAMESPACE)
   130                {{- if .Values.debugEnabled }}
   131                - name: LOG_LEVEL
   132                  value: debug
   133                {{- else }}
   134                - name: LOG_LEVEL
   135                  value: info
   136                {{- end }}
   137              command:
   138                - "/bin/agamotto"
   139                - "--config=/opt/agamotto/agamotto-config.yaml"
   140                - "--feature-gates=-pkg.translator.prometheus.NormalizeName"
   141              ports:
   142                - name: http-metrics
   143                  containerPort: {{ .Values.metrics.service.port }}
   144              volumeMounts:
   145                - name: agamotto-configuration
   146                  mountPath: /opt/agamotto