-
Notifications
You must be signed in to change notification settings - Fork 500
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
Tidb support setting a random password. #4328
Merged
Merged
Changes from 85 commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
88fc3b2
random password
mikechengwei f9cb7fe
random password
mikechengwei 5b31a93
optimize code
mikechengwei b5de123
optimize code
mikechengwei 324ffbf
Merge branch 'master' into feature/addpassword
mikechengwei ab37b18
optimize code
mikechengwei d3e7898
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei 41b888f
optimize code
mikechengwei 68f4994
Merge branch 'master' into feature/addpassword
mikechengwei c269faa
optimize code
mikechengwei 412dd41
optimize code
mikechengwei 280dab8
Update README.md
DanielZhangQD 2fe7dfd
Update pkg/manager/member/tidb_member_manager.go
mikechengwei cb4d1d0
Merge branch 'master' into feature/addpassword
mikechengwei 00cde54
update policy
mikechengwei d1fe63d
optimize code
mikechengwei 09d5b5a
optimize code
mikechengwei 417a0b4
Merge branch 'master' into feature/addpassword
mikechengwei bfba0ab
Merge branch 'master' into feature/addpassword
mikechengwei 7b5cb24
optimize tidb check
mikechengwei 5c18f22
Merge branch 'master' of github.com:pingcap/tidb-operator into featur…
mikechengwei 7013280
optimize code
mikechengwei 45e1884
optimize code
mikechengwei fee697a
optimize code
mikechengwei 501643e
optimize code
mikechengwei afef7cd
Merge branch 'master' into feature/addpassword
mikechengwei 3cc4750
optimize code
mikechengwei e71840f
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei 2cb2c9b
Update pkg/manager/member/tidb_member_manager.go
mikechengwei f61774f
Update examples/basic-random-password/tidb-cluster.yaml
mikechengwei c583907
optimize code
mikechengwei 0dee2e3
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei 79d78a5
optimize code
mikechengwei 1bf113c
optimize code
mikechengwei 3d90a28
optimize code
mikechengwei 47b4489
optimize code
mikechengwei f0e3701
optimize code
mikechengwei 1496f18
optimize code
mikechengwei 4e14c3d
optimize code
mikechengwei 63a30d7
Update cmd/backup-manager/app/backup/manager.go
mikechengwei 6c40b18
Update pkg/apis/pingcap/v1alpha1/types.go
mikechengwei 3e6ef17
optimize code
mikechengwei e1a45b8
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei 587fedf
optimize code
mikechengwei e6a15a7
Merge branch 'master' of github.com:pingcap/tidb-operator into featur…
mikechengwei fb5f93e
Update pkg/manager/member/tidb_member_manager.go
mikechengwei d87ff52
Update pkg/apis/pingcap/v1alpha1/tidbcluster.go
mikechengwei b9ae888
Update cmd/backup-manager/app/restore/manager.go
mikechengwei 640b16f
Update cmd/backup-manager/app/export/manager.go
mikechengwei 3dda6f1
optimize code
mikechengwei c7815fd
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei 6517afa
optimize code
mikechengwei 427be40
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 0feac45
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 4ea3a08
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 9f4495e
optimize tls example
mikechengwei 00e42df
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei e1cf3fd
optimize code
mikechengwei f58ba69
optimize code
mikechengwei 9c89860
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 49e7afc
Update pkg/manager/member/tidb_member_manager.go
mikechengwei a542c0a
optimize code
mikechengwei a961848
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 44c7591
optimize code
mikechengwei 2707cfb
optimize code
mikechengwei 0b7d438
Update pkg/manager/member/tidb_member_manager.go
mikechengwei d7190ea
optimize code
mikechengwei 1111249
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei aecf90a
optimize code
mikechengwei 0f4a01a
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 56f3fc8
Update pkg/manager/member/tidb_member_manager.go
mikechengwei f36f667
Update pkg/manager/member/tidb_member_manager.go
mikechengwei fdb2411
optimize code
mikechengwei d08c32c
Merge branch 'feature/addpassword' of github.com:mikechengwei/tidb-op…
mikechengwei 9186b3d
optimize code
mikechengwei 6629a53
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 1d74087
Update pkg/manager/member/tidb_member_manager.go
mikechengwei be13332
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 066e064
Update pkg/manager/member/tidb_member_manager.go
mikechengwei d753684
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 993e9c6
Update pkg/manager/member/tidb_member_manager.go
mikechengwei 8bb1e6d
Update pkg/util/util.go
mikechengwei 590785c
optimize code
mikechengwei 86c50fb
optimize code
mikechengwei 1a7dd1b
optimize code
mikechengwei 1fda059
optimize code
mikechengwei 8f9156d
Merge branch 'master' into feature/addpassword
mikechengwei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# A Basic TiDB cluster with random password initialized | ||
|
||
> **Note:** | ||
> | ||
> This setup is for test or demo purpose only and **IS NOT** applicable for critical environment. | ||
|
||
The following steps will create a TiDB cluster with random password initialized. | ||
|
||
## Install | ||
|
||
The following commands is assumed to be executed in this directory. | ||
|
||
Install the cluster: | ||
|
||
```bash | ||
kubectl -n <namespace> apply -f ./ | ||
``` | ||
|
||
Wait for cluster Pods ready: | ||
|
||
```bash | ||
watch kubectl -n <namespace> get pod | ||
``` | ||
|
||
## Explore | ||
|
||
Get the password from secret: | ||
|
||
```bash | ||
kubectl get secret basic-init -o=jsonpath='{.data.root}' -n <namespace> | base64 --decode | ||
``` | ||
|
||
Explore the TiDB SQL interface: | ||
|
||
```bash | ||
kubectl -n <namespace> port-forward svc/basic-tidb 4000:4000 | ||
``` | ||
|
||
Test connection successfully: | ||
|
||
```bash | ||
mysql -h 127.0.0.1 -P 4000 -u root -p <password> --comments | ||
``` | ||
|
||
## Destroy | ||
|
||
```bash | ||
kubectl -n <namespace> delete -f ./ | ||
``` | ||
|
||
The PVCs used by TiDB cluster will not be deleted in the above process, therefore, the PVs will be not be released neither. You can delete PVCs and release the PVs by the following command: | ||
|
||
```bash | ||
kubectl -n <namespace> delete pvc -l app.kubernetes.io/instance=basic,app.kubernetes.io/managed-by=tidb-operator | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# IT IS NOT SUITABLE FOR PRODUCTION USE. | ||
# This YAML describes a basic TiDB cluster with minimum resource requirements, | ||
# which should be able to run in any Kubernetes cluster with storage support. | ||
apiVersion: pingcap.com/v1alpha1 | ||
kind: TidbCluster | ||
metadata: | ||
name: basic | ||
spec: | ||
version: v5.3.0 | ||
timezone: UTC | ||
pvReclaimPolicy: Retain | ||
enableDynamicConfiguration: true | ||
configUpdateStrategy: RollingUpdate | ||
discovery: {} | ||
helper: | ||
image: busybox:1.34.1 | ||
pd: | ||
baseImage: pingcap/pd | ||
maxFailoverCount: 0 | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: {} | ||
tikv: | ||
baseImage: pingcap/tikv | ||
maxFailoverCount: 0 | ||
# If only 1 TiKV is deployed, the TiKV region leader | ||
# cannot be transferred during upgrade, so we have | ||
# to configure a short timeout | ||
evictLeaderTimeout: 1m | ||
replicas: 1 | ||
# if storageClassName is not set, the default Storage Class of the Kubernetes cluster will be used | ||
# storageClassName: local-storage | ||
requests: | ||
storage: "1Gi" | ||
config: | ||
storage: | ||
# In basic examples, we set this to avoid using too much storage. | ||
reserve-space: "0MB" | ||
rocksdb: | ||
# In basic examples, we set this to avoid the following error in some Kubernetes clusters: | ||
# "the maximum number of open file descriptors is too small, got 1024, expect greater or equal to 82920" | ||
max-open-files: 256 | ||
raftdb: | ||
max-open-files: 256 | ||
tidb: | ||
initializer: | ||
createPassword: true | ||
baseImage: pingcap/tidb | ||
maxFailoverCount: 0 | ||
replicas: 1 | ||
service: | ||
type: ClusterIP | ||
config: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment to highlight this line?