Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created December 23, 2023 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vfarcic/34c9bc91e0c33e7c96bd905c64f9b9dd to your computer and use it in GitHub Desktop.
Save vfarcic/34c9bc91e0c33e7c96bd905c64f9b9dd to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/vfarcic/e0ea7388d48479abf3183ca5019a00c9
# Source: https://gist.github.com/vfarcic/33230cb71eeec47bf68df7738115ed96
# Source: https://gist.github.com/vfarcic/667da6690897d2bc74f5fb5c88f46516
# Source: https://gist.github.com/vfarcic/56ccbe9020e7108d5d64585959d6c358
# Source: https://gist.github.com/vfarcic/7c2ca143e62eb1ffdb79cf31f29128f3
#########
# Setup #
#########
git clone https://github.com/vfarcic/kubeblocks-demo
cd kubeblocks-demo
helm install kubeblocks kubeblocks \
--repo https://apecloud.github.io/helm-charts \
--namespace kb-system --create-namespace --wait
kbcli kubeblocks status
kubectl create namespace a-team
###########################################################
# Run (Almost) Any Database in Kubernetes With KubeBlocks #
###########################################################
kbcli addon list
kubectl get clusterdefinition
kubectl get clusterversions
cat postgresql.yaml
kubectl --namespace a-team apply --filename postgresql.yaml
kubectl --namespace a-team get clusters.apps.kubeblocks.io
kubectl --namespace a-team \
get all,secrets,rolebindings,serviceaccounts
kubectl --namespace a-team get secret \
silly-demo-db-conn-credential --output yaml
kbcli cluster connect silly-demo-db --namespace a-team
\q
kbcli cluster edit-config silly-demo-db --namespace a-team
kbcli cluster configure silly-demo-db --set=max_connections=200 \
--namespace a-team
kubectl --namespace a-team get cluster.apps.kubeblocks.io \
silly-demo-db --output yaml
export PRIMARY_POD=silly-demo-db-postgresql-0
kubectl --namespace a-team delete pod $PRIMARY_POD
kubectl --namespace a-team get cluster.apps.kubeblocks.io \
silly-demo-db --output yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment