kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

[BUG] componentdefinition service annotations not work

Open iziang opened this issue 1 year ago • 2 comments

apiVersion: apps.kubeblocks.io/v1alpha1
kind: ComponentDefinition
metadata:
  annotations:
    meta.helm.sh/release-name: sr
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2024-02-20T03:46:59Z"
  finalizers:
  - componentdefinition.kubeblocks.io/finalizer
  generation: 7
  labels:
    app.kubernetes.io/instance: sr
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: starrocks
    app.kubernetes.io/version: 3.2.2
    helm.sh/chart: starrocks-0.7.0
  name: starrocks-fe-sd
  resourceVersion: "1375885"
  uid: 24ee77ea-ac43-4503-bb23-9fdc6134d223
spec:
  configs:
  - constraintRef: starrocks-fe-config-constraints
    name: fe-cm
    namespace: default
    templateRef: starrocks-fe-sd-cm
    volumeName: fe-cm
  description: A StarRocks FE v3.2.2 component definition for Kubernetes
  lifecycleActions:
    accountProvision:
      customHandler:
        exec:
          command:
          - sh
          - -c
          - |
            mysql -P9030 -h127.0.0.1 -uroot -e "SET PASSWORD = PASSWORD('${STARROCKS_PASSWORD}')"
        image: docker.io/starrocks/fe-ubuntu:3.2.2
        timeoutSeconds:omitempty: 0
  logConfigs:
  - filePathPattern: /opt/starrocks/fe/log/fe.audit.log
    name: audit
  - filePathPattern: /opt/starrocks/fe/log/fe.warn.log
    name: error
  - filePathPattern: /opt/starrocks/fe/log/fe.log
    name: running
  - filePathPattern: /opt/starrocks/fe/log/fe.big_query.log
    name: slow
  minReadySeconds: 0
  provider: kubeblocks
  roleArbitrator: External
  runtime:
    containers:
    - command:
      - bash
      - -c
      - |
        /opt/starrocks/fe_entrypoint.sh ${FE_DISCOVERY_SERVICE_NAME}
      env:
      - name: TZ
        value: Asia/Shanghai
      - name: POD_NAME
        valueFrom:
          fieldRef:
            apiVersion: v1
            fieldPath: metadata.name
      - name: POD_IP
        valueFrom:
          fieldRef:
            apiVersion: v1
            fieldPath: status.podIP
      - name: HOST_IP
        valueFrom:
          fieldRef:
            apiVersion: v1
            fieldPath: status.hostIP
      - name: POD_NAMESPACE
        valueFrom:
          fieldRef:
            apiVersion: v1
            fieldPath: metadata.namespace
      - name: HOST_TYPE
        value: FQDN
      - name: COMPONENT_NAME
        value: fe
      - name: CONFIGMAP_MOUNT_PATH
        value: /etc/starrocks/fe/conf
      - name: SERVICE_PORT
        value: "8030"
      image: docker.io/starrocks/fe-ubuntu:3.2.2
      imagePullPolicy: IfNotPresent
      lifecycle:
        postStart:
          exec:
            command:
            - /bin/sh
            - -c
            - /scripts/fe-post-start.sh
        preStop:
          exec:
            command:
            - /opt/starrocks/fe_prestop.sh
      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /api/health
          port: 8030
          scheme: HTTP
        periodSeconds: 5
        successThreshold: 1
        timeoutSeconds: 1
      name: fe
      ports:
      - containerPort: 8030
        name: http-port
        protocol: TCP
      - containerPort: 9020
        name: rpc-port
        protocol: TCP
      - containerPort: 9030
        name: query-port
        protocol: TCP
      - containerPort: 9010
        name: edit-log-port
        protocol: TCP
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /api/health
          port: 8030
          scheme: HTTP
        periodSeconds: 5
        successThreshold: 1
        timeoutSeconds: 1
      resources: {}
      securityContext:
        allowPrivilegeEscalation: false
        readOnlyRootFilesystem: false
      startupProbe:
        failureThreshold: 60
        httpGet:
          path: /api/health
          port: 8030
          scheme: HTTP
        periodSeconds: 5
        successThreshold: 1
        timeoutSeconds: 1
      volumeMounts:
      - mountPath: /opt/starrocks/fe/meta
        name: data
      - mountPath: /opt/starrocks/fe/conf
        name: fe-cm
      - mountPath: /opt/starrocks/fe/log
        name: log
      - mountPath: /scripts
        name: scripts
    volumes:
    - emptyDir: {}
      name: log
  scripts:
  - defaultMode: 365
    name: fe-scripts
    namespace: default
    templateRef: starrocks-scripts
    volumeName: scripts
  serviceKind: starrocks-fe
  serviceVersion: 3.2.2
  services:
  - annotations:
      kubeblocks.io/service-mirror-primary-service: "true"
    generatePodOrdinalService: false
    name: fe
    serviceName: fe
    spec:
      ipFamilies:
      - IPv4
      ipFamilyPolicy: PreferDualStack
      ports:
      - name: fe-http
        port: 8030
        protocol: TCP
        targetPort: http-port
      - name: fe-mysql
        port: 9030
        protocol: TCP
        targetPort: query-port
  systemAccounts:
  - initAccount: true
    name: root
    passwordGenerationPolicy:
      length: 10
      letterCase: MixedCases
      numDigits: 5
      numSymbols: 0
  updateStrategy: Parallel
  vars:
  - name: FE_DISCOVERY_SERVICE_NAME
    valueFrom:
      serviceVarRef:
        compDef: starrocks-fe-sd
        generatePodOrdinalServiceVar: false
        host: Required
        name: fe
  - name: STARROCKS_USER
    valueFrom:
      credentialVarRef:
        compDef: starrocks-fe-sd
        name: root
        optional: false
        username: Required
  - name: STARROCKS_PASSWORD
    valueFrom:
      credentialVarRef:
        compDef: starrocks-fe-sd
        name: root
        optional: false
        password: Required
  - name: MYSQL_PWD
    valueFrom:
      credentialVarRef:
        compDef: starrocks-fe-sd
        name: root
        optional: false
        password: Required
  volumes:
  - highWatermark: 0
    name: data
    needSnapshot: true
