kind create cluster --config k8s/kind-cluster.yamlexport KUBECONFIG=./k8s/kube-config.yamlcurl -sSfL \
https://github.com/cloudnative-pg/cloudnative-pg/raw/main/hack/install-cnpg-plugin.sh | \
sudo sh -s -- -b /usr/local/binkubectl cnpg install generate --control-plane \
| kubectl apply -f - --server-sidecat <<EOF > ./cluster-example.yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: cluster-example
spec:
instances: 3
storage:
size: 1Gi
EOFkubectl apply -f cluster-example.yamlkubectl cnpg status cluster-examplekubectl exec -ti cluster-example-1 -c postgres -- bashkubectl exec -ti cluster-example-1 -c postgres -- psql -c '\du' -c '\l'kubectl cnpg psql cluster-example -- -c '\du' -c '\l'kubectl logs cluster-example-1kubectl cnpg logs cluster cluster-example -f \
| kubectl cnpg logs prettykubectl scale cluster cluster-example --replicas 4kubectl scale cluster cluster-example --replicas 3kubectl create namespace argocdkubectl apply -n argocd -f \
https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yamlkubectl port-forward svc/argocd-server \
-n argocd 8080:443argocd admin initial-password -n argocdargocd login --username admin localhost:8080argocd app create cloudnativepg \
--repo https://github.com/sxd/cloudnative-pg-argocd.git \
--path install-operator-argocdapp \
--dest-server https://kubernetes.default.svc \
--dest-namespace defaultargocd app sync cloudnativepg
argocd app listargocd app create cnpg-clusters \
--repo https://github.com/sxd/cloudnative-pg-argocd.git \
--path clusters \
--dest-server https://kubernetes.default.svc \
--dest-namespace defaultargocd app sync cnpg-clusters
argocd app sync cloudnative-pg-clusters
kubectl -n cnpg-samples get pods -wGitHub: https://github.com/cloudnative-pg/cnpg-playground
Single Cluster: https://github.com/cloudnative-pg/cnpg-playground?tab=readme-ov-file#single-kubernetes-cluster-setup
GitHub: https://github.com/cloudnative-pg/cloudnative-pg
Docs: https://cloudnative-pg.io/documentation/current/
Kubectl Plugin: https://cloudnative-pg.io/documentation/current/kubectl-plugin/#install
Quick Start: https://cloudnative-pg.io/documentation/current/quickstart/#part-3-deploy-a-postgresql-cluster
Reading Logs: https://cloudnative-pg.io/documentation/current/troubleshooting/#logs
Services: https://cloudnative-pg.io/documentation/current/architecture/#read-write-workloads
PG Config: https://cloudnative-pg.io/documentation/current/postgresql_conf/
Special PG Parameters: https://www.postgresql.org/docs/current/hot-standby.html#HOT-STANDBY-ADMIN
Failure: https://cloudnative-pg.io/documentation/current/failure_modes/#failure-modes_1
Manifest: https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Repo: https://github.com/sxd/cloudnative-pg-argocd.git
This gists is for @cloudnative-pg