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

     1  apiVersion: apps.kubeblocks.io/v1alpha1
     2  kind: ClusterDefinition
     3  metadata:
     4    name: nebula
     5    labels:
     6      {{- include "nebula.labels" . | nindent 4 }}
     7  spec:
     8    componentDefs:
     9      - name: nebula-console
    10        workloadType: Stateless
    11        characterType: nebula
    12        componentDefRef:
    13          - &graphdRef
    14            componentDefName: nebula-graphd
    15            componentRefEnv:
    16              - name: GRAPHD_SVC_PORT
    17                valueFrom:
    18                  type: FieldRef
    19                  fieldPath: $.componentDef.service.ports[?(@.name == "thrift")].port
    20              - name: GRAPHD_SVC_NAME
    21                valueFrom:
    22                  type: ServiceRef
    23        podSpec:
    24          containers:
    25            - name: nebula-console
    26              imagePullPolicy: {{default .Values.nebula.metad.image.pullPolicy "IfNotPresent"}}
    27              command: ["/bin/sh"]
    28              args: ["-c", "trap : TERM INT; sleep infinity & wait"]
    29      - name: nebula-graphd
    30        configSpecs:
    31          - name: nebula-graphd-config
    32            templateRef: nebula-graphd-config-template
    33            namespace: {{ .Release.Namespace }}
    34            volumeName: nebula-graphd
    35        workloadType: Stateful
    36        characterType: nebula-graphd
    37        service:
    38          ports:
    39            - name: thrift
    40              port: 9669
    41              targetPort: thrift
    42              protocol: TCP
    43            - name: http
    44              port: 19669
    45              targetPort: http
    46              protocol: TCP
    47            - name: http2
    48              port: 19670
    49              targetPort: http2
    50              protocol: TCP
    51        componentDefRef:
    52          - &metadRef
    53            componentDefName: nebula-metad
    54            componentRefEnv:
    55              - name: NEBULA_METAD_SVC
    56                valueFrom:
    57                  type: HeadlessServiceRef
    58                  format: $(POD_FQDN){{ .Values.clusterDomain }}:9559
    59                  joinWith: ","
    60        podSpec:
    61          securityContext:
    62            fsGroup: 1001
    63          containers:
    64            - name: nebula-graphd
    65              command:
    66                - /bin/bash
    67                - -c
    68                - |
    69                  set -ex
    70                  trap : TERM INT
    71                  exec /usr/local/nebula/bin/nebula-graphd --flagfile=/usr/local/nebula/etc/nebula-graphd.conf --meta_server_addrs=$NEBULA_METAD_SVC --local_ip=${KB_POD_FQDN}{{ .Values.clusterDomain }} --daemonize=false
    72              imagePullPolicy: {{default .Values.nebula.graphd.image.pullPolicy "IfNotPresent"}}
    73              ports:
    74                - containerPort: 9669
    75                  name: thrift
    76                  protocol: TCP
    77                - containerPort: 19669
    78                  name: http
    79                  protocol: TCP
    80                - containerPort: 19670
    81                  name: http2
    82                  protocol: TCP
    83              readinessProbe:
    84                failureThreshold: 3
    85                httpGet:
    86                  path: /status
    87                  port: http
    88                  scheme: HTTP
    89                initialDelaySeconds: 10
    90                periodSeconds: 10
    91                successThreshold: 1
    92                timeoutSeconds: 5
    93              volumeMounts:
    94                - mountPath: /usr/local/nebula/data
    95                  name: data
    96                - mountPath: /usr/local/nebula/logs
    97                  name: logs
    98                - mountPath: /usr/local/nebula/etc
    99                  name: nebula-graphd
   100      - name: nebula-metad
   101        configSpecs:
   102          - name: nebula-metad-config
   103            templateRef: nebula-metad-config-template
   104            namespace: {{ .Release.Namespace }}
   105            volumeName: nebula-metad
   106        workloadType: Stateful
   107        characterType: nebula-metad
   108        componentDefRef:
   109          - *metadRef
   110        podSpec:
   111          containers:
   112            - name: nebula-metad
   113              command:
   114                - /bin/bash
   115                - -c
   116                - |
   117                  set -ex
   118                  trap : TERM INT
   119                  exec /usr/local/nebula/bin/nebula-metad --flagfile=/usr/local/nebula/etc/nebula-metad.conf --meta_server_addrs=$NEBULA_METAD_SVC --local_ip=${KB_POD_FQDN}{{ .Values.clusterDomain }}  --daemonize=false
   120              imagePullPolicy: {{default .Values.nebula.metad.image.pullPolicy "IfNotPresent"}}
   121              ports:
   122              - containerPort: 9559
   123                name: thrift
   124                protocol: TCP
   125              - containerPort: 19559
   126                name: http
   127                protocol: TCP
   128              - containerPort: 19560
   129                name: http2
   130                protocol: TCP
   131              # readinessProbe:
   132              #   failureThreshold: 3
   133              #   httpGet:
   134              #     path: /status
   135              #     port: http
   136              #     scheme: HTTP
   137              #   initialDelaySeconds: 10
   138              #   periodSeconds: 10
   139              #   successThreshold: 1
   140              #   timeoutSeconds: 5
   141              volumeMounts:
   142                - mountPath: /usr/local/nebula/data
   143                  name: data
   144                - mountPath: /usr/local/nebula/logs
   145                  name: logs
   146                - mountPath: /usr/local/nebula/etc
   147                  name: nebula-metad
   148      - name: nebula-storaged
   149        configSpecs:
   150          - name: nebula-storaged-config
   151            templateRef: nebula-storaged-config-template
   152            namespace: {{ .Release.Namespace }}
   153            volumeName: nebula-storaged
   154        scriptSpecs:
   155          - name: nebula-storaged-scripts
   156            templateRef: nebula-storaged-scripts
   157            namespace: {{ .Release.Namespace }}
   158            volumeName: scripts
   159            defaultMode: 0555
   160        workloadType: Stateful
   161        characterType: nebula-storaged
   162        componentDefRef:
   163          - *metadRef
   164          - *graphdRef
   165        podSpec:
   166          securityContext:
   167            fsGroup: 1001
   168          containers:
   169            - name: nebula-storaged
   170              command:
   171                - /bin/bash
   172                - -c
   173                - |
   174                  trap : TERM INT
   175                  exec /usr/local/nebula/bin/nebula-storaged --flagfile=/usr/local/nebula/etc/nebula-storaged.conf --meta_server_addrs=$NEBULA_METAD_SVC --local_ip=$KB_POD_FQDN"{{ .Values.clusterDomain }}" --daemonize=false
   176              imagePullPolicy: {{default .Values.nebula.storaged.image.pullPolicy "IfNotPresent"}}
   177              ports:
   178                - containerPort: 9779
   179                  name: thrift
   180                  protocol: TCP
   181                - containerPort: 19779
   182                  name: http
   183                  protocol: TCP
   184                - containerPort: 19780
   185                  name: http2
   186                  protocol: TCP
   187                - containerPort: 9778
   188                  name: admin
   189                  protocol: TCP
   190              readinessProbe:
   191                failureThreshold: 3
   192                httpGet:
   193                  path: /status
   194                  port: http
   195                  scheme: HTTP
   196                initialDelaySeconds: 10
   197                periodSeconds: 10
   198                successThreshold: 1
   199                timeoutSeconds: 5
   200              volumeMounts:
   201                - mountPath: /usr/local/nebula/etc
   202                  name: nebula-storaged
   203                - mountPath: /usr/local/nebula/data
   204                  name: data
   205                - mountPath: /usr/local/nebula/logs
   206                  name: logs
   207            - name: nebula-console
   208              imagePullPolicy: {{default .Values.nebula.metad.image.pullPolicy "IfNotPresent"}}
   209              command: ["/bin/sh"]
   210              args: ["-c", "trap : TERM INT; sleep infinity & wait"]
   211              lifecycle:
   212                postStart:
   213                  exec:
   214                    command: ["/bin/sh", "-c", "/scripts/post-start.sh"]
   215                preStop:
   216                  exec:
   217                    command: ["/bin/sh", "-c", "/scripts/pre-stop.sh"]
   218              volumeMounts:
   219                - name: annotations
   220                  mountPath: /etc/annotations
   221                - name: scripts
   222                  mountPath: /scripts
   223          volumes:
   224            - name: annotations
   225              downwardAPI:
   226                items:
   227                  - path: "component-replicas"
   228                    fieldRef:
   229                      fieldPath: metadata.annotations['apps.kubeblocks.io/component-replicas']