At the time of writing this, Helm is unable to determine when a custom resource has been created successfully and is ready to be used - #8439 - Add support for ordering of resources within a chart for Custom Resources.
CRSC is a simple application that leverages:
- The Kubernetes Job Controller to inform Helm when a Custom Resource Definition (CRD) object / custom resource is ready
- The Helm hook mechanism to ensure it is deployed immediately after the custom resource i.e. in the
post-install
phase of the release lifecycle
CRSC requires the following user inputs to be provided as Kubernetes environment variables:
CUSTOM_RESOURCE_PATH
- The URL path to the Kubernetes CRD object / custom resource e.g.https://kubernetes.default.svc/<CUSTOM_RESOURCE_PATH>
STATE_KEY
- The JSON path to the property containing the expected stateSTATE_VALUE
- The expected state when the Kubernetes CRD object / custom resource is created and ready to use
See the example/
directory to see how the CRSC has been used with a Kubernetes Service Account to query the Kubernetes API and determine when a Pulumi Stack custom resource has been successfully created.