Skip to content

CloudVE/cnpg-i-skip-initdb

 
 

Repository files navigation

CNPG-I Skip-Initdb plugin

A CNPG-I plugin to simply skip the "initdb" bootstrap method of CNPG.

To see the plugin in execution, you need to have a Kubernetes cluster running (we'll use Kind) and the CloudNativePG operator installed. The plugin also requires certificates to communicate with the operator, hence we are also installing cert-manager to manage them.

kind create cluster --name cnpg-i-skip-initdb
# Choose the latest version of CloudNativePG (at least 1.24)
kubectl apply --server-side -f \
  https://github.com/cloudnative-pg/cloudnative-pg/releases/download/vX.Y.Z/cnpg-X.Y.Z.yaml
# Choose the latest version of cert-manager
kubectl apply -f \
  https://github.com/cert-manager/cert-manager/releases/download/vX.Y.Z/cert-manager.yaml

Then install the plugin by applying the manifest. The easiest way to obtain the manifest may be as an artifact created by the release-please workflow. You can download it and apply it locally:

kubectl apply -f LOCAL-FOLDER/manifest.yaml

Finally, create a cluster resource to see the plugin in action. There are three examples in the doc/examples directory:

  1. Cluster with labels and annotations: adds the defined labels and annotations to the pods. Showcases the plugin capability of altering the lifecycle of the CloudNativePG resources.
  2. Cluster with no parameters: defaults the plugin settings of the cluster. Showcases the plugin capability of altering the defaulting webhook behavior.
  3. Cluster with wrong parameters: includes an error in the configuration. Showcases the plugin capability of validating its own configuration.

Plugin development

For additional details on the plugin implementation refer to the development documentation.

About

A CNPG-i plugin that skips initdb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 84.7%
  • Shell 10.1%
  • Dockerfile 2.9%
  • JavaScript 2.3%