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/50237ce00b935c2f8bc28d9f2cfe18d3 to your computer and use it in GitHub Desktop.
Save vfarcic/50237ce00b935c2f8bc28d9f2cfe18d3 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/vfarcic/c1c910f4164e061aa8e33796e8efca6e
# Source: https://gist.github.com/vfarcic/5d7ecbf28441325d77b6ef12c655867e
# Source: https://gist.github.com/vfarcic/95b680962ff2520c7f160eb9eb397325
# Source: https://gist.github.com/vfarcic/1a25432a17dd2f9f15f07a4c9f2c3086
# Source: https://gist.github.com/vfarcic/8dab7fbdcf1a36624d0483567662b39a
#########
# 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