diff --git a/charts/tidb-operator/templates/config/_scheduler-policy-json.tpl b/charts/tidb-operator/templates/config/_scheduler-policy-json.tpl index c6c97daa76e..824c1e67b5d 100644 --- a/charts/tidb-operator/templates/config/_scheduler-policy-json.tpl +++ b/charts/tidb-operator/templates/config/_scheduler-policy-json.tpl @@ -11,13 +11,13 @@ {"name": "CheckVolumeBinding"}, {"name": "MaxGCEPDVolumeCount"}, {"name": "MatchInterPodAffinity"}, - {"name": "CheckNodeMemoryPressure"}, - {"name": "CheckNodeDiskPressure"}, -{{- if semverCompare ">=1.11-0" .Capabilities.KubeVersion.GitVersion }} +{{- if semverCompare "~1.11.0" .Capabilities.KubeVersion.GitVersion }} {"name": "CheckNodePIDPressure"}, {{- end }} {{- if semverCompare "<1.12-0" .Capabilities.KubeVersion.GitVersion }} {"name": "CheckNodeCondition"}, + {"name": "CheckNodeMemoryPressure"}, + {"name": "CheckNodeDiskPressure"}, {{- end }} {"name": "CheckVolumeBinding"} ], diff --git a/charts/tidb-operator/templates/scheduler-deployment.yaml b/charts/tidb-operator/templates/scheduler-deployment.yaml index 1d183be8f0b..656b0c1fcd3 100644 --- a/charts/tidb-operator/templates/scheduler-deployment.yaml +++ b/charts/tidb-operator/templates/scheduler-deployment.yaml @@ -35,7 +35,7 @@ spec: - -v={{ .Values.scheduler.logLevel }} - -port=10262 - name: kube-scheduler - image: {{ .Values.scheduler.kubeSchedulerImage }} + image: {{ required "scheduler.kubeSchedulerImage is required! Its verison must be the same as your kubernetes cluster version" .Values.scheduler.kubeSchedulerImage }} resources: {{ toYaml .Values.scheduler.resources | indent 12 }} command: diff --git a/charts/tidb-operator/values.yaml b/charts/tidb-operator/values.yaml index e0e7b2318f4..e8ff2f2f5ea 100644 --- a/charts/tidb-operator/values.yaml +++ b/charts/tidb-operator/values.yaml @@ -50,5 +50,5 @@ scheduler: requests: cpu: 80m memory: 50Mi - # modify the hyperkube verison to your kubernetes version - kubeSchedulerImage: gcr.io/google-containers/hyperkube:v1.10.12 + # this hyperkube verison must be the same as your kubernetes cluster version + # kubeSchedulerImage: gcr.io/google-containers/hyperkube:v1.12.1 diff --git a/docs/aws-eks-tutorial.md b/docs/aws-eks-tutorial.md index c3ac04cd8f6..2ed24585532 100644 --- a/docs/aws-eks-tutorial.md +++ b/docs/aws-eks-tutorial.md @@ -331,6 +331,8 @@ connect onto your newly created cluster. TiDB Operator manages TiDB clusters on Kubernetes and automates tasks related to operating a TiDB cluster. It makes TiDB a truly cloud-native database. +Uncomment the `scheduler.kubeSchedulerImage` in `values.yaml`, set it to the same as your kubernetes cluster version. + If you already have helm installed, you can continue here to deploy tidb-operator: ```sh diff --git a/docs/google-kubernetes-tutorial.md b/docs/google-kubernetes-tutorial.md index f6c87d11757..3a2074eeda9 100644 --- a/docs/google-kubernetes-tutorial.md +++ b/docs/google-kubernetes-tutorial.md @@ -93,9 +93,10 @@ When you see `Running`, it's time to hit `Control + C` and proceed to the next s The first TiDB component we are going to install is the TiDB Operator, using a Helm Chart. TiDB Operator is the management system that works with Kubernetes to bootstrap your TiDB cluster and keep it running. This step assumes you are in the `tidb-operator` working directory: + KUBE_VERSION=$(kubectl version --short | awk '/Server/{print $NF}' | awk -F '-' '{print $1}') && kubectl apply -f ./manifests/crd.yaml && kubectl apply -f ./manifests/gke-storage.yml && - helm install ./charts/tidb-operator -n tidb-admin --namespace=tidb-admin + helm install ./charts/tidb-operator -n tidb-admin --namespace=tidb-admin --set scheduler.kubeSchedulerImage=gcr.io/google-containers/hyperkube:${KUBE_VERSION} We can watch the operator come up with: diff --git a/docs/local-dind-tutorial.md b/docs/local-dind-tutorial.md index 00ece890f55..393b859787c 100644 --- a/docs/local-dind-tutorial.md +++ b/docs/local-dind-tutorial.md @@ -37,6 +37,8 @@ $ KUBE_REPO_PREFIX=uhub.ucloud.cn/pingcap manifests/local-dind/dind-cluster-v1.1 ## Step 2: Install TiDB Operator in the DinD Kubernetes cluster +Uncomment the `scheduler.kubeSchedulerImage` in `values.yaml`, set it to the same as your kubernetes cluster version. + ```sh $ kubectl apply -f manifests/crd.yaml diff --git a/docs/setup.md b/docs/setup.md index c1db8a07971..abbb589df98 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -83,6 +83,8 @@ $ kubectl get crd tidbclusters.pingcap.com After the `TidbCluster` custom resource is created, you can install TiDB Operator in your Kubernetes cluster. +Uncomment the `scheduler.kubeSchedulerImage` in `values.yaml`, set it to the same as your kubernetes cluster version. + ```shell $ helm install charts/tidb-operator --name=tidb-operator --namespace=tidb-admin $ kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator