Update helm release guide with how to use cloud storage backends

Signed-off-by: Philip Laine <philip.laine@gmail.com>
pull/654/head
Philip Laine 4 years ago
parent 352b864636
commit c5465de000

@ -118,51 +118,78 @@ repository and omits all other files.
Git repositories. See the [`GitRepository` CRD docs](../components/source/gitrepositories.md) Git repositories. See the [`GitRepository` CRD docs](../components/source/gitrepositories.md)
for more details. for more details.
### Bucket ### Cloud Storage
Charts from S3 compatible storage buckets can be released by declaring It is inadvisable while still possible to use a `Bucket` as a source for a `HelmRelease`,
a `Bucket`, the source-controller will fetch the contents of the bucket as the whole storage bucket will be downloaded by source controller at each sync. The
on an interval and expose it as an artifact. bucket can easily become very large if there are frequent releases of multiple charts
that are stored in the same bucket.
**There is one caveat you should be aware of:** to make the A better option is to use [Chartmuseum](https://github.com/helm/chartmuseum) and run a cluster
source-controller produce a new chart artifact, the `version` in the local Helm repository that can be used by source controller. Chartmuseum has support
`Chart.yaml` of the chart must be bumped. for multiple different cloud storage solutions such as S3, GCS, and Azure Blob Storage,
meaning that you are not limited to only using storage providers that support the S3 protocol.
An example `Bucket`: You can deploy a Chartmuseum instance with a `HelmRelease` that exposes a Helm repository stored
in a S3 bucket. Please refer to [Chartmuseums how to run documentation](https://chartmuseum.com/docs/#how-to-run)
for details about how to use other storage backends.
```yaml ```yaml
apiVersion: source.toolkit.fluxcd.io/v1beta1 apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: Bucket kind: HelmRepository
metadata: metadata:
name: podinfo name: chartmuseum
namespace: gotk-system namespace: flux-system
spec:
url: https://chartmuseum.github.io/charts
interval: 10m
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: chartmuseum
namespace: flux-system
spec: spec:
interval: 5m
chart:
spec:
chart: chartmuseum
version: "2.14.2"
sourceRef:
kind: HelmRepository
name: chartmuseum
namespace: flux-system
interval: 1m interval: 1m
provider: generic values:
bucketName: podinfo env:
endpoint: minio.minio.svc.cluster.local:9000 open:
ignore: | AWS_SDK_LOAD_CONFIG: true
# exclude all STORAGE: amazon
/* STORAGE_AMAZON_BUCKET: "bucket-name"
# include charts directory STORAGE_AMAZON_PREFIX: ""
!/charts/ STORAGE_AMAZON_REGION: "region-name"
serviceAccount:
create: true
annotations:
eks.amazonaws.com/role-arn: "role-arn"
securityContext:
enabled: true
fsGroup: 65534
``` ```
The `interval` defines at which interval the Git repository contents After Chartmuseum is up and running it should be possible to use the accompanying
are fetched, and should be at least `1m`. Setting this to a higher service as the url for the `HelmRepository`.
value means newer chart versions will be detected at a slower pace,
a push-based fetch can be introduced using [webhook receivers](webhook-receivers.md)
The `provider`, `bucketName` and `endpoint` together define what ```yaml
S3 compatible storage should be connected to. For more information, apiVersion: source.toolkit.fluxcd.io/v1beta1
see the [`Bucket` CRD docs](../components/source/buckets.md). kind: HelmRepository
metadata:
name: helm-charts
The `ignore` defines file and folder exclusion for the namespace: flux-system
artifact produced, and follows the [`.gitignore` pattern spec:
format](https://git-scm.com/docs/gitignore#_pattern_format). interval: 1m
The above example only includes the `charts` directory of the url: http://chartmuseum-chartmuseum:8080
repository and omits all other files. ```
## Define a Helm release ## Define a Helm release

Loading…
Cancel
Save