This feature cover the use case where a user wants to install custom resources, perform configurations or even runs pods on a control plane after the creation. An example use case is to create a vcluster-type control plane and then install the ocm cluster-manager on it. The post-create hook should be able to install specified Kubernetes templates, for example a job that runs a helm install.
Proposed Solution
Define a new cluster-scoped custom resource of kind PostCreateHook which would allow to specify a container spec and the type of workload (job or deployment).
The templates defined in PostCreateHook are applied in the namespace for the control plane to which the hook is associated. By default the objects defined in the template are applied to the hosting cluster. One special use case is applying a helm chart to the API server running in the control plane. This can be done using a job running the helm command with a kubeconfig mounted from the secret with the in-cluster config for the API server of the control plane.
Feature Description
This feature cover the use case where a user wants to install custom resources, perform configurations or even runs pods on a control plane after the creation. An example use case is to create a vcluster-type control plane and then install the ocm cluster-manager on it. The post-create hook should be able to install specified Kubernetes templates, for example a job that runs a helm install.
Proposed Solution
Define a new cluster-scoped custom resource of kind
PostCreateHook
which would allow to specify a container spec and the type of workload (job or deployment).Example:
Then, in the controlplane CR, we can specify a post-create hook
The kflex CLI should be updated as well to include the option to pass the hook:
The templates defined in PostCreateHook are applied in the namespace for the control plane to which the hook is associated. By default the objects defined in the template are applied to the hosting cluster. One special use case is applying a helm chart to the API server running in the control plane. This can be done using a job running the helm command with a kubeconfig mounted from the secret with the in-cluster config for the API server of the control plane.
Want to contribute?
Additional Context
No response