Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Support loading Helm values from different source types #1836

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Mar 18, 2019

Fixes #1809

valuesFrom supports different types of sources: configMapKeyRef,
secretKeyRef and externalSourceRef. Where the latter can be used to
retrieve a values file from an URL by setting the
externalSourceRef.URL. The array of sources is merged in specified
order, with the .spec.values getting merged last.

For backwards compatiblity the old valuesFromSecrets are transformed
into secretKeyRefs and lined up in front of any specified
valuesFrom sources.

On all source types the <sourceRef>.Optional can be set to true to
allow the release of a Helm chart to continue if the values file could
not be found.

@hiddeco hiddeco added the helm label Mar 18, 2019
@squaremo
Copy link
Member

squaremo commented Mar 18, 2019

Reading values from a file is a bit odd -- the path is given in the HelmRelease, but refers to a file in the filesystem of the operator. This is a trapeze act too far, in my opinion (see #1468 for previous discussion. I see I used the trapeze metaphor there as well; I need to find another).

@squaremo
Copy link
Member

I'm not against fetching values from URLs -- though it's not very "GitOps", I think on balance it's reasonable to give people some flexibility on where the values come from. (Or to put it another way: it's not something I'd do myself, but who am I to judge ...).

@hiddeco
Copy link
Member Author

hiddeco commented Mar 18, 2019

I do agree with you that reading values from a file is a bit odd, but at the same time I think it is also oddly specific to create a valueFileURLs array in the CRD.

@hiddeco hiddeco changed the title Support loading Helm values from file or url Support loading Helm values from an URL Mar 19, 2019
@hiddeco hiddeco force-pushed the helm-op-alternative-values-file branch 6 times, most recently from e360764 to 3dbf83b Compare March 19, 2019 22:22
@hiddeco hiddeco changed the title Support loading Helm values from an URL Support loading Helm values from different source types Mar 19, 2019
@hiddeco hiddeco force-pushed the helm-op-alternative-values-file branch from 3dbf83b to 4f9d7d2 Compare March 20, 2019 09:07
Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12/10 would review again

There's a couple of mechanical fixes I spotted; and, a suggestion about the CRD schema for you to consider.

chart/flux/templates/helm-operator-crd.yaml Show resolved Hide resolved
integrations/helm/release/release.go Outdated Show resolved Hide resolved
site/helm-integration.md Outdated Show resolved Hide resolved
site/helm-integration.md Outdated Show resolved Hide resolved
@hiddeco hiddeco force-pushed the helm-op-alternative-values-file branch 2 times, most recently from 22a50d4 to ad9cfbf Compare March 20, 2019 14:45
`valuesFrom` supports different types of sources: `configMapKeyRef`,
`secretKeyRef` and `externalSourceRef`. Where the latter can be used to
retrieve a values file from an URL by setting the
`externalSourceRef.URL`. The array of sources is merged in specified
order, with the `.spec.values` getting merged last.

For backwards compatiblity the old `valuesFromSecrets` are transformed
into `secretKeyRef`s and lined up in front of any specified
`valuesFrom` sources.

On all source types the `<sourceRef>.Optional` can be set to `true` to
allow the release of a Helm chart to continue if the values file could
not be found.
@hiddeco hiddeco force-pushed the helm-op-alternative-values-file branch from ad9cfbf to 46315e3 Compare March 20, 2019 14:46
@hiddeco
Copy link
Member Author

hiddeco commented Mar 20, 2019

@squaremo I think this is now to your liking.

type: string
optional:
type: boolean
oneOf:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I didn't know the directive could go here, but this works.

@hiddeco hiddeco merged commit 897ca73 into master Mar 20, 2019
@hiddeco hiddeco deleted the helm-op-alternative-values-file branch March 20, 2019 15:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants