数据小黑
(数据小黑)
2022 年3 月 5 日 08:11
3
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/master/manifests/crd.yaml
mkdir -p ${HOME}/tidb-operator &&
helm inspect values pingcap/tidb-operator --version=${chart_version} > ${HOME}/tidb-operator/values-tidb-operator.yaml
helm install tidb-operator pingcap/tidb-operator --namespace=tidb-admin --version=${chart_version} -f ${HOME}/tidb-operator/values-tidb-operator.yaml &&
kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator
是执行kubectl -n tidb-cluster apply -f …的先决条件,是否执行了?
yaml文件按照https://github.com/pingcap/tidb-operator/blob/master/examples/advanced/tidb-cluster.yaml这个
和
https://raw.githubusercontent.com/pingcap/tidb-operator/master/examples/basic/tidb-cluster.yaml这个
都试过了,都是不行呢
tidb-operator已经安装了呀:
[root@node01 tidb]# kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator
NAME READY STATUS RESTARTS AGE
tidb-controller-manager-64d789d965-9zhf6 1/1 Running 1 2d18h
tidb-scheduler-68d9c65d6d-n2f7p 2/2 Running 2 2d18h
麻烦提供一下 K8s 、tidb-operator 版本,提供一下复现的操作步骤。
k8s 1.18
tidb-operator v1.3.1
操作步骤正好记录了一下,都是按照官网来的,中间有个镜像拉不下来(k8s.gcr.io/kube-scheduler:v1.18.0),用阿里替代的:
部署 TiDB Operator:
helm repo add pingcap https://charts.pingcap.org/
创建crd:
kubectl create -f https://raw.githubusercontent.com/pingcap/tidb-operator/master/manifests/crd.yaml
在线部署 TiDB Operator:
mkdir -p ${HOME}/tidb-operator
helm inspect values pingcap/tidb-operator --version=v1.3.1 > ${HOME}/tidb-operator/values-tidb-operator.yaml
kubectl create namespace tidb-admin
目标机器上:
docker pull registry.aliyuncs.com/google_containers/kube-scheduler:v1.18.0
docker images
docker tag registry.aliyuncs.com/google_containers/kube-scheduler:v1.18.0 k8s.gcr.io/kube-scheduler:v1.18.0
docker rmi registry.aliyuncs.com/google_containers/kube-scheduler:v1.18.0
helm install tidb-operator pingcap/tidb-operator --namespace=tidb-admin --version=v1.3.1 -f ${HOME}/tidb-operator/values-tidb-operator.yaml
kubectl get po -n tidb-admin -l app.kubernetes.io/name=tidb-operator
部署tidb:
yaml文件:https://github.com/pingcap/tidb-operator/blob/master/examples/advanced/tidb-cluster.yaml
kubectl create -f tidb-cluster.yaml -n tidb-cluster
应该是没有报错。
输出:[root@k8s01 ~]# kubectl get crds
NAME CREATED AT
backups.pingcap.com 2022-03-04T07:07:13Z
backupschedules.pingcap.com 2022-03-04T07:07:13Z
dmclusters.pingcap.com 2022-03-04T07:07:14Z
restores.pingcap.com 2022-03-04T07:07:14Z
tidbclusterautoscalers.pingcap.com 2022-03-04T07:07:14Z
tidbclusters.pingcap.com 2022-03-04T07:07:14Z
tidbinitializers.pingcap.com 2022-03-04T07:07:15Z
tidbmonitors.pingcap.com 2022-03-04T07:07:15Z
tidbngmonitorings.pingcap.com 2022-03-04T07:07:16Z
system
(system)
关闭
2022 年10 月 31 日 19:11
16
此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。