Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] kafka cluster custom-ops serviceaccount not found #224

Closed
JashBook opened this issue Jan 10, 2024 · 1 comment · Fixed by apecloud/kubeblocks#6415
Closed

[BUG] kafka cluster custom-ops serviceaccount not found #224

JashBook opened this issue Jan 10, 2024 · 1 comment · Fixed by apecloud/kubeblocks#6415
Assignees
Labels
bug Something isn't working
Milestone

Comments

@JashBook
Copy link
Collaborator

Describe the bug

kbcli version
Kubernetes: v1.26.6-gke.1700
KubeBlocks: 0.8.0-beta.49
kbcli: 0.8.0-beta.43

To Reproduce
Steps to reproduce the behavior:

  1. create kafka cluster
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: kafka-ysgolk
  namespace: default
spec:
  clusterDefinitionRef: kafka
  clusterVersionRef: kafka-3.3.2
  terminationPolicy: WipeOut
  componentSpecs:
    - name: broker
      componentDef: kafka-combine-server
      replicas: 1
      resources:
        requests:
          cpu: 500m
          memory: 0.5Gi
        limits:
          cpu: 500m
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi
        - name: metadata
          spec:
            accessModes:
            - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi
  1. custom-ops kafka-topic
kbcli cluster custom-ops kafka-topic --cluster kafka-ysgolk --type create --topic testt --partitions 2 --component broker
  1. See error
kubectl get ops
NAME                                                    TYPE              CLUSTER           STATUS    PROGRESS   AGE
kafka-ysgolk-custom-cj9fr                               Custom            kafka-ysgolk      Running   0/1        3m49s

kubectl get job
NAME                                 COMPLETIONS   DURATION   AGE
kafka-ysgolk-custom-cj9fr-broker-0   0/1           4m35s      4m35s

describe job

kubectl describe job kafka-ysgolk-custom-cj9fr-broker-0 
Name:             kafka-ysgolk-custom-cj9fr-broker-0
Namespace:        default
Selector:         controller-uid=ed50e9a6-a2b8-4d83-ac14-aca225a3133d
Labels:           app.kubernetes.io/managed-by=kubeblocks
                  apps.kubeblocks.io/component-name=broker
                  ops.kubeblocks.io/ops-name=kafka-ysgolk-custom-cj9fr
Annotations:      batch.kubernetes.io/job-tracking: 
Controlled By:    OpsRequest/kafka-ysgolk-custom-cj9fr
Parallelism:      1
Completions:      1
Completion Mode:  NonIndexed
Start Time:       Wed, 10 Jan 2024 21:32:28 +0800
Pods Statuses:    0 Running / 0 Succeeded / 0 Failed
Pod Template:
  Labels:           controller-uid=ed50e9a6-a2b8-4d83-ac14-aca225a3133d
                    job-name=kafka-ysgolk-custom-cj9fr-broker-0
  Service Account:  kb-kafka-ysgolk
  Containers:
   kafka-topic:
    Image:      docker.io/bitnami/kafka:3.3.2-debian-11-r54
    Port:       <none>
    Host Port:  <none>
    Command:
      bash
      -c
      set -e
      KB_CONNECT_ENDPOINT="${KB_COMP_SVC_NAME}:${KB_COMP_SVC_PORT_KAFKA_CLIENT}"
      command="/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server ${KB_CONNECT_ENDPOINT} --topic ${topic} --${type}"
      if [[ ${type} == "delete" ]];then
        echo $command
        $command
        return
      fi
      
      function addCommandArg(){
         local key=$1
         local value=$2
         if [[ ! -z ${value} ]];then
            command="${command} --${key}=${value}"
         fi
      }
      addCommandArg replication-factor "${replicas}"
      addCommandArg partitions "${partitions}"
      addCommandArg config "${config}"
      
      if [[ ${type} == "create" ]]; then
         command="${command} --if-not-exists"
      else
         command="${command} --if-exists"
      fi
      echo "${command}"
      ${command}
      
    Limits:
      cpu:     0
      memory:  0
    Environment:
      KB_CLUSTER_NAME:                kafka-ysgolk
      KB_COMP_NAME:                   broker
      KB_CLUSTER_COMP_NAME:           kafka-ysgolk-broker
      KB_COMP_REPLICAS:               1
      KB_COMP_SERVICE_VERSION:        3.3.2
      KB_COMP_HEADLESS_SVC_NAME:      kafka-ysgolk-broker-headless
      KB_ACCOUNT_USERNAME:            client
      KB_ACCOUNT_PASSWORD:            <set to the key 'password' in secret 'kafka-ysgolk-broker-account-client'>  Optional: false
      KB_COMP_SVC_NAME:               kafka-ysgolk-broker-broker
      KB_COMP_SVC_PORT_KAFKA_CTRLR:   9093
      KB_COMP_SVC_PORT_KAFKA_CLIENT:  9092
      KB_COMP_SVC_PORT_METRICS:       5556
      partitions:                     2
      topic:                          testt
      type:                           create
    Mounts:                           <none>
  Volumes:                            <none>
Events:
  Type     Reason        Age                  From            Message
  ----     ------        ----                 ----            -------
  Warning  FailedCreate  31s (x6 over 5m21s)  job-controller  Error creating: pods "kafka-ysgolk-custom-cj9fr-broker-0-" is forbidden: error looking up service account default/kb-kafka-ysgolk: serviceaccount "kb-kafka-ysgolk" not found
➜

Expected behavior
kafka cluster custom-ops success.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@JashBook JashBook added the bug Something isn't working label Jan 10, 2024
@JashBook JashBook added this to the Release 0.8.0 milestone Jan 10, 2024
@wangyelei
Copy link
Contributor

fixed at apecloud/kubeblocks#6415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants