pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.24k stars 499 forks source link

Helm install failed "Deployment in version "v1beta1" cannot be handled as a Deployment:" #727

Closed NanXuejiao closed 5 years ago

NanXuejiao commented 5 years ago

I deploy TiDB on k8s following here . and face issue when execute helm install ...

$ helm inspect values pingcap/tidb-operator --version=v1.0.0 tidb/tidb-operator/values-tidb-operator.yaml

Error: release tidb-operator failed: Deployment in version "v1beta1" cannot be handled as a Deployment: v1beta1.Deployment.Spec: v1beta1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Resources: v1.ResourceRequirements.Requests: unmarshalerDecoder: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$', error found in #10 byte of ...|scheduler","memory":|..., bigger context ...|ubeSchedulerImageName":"k8s.gcr.io/kube-scheduler","memory":"50Mi"}}},{"command":["kube-scheduler","|...

Then, I look resource at tidb-admin namespace.

$  kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator
NAME                                       READY   STATUS    RESTARTS   AGE
tidb-controller-manager-5495964fd8-lv856   1/1     Running   0          16m

Kubernetes version is v1.13.4, and I'm sure Kubernetes work well. TiDB Operator version is v1.0.0.

weekface commented 5 years ago

@NanXuejiao What does your file tidb/tidb-operator/values-tidb-operator.yaml look like?

NanXuejiao commented 5 years ago

@weekface I get it by helm inspect values pingcap/tidb-operator --version=v1.0.0 > tidb/tidb-operator/values-tidb-operator.yaml

clusterScoped: true
rbac:
  create: true
operatorImage: pingcap/tidb-operator:v1.0.0
imagePullPolicy: IfNotPresent

defaultStorageClassName: local-storage

controllerManager:
  serviceAccount: tidb-controller-manager
  logLevel: 2
  replicas: 1
  resources:
    limits:
      cpu: 250m
      memory: 150Mi
    requests:
      cpu: 80m
      memory: 50Mi
  autoFailover: true
  # pd failover period default(5m)
  pdFailoverPeriod: 5m
  # tikv failover period default(5m)
  tikvFailoverPeriod: 5m
  # tidb failover period default(5m)
  tidbFailoverPeriod: 5m

scheduler:
  serviceAccount: tidb-scheduler
  logLevel: 2
  replicas: 1
  schedulerName: tidb-scheduler
  # features:
  # - StableScheduling=true
  resources:
    limits:
      cpu: 250m
      memory: 150Mi
    requests:
      cpu: 80m
      memory: 50Mi
      kubeSchedulerImageName: k8s.gcr.io/kube-scheduler
  # kubeSchedulerImageTag:

My kube-scheduler image name is k8s.gcr.io/kube-scheduler,version is v1.13.4

weekface commented 5 years ago

@NanXuejiao

I suppose the indent of kubeSchedulerImageName: is not corrent, now is:

scheduler:
  serviceAccount: tidb-scheduler
  logLevel: 2
  replicas: 1
  schedulerName: tidb-scheduler
  # features:
  # - StableScheduling=true
  resources:
    limits:
      cpu: 250m
      memory: 150Mi
    requests:
      cpu: 80m
      memory: 50Mi
      kubeSchedulerImageName: k8s.gcr.io/kube-scheduler
  # kubeSchedulerImageTag:

It should be:

scheduler:
  serviceAccount: tidb-scheduler
  logLevel: 2
  replicas: 1
  schedulerName: tidb-scheduler
  # features:
  # - StableScheduling=true
  resources:
    limits:
      cpu: 250m
      memory: 150Mi
    requests:
      cpu: 80m
      memory: 50Mi
  kubeSchedulerImageName: k8s.gcr.io/kube-scheduler
  # kubeSchedulerImageTag:
NanXuejiao commented 5 years ago

@weekface Thank you so much. I've tried it, and tidb-scheduler is running now. I test to get values-tidb-operator.yaml again, and the yaml format is ok. Maybe the file is modified carelessly when I check if kubeSchedulerImageName need to modify.

helm inspect values pingcap/tidb-operator --version=v1.0.0 > tidb/tidb-operator/values-tidb-operator.yaml

I'll close this issue.