-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapt install script for cockroachdb. (#4593)
* feat: adapt install script for cockroachdb. Signed-off-by: yy <[email protected]>
- Loading branch information
Showing
9 changed files
with
198 additions
and
64 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: crdb.cockroachlabs.com/v1alpha1 | ||
kind: CrdbCluster | ||
metadata: | ||
name: sealos-cockroachdb | ||
namespace: sealos | ||
spec: | ||
dataStore: | ||
pvc: | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: "3Gi" | ||
volumeMode: Filesystem | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 0.5Gi | ||
limits: | ||
cpu: 1000m | ||
memory: 2Gi | ||
tlsEnabled: true | ||
image: | ||
name: docker.io/cockroachdb/cockroach:v23.1.11 | ||
nodes: 3 |
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,10 @@ | ||
#!/bin/bash | ||
namespace="sealos" | ||
user="sealos" | ||
svc="sealos-cockroachdb-public" | ||
password=$(tr -cd 'a-z0-9' </dev/urandom | head -c64 ) | ||
|
||
kubectl exec -q -n sealos sealos-cockroachdb-0 -- cockroach sql --certs-dir=/cockroach/cockroach-certs -e "CREATE USER IF NOT EXISTS $user WITH PASSWORD '$password'; GRANT admin TO $user; CREATE DATABASE IF NOT EXISTS local; CREATE DATABASE IF NOT EXISTS global;" >> /dev/null | ||
|
||
cockroachdb_uri="postgresql://$user:$password@$svc.$namespace.svc.cluster.local:26257" | ||
echo "$cockroachdb_uri" |
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
Oops, something went wrong.