pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.8k stars 5.8k forks source link

No matches for kind "TidbCluster" in version "pingcap.com/v1alpha1" #19344

Open ClSlaid opened 4 years ago

ClSlaid commented 4 years ago

Bug Report

What version of TiKV are you using?

v4.0.4

What operating system and CPU are you using?

kubernetes system: Ubuntu 18.04 LTS CPU: AMD EPYC 7K62 48-Core Processor Actually a one core 1 GiB virtual server.

Steps to reproduce

When following docs, trying to deploy a demo Tidb Cluster on my VPS with the .yaml file

What did you expect?

Successfully deploy TiDB cluster demo.

What did happened?

I stored the content in tidb_cluster.yaml, and tried to deploy TiDB on my VPS with Kubectl.

kubectl apply -f tidb_cluster.yaml

error occured as:

error: unable to recognize "tidb-cluster.yaml": no matches for kind "TidbCluster" in version "pingcap.com/v1alpha1"

Then I looked up more detailed link, its content clearly show that "TidbCluster" is actually in version "pingcap.com/v1alpha1". So I tried accessing pingcap.com/v1alpha1 with browser, only returning a 404 page. Using curl to get content.

curl pingcap.com/v1alpha1 | cat

output:

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

What happend? Is this a network problem?

ekexium commented 4 years ago

/assign @lichunzhu

lichunzhu commented 4 years ago

Have you deployed tidb-operator? https://docs.pingcap.com/tidb-in-kubernetes/stable/deploy-tidb-operator

ClSlaid commented 4 years ago

Have you deployed tidb-operator? https://docs.pingcap.com/tidb-in-kubernetes/stable/deploy-tidb-operator

Not really, I may try it later

yahonda commented 3 years ago

I've got a similar error yesterday and this issue has been resolved after deploying tidb-operator.

% kubectl create -f ./tidb-cluster.yaml -n tidb-cluster
error: unable to recognize "./tidb-cluster.yaml": no matches for kind "TidbCluster" in version "pingcap.com/v1alpha1"
hq6 commented 2 years ago

I'm still getting this error despite deploying TiDB operator:

kubectl get pods --namespace tidb-admin -l app.kubernetes.io/instance=tidb-operator
NAME                                      READY   STATUS    RESTARTS   AGE
tidb-controller-manager-8b6495689-kx4tg   1/1     Running   0          3m48s
tidb-scheduler-58558fc9d7-ckkrc           2/2     Running   0          3m48s

kubectl apply -f tidb-cluster.yaml -n tidb-cluster
error: unable to recognize "tidb-cluster.yaml": no matches for kind "TidbCluster" in version "pingcap.com/v1alpha1"
Tema commented 1 year ago

You probably miss CRD from https://docs.pingcap.com/tidb-in-kubernetes/dev/get-started#step-2-deploy-tidb-operator: kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/master/manifests/crd.yaml