status:
  observedGeneration: 7
  phase: Available

iziang avatar Mar 14 '24 04:03 iziang

annotation中没有kubeblocks.io/service-mirror-primary-service: "true"

apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2024-03-14T04:27:01Z"
  finalizers:
  - cluster.kubeblocks.io/finalizer
  labels:
    app.kubernetes.io/instance: yunji-6857c5b89d
    app.kubernetes.io/managed-by: kubeblocks
    apps.kubeblocks.io/component-name: starrocks-fe-sd
  name: yunji-6857c5b89d-starrocks-fe-sd
  namespace: kubeblocks-cloud-ns
  ownerReferences:
  - apiVersion: apps.kubeblocks.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: Component
    name: yunji-6857c5b89d-starrocks-fe-sd
    uid: af9e5c2d-b839-444e-97ad-4c0cf5137485
  resourceVersion: "1377532"
  uid: 35068d33-8ba2-4e2c-80da-098016920ce9
spec:
  clusterIP: 192.168.194.149
  clusterIPs:
  - 192.168.194.149
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: fe-mysql
    port: 9030
    protocol: TCP
    targetPort: query-port
  - name: fe-http
    port: 8030
    protocol: TCP
    targetPort: http-port
  selector:
    app.kubernetes.io/instance: yunji-6857c5b89d
    app.kubernetes.io/managed-by: kubeblocks
    apps.kubeblocks.io/component-name: starrocks-fe-sd
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

iziang avatar Mar 14 '24 04:03 iziang

This issue has been marked as stale because it has been open for 30 days with no activity

github-actions[bot] avatar Apr 15 '24 02:04 github-actions[bot]