Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetChartRef ¶ added in v1.2.0
func GetChartRef(r *unstructured.Unstructured) string
GetChartRef reads the chart entry from CR spec and returns chart entry or empty string.
func SplitChartRef ¶ added in v1.2.0
SplitChartRef splits chart reference into chart name and chart version
Types ¶
type Controller ¶
type Controller struct { ChartDir string // path to dir where the Helm chart is located Helm helm.Interface // Helm for talking with helm Namespace string // Default namespace to deploy into. If empty it will default to "default" ReleaseName string // Prefix for the helm release name. Will look like ReleaseName-CR_Name Wait bool // Whether or not to wait for resources during Update and Install before marking a release successful WaitTimeout int64 // time in seconds to wait for kubernetes resources to be created before marking a release successful // contains filtered or unexported fields }
Controller is a crwatcher.ResourceController that works with Helm to deploy helm charts into K8s providing a CustomResource as value data to the charts
func NewController ¶
func NewController(chartDir, ns, rn, host string, wait bool, waitto int64, logger *zap.SugaredLogger) *Controller
NewController will return a configured Helm Controller
func (*Controller) GetRemoteChart ¶ added in v1.2.0
func (c *Controller) GetRemoteChart(chartRef string) (string, error)
GetRemoteChart Gets chart name and chart version from the passed chartRef, downloads the chart from repo, puts it into versioned folder, and returns that folder Uses chart downloader to download the charts
- chart downloader uses the version passed, but if version is empty, pulls the latest version.
Prerequisite: Repo should have been initialized under HELM_HOME
func (Controller) ResourceAdded ¶
func (c Controller) ResourceAdded(r *unstructured.Unstructured)
ResourceAdded is called when a custom resource is created and will kick off a help install for the given charts and CR
func (Controller) ResourceDeleted ¶
func (c Controller) ResourceDeleted(r *unstructured.Unstructured)
ResourceDeleted is called when a custom resource is created and will use Helm to delete the release. The release is also purged in case in the future another CR with the same name is created.
func (Controller) ResourceUpdated ¶
func (c Controller) ResourceUpdated(oldR, newR *unstructured.Unstructured)
ResourceUpdated is called when a custom resource is updated or during a resync and will kick off a helm update for the corresponding release