Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs on how to deploy tidb cluster with tidb-operator in minikube #451

Merged
merged 2 commits into from
May 5, 2019

Conversation

cofyc
Copy link
Contributor

@cofyc cofyc commented May 5, 2019

What problem does this PR solve?

fixes #447

What is changed and how it works?

Check https://github.com/cofyc/tidb-operator/blob/fix447/docs/minikube-tutorial.md

Check List

Tests

  • Unit test
  • E2E test
  • Stability test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has Helm charts change
  • Has Go code change
  • Has CI related scripts change
  • Has documents change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@cofyc cofyc force-pushed the fix447 branch 2 times, most recently from 7567d48 to 22ab5aa Compare May 5, 2019 05:08
@cofyc cofyc requested review from tennix and gregwebs May 5, 2019 05:10

### Install minikube and start a Kubernetes cluster

See [Installing Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) to install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add minimal version requirement of minikube.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Install helm tiller:

```
helm init
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the default service account of tiller have the right permission?

Copy link
Contributor Author

@cofyc cofyc May 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the tiller is deployed in kube-system namespace, default account of kube-system namespace in minikube has the correct permissions required by helm.

```

If it shows only the client version, `helm` cannot yet connect to the server. Use
`kubectl` to see if any tiller pods are running.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the related command here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, kubectl -n kube-system get pods -l app=helm is added here.


```
helm delete --purge tidb-cluster
kubectl delete pvc -l app.kubernetes.io/managed-by=tidb-operator # clean old PVs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PV reclaim policy is set to Retain by tidb-operator by default. So delete PVC would not delete the related PV.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubectl get pv -l app.kubernetes.io/instance=tidb-cluster -o name | xargs -I {} kubectl patch {} -p '{"spec":{"persistentVolumeReclaimPolicy":"Delete"}} # update reclaim policy of PVs used by tidb-cluster to Delete is added here to update reclaim policy of PVs.

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I clicked the Approve button by mistake.

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tennix tennix merged commit a77dac2 into pingcap:master May 5, 2019
### Launch a TiDB cluster

```
helm install charts/tidb-cluster --name tidb-cluster --set \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be easier for the user to make helm changes if we have a minikube-values.yaml file. So just one option --values minikube-values.yaml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting values from command line makes it easier for users to copy/paste. Besides, if use a separate values.yaml, we have to keep it in sync with the default values.yaml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minikube-values.yaml would have just the values to override, it wouldn't contain all the values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: deploy tidb cluster in minikube
4 participants