kafka-operator icon indicating copy to clipboard operation
kafka-operator copied to clipboard

operator crashes when the statefulset exists

Open ankon opened this issue 7 years ago • 0 comments

Basically I run the operator, add the cluster CRD (with confluentinc/cp-kafka 3.3.0), and then the operator (0.2.0) creates the statefulset ... and crashes right after it.

time="2017-10-26T15:22:08Z" level=info msg="New CRD added, creating cluster" KafkaClusterEventType=1 clusterName=kafka event-type=1 method=processEvent 
Error get sts
STS dosnt exist, creating
{{1073741824 0} {<nil>} 1Gi BinarySI}
time="2017-10-26T15:22:08Z" level=debug msg="Generated KafkaOptions from Struct to Env Vars" method=GenerateKafkaOptions options="[{COMPRESSION_TYPE gzip nil} {LOG_RETENTION_BYTES -1 nil} {LOG_RETENTION_HOURS -1 nil} {LOG_ROLL_HOURS -1 nil}]" package=util 
[{COMPRESSION_TYPE gzip nil} {LOG_RETENTION_BYTES -1 nil} {LOG_RETENTION_HOURS -1 nil} {LOG_ROLL_HOURS -1 nil} {NAMESPACE  &EnvVarSource{FieldRef:&ObjectFieldSelector{APIVersion:,FieldPath:metadata.namespace,},ResourceFieldRef:nil,ConfigMapKeyRef:nil,SecretKeyRef:nil,}} {KAFKA_ZOOKEEPER_CONNECT zookeeper.development.svc.cluster.local nil} {KAFKA_HEAP_OPTS -Xmx644M nil} {KAFKA_METRIC_REPORTERS com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter nil} {KAFKA_CRUISE_CONTROL_METRICS_REPORTER_BOOTSTRAP_SERVER kafka-0.kafka.development.svc.cluster.local:9092 nil}]
&StatefulSet{ObjectMeta:k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta{Name:kafka,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,CreationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{component: kafka,creator: kafka-operator,name: kafka,role: data,},Annotations:map[string]string{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,},Spec:StatefulSetSpec{Replicas:*3,Selector:nil,Template:k8s_io_kubernetes_pkg_api_v1.PodTemplateSpec{ObjectMeta:k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta{Name:,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,CreationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:<nil>,DeletionGracePeriodSeconds:nil,Labels:map[string]string{component: kafka,creator: kafka-operator,name: kafka,role: data,},Annotations:map[string]string{},OwnerReferences:[],Finalizers:[],ClusterName:,Initializers:nil,},Spec:PodSpec{Volumes:[],Containers:[{kafka confluentinc/cp-kafka:3.3.0 [/bin/bash -c export KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://$(hostname).kafka.$(NAMESPACE).svc.cluster.local:9092; 
set -ex
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
export KAFKA_BROKER_ID=${BASH_REMATCH[1]}
/etc/confluent/docker/run] []  [{kafka 0 9092  }] [] [{COMPRESSION_TYPE gzip nil} {LOG_RETENTION_BYTES -1 nil} {LOG_RETENTION_HOURS -1 nil} {LOG_ROLL_HOURS -1 nil} {NAMESPACE  EnvVarSource{FieldRef:&ObjectFieldSelector{APIVersion:,FieldPath:metadata.namespace,},ResourceFieldRef:nil,ConfigMapKeyRef:nil,SecretKeyRef:nil,}} {KAFKA_ZOOKEEPER_CONNECT zookeeper.development.svc.cluster.local nil} {KAFKA_HEAP_OPTS -Xmx644M nil} {KAFKA_METRIC_REPORTERS com.linkedin.kafka.cruisecontrol.metricsreporter.CruiseControlMetricsReporter nil} {KAFKA_CRUISE_CONTROL_METRICS_REPORTER_BOOTSTRAP_SERVER kafka-0.kafka.development.svc.cluster.local:9092 nil}] {map[memory:{{1073741824 0} {<nil>} 1Gi BinarySI}] map[cpu:{{1 -1} {<nil>}  DecimalSI} memory:{{644 6} {<nil>}  DecimalSI}]} [] nil nil nil    nil false false false}],RestartPolicy:,TerminationGracePeriodSeconds:nil,ActiveDeadlineSeconds:nil,DNSPolicy:,NodeSelector:map[string]string{},ServiceAccountName:,DeprecatedServiceAccount:,NodeName:,HostNetwork:false,HostPID:false,HostIPC:false,SecurityContext:nil,ImagePullSecrets:[],Hostname:,Subdomain:,Affinity:&Affinity{NodeAffinity:nil,PodAffinity:nil,PodAntiAffinity:&PodAntiAffinity{RequiredDuringSchedulingIgnoredDuringExecution:[],PreferredDuringSchedulingIgnoredDuringExecution:[{50 {LabelSelector{MatchLabels:map[string]string{component: kafka,creator: kafka-operator,name: kafka,role: data,},MatchExpressions:[],} [development] kubernetes.io/hostname}}],},},SchedulerName:,InitContainers:[{labeler devth/k8s-labeler [/bin/bash -c set -ex
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
export KUBE_LABEL_kafka_broker_id=${BASH_REMATCH[1]}
/run.sh] []  [] [] [{KUBE_NAMESPACE  EnvVarSource{FieldRef:&ObjectFieldSelector{APIVersion:,FieldPath:metadata.namespace,},ResourceFieldRef:nil,ConfigMapKeyRef:nil,SecretKeyRef:nil,}} {KUBE_LABEL_hostname  &EnvVarSource{FieldRef:&ObjectFieldSelector{APIVersion:,FieldPath:metadata.name,},ResourceFieldRef:nil,ConfigMapKeyRef:nil,SecretKeyRef:nil,}} {KUBE_LABEL_kafka_broker_id thisshouldbeoverwritten nil}] {map[] map[]} [] nil nil nil    nil false false false} {zookeeper-ready busybox [sh -c until nslookup zookeeper.development.svc.cluster.local; do echo waiting for myservice; sleep 2; done;] []  [] [] [] {map[] map[]} [] nil nil nil    nil false false false}],AutomountServiceAccountToken:nil,Tolerations:[{node.alpha.kubernetes.io/unreachable Exists  NoExecute 0xc4203fe2e8} {node.alpha.kubernetes.io/notReady Exists  NoExecute 0xc4203fe2e8}],HostAliases:[],},},VolumeClaimTemplates:[{{ } {kafka-data      0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[volume.beta.kubernetes.io/storage-class:standard] [] nil [] } {[ReadWriteOnce] nil {map[] map[storage:{{5368709120 0} {<nil>} 5Gi BinarySI}]}  <nil>} { [] map[]}}],ServiceName:kafka,PodManagementPolicy:,UpdateStrategy:StatefulSetUpdateStrategy{Type:,RollingUpdate:nil,},RevisionHistoryLimit:nil,},Status:StatefulSetStatus{ObservedGeneration:nil,Replicas:0,ReadyReplicas:0,CurrentReplicas:0,UpdatedReplicas:0,CurrentRevision:,UpdateRevision:,},}
Error while creating StatefulSet:  statefulsets.apps "kafka" already exists
time="2017-10-26T15:22:09Z" level=fatal msg="Cant create statefulset" clusterName=kafka error="statefulsets.apps \"kafka\" already exists" method=CreateKafkaCluster 

ankon avatar Oct 26 '17 16:10 ankon