1
0
mirror of synced 2026-03-02 03:26:57 +00:00

Compare commits

..

15 Commits

Author SHA1 Message Date
Hidde Beydals
e2fd6e8f86 Merge pull request #168 from fluxcd/update-helm-roadmap
Update helm-controller roadmap
2020-08-20 15:59:30 +02:00
Hidde Beydals
a8e534a8a4 Update helm-controller roadmap 2020-08-20 15:52:42 +02:00
Hidde Beydals
479d7575fa Merge pull request #167 from fluxcd/guide-helm-targetpath
Document targetPath in Helm Releases guide
2020-08-20 15:27:58 +02:00
Hidde Beydals
4707a3075e Document targetPath in Helm Releases guide 2020-08-20 15:14:50 +02:00
Hidde Beydals
21a189e0b7 Merge pull request #166 from fluxcd/helm-v0.0.4
Update helm-controller to v0.0.4
2020-08-20 14:38:31 +02:00
Hidde Beydals
248961d58c Update helm-controller to v0.0.4 2020-08-20 14:27:36 +02:00
Hidde Beydals
473e226883 Merge pull request #162 from fluxcd/components-upgrade 2020-08-18 15:10:42 +02:00
Hidde Beydals
2ebb06d330 Update notification controller docs to v0.0.7 2020-08-18 14:25:19 +02:00
Hidde Beydals
cc88e68c4e Update components
- source-controller to v0.0.10
- kustomize-controller to v0.0.8
- helm-controller to v0.0.3
2020-08-18 14:23:29 +02:00
Hidde Beydals
f8704747d9 Merge pull request #161 from fluxcd/dedicated-pkgs
Switch to dedicated fluxcd/pkg and api modules
2020-08-18 14:01:19 +02:00
Hidde Beydals
0c33df883c Switch to dedicated fluxcd/pkg and api modules 2020-08-18 13:45:48 +02:00
Stefan Prodan
3fbc396bc8 Merge pull request #160 from fluxcd/export-fix
Make export work offline
2020-08-18 14:36:58 +03:00
stefanprodan
17df7a46e2 Make export work offline 2020-08-17 19:58:17 +03:00
Michael Bridgen
925c1d3d8e Merge pull request #158 from fluxcd/add-secrets-to-roadmap
Add roadmap line item for SOPS support
2020-08-13 16:47:16 +01:00
Michael Bridgen
1976d4cc1b Add line item for SOPS support 2020-08-13 16:30:39 +01:00
11 changed files with 84 additions and 500 deletions

View File

@@ -14,10 +14,10 @@ jobs:
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Copy assets - name: Copy assets
env: env:
SOURCE_VER: ${{ 'v0.0.8' }} SOURCE_VER: ${{ 'v0.0.10' }}
KUSTOMIZE_VER: ${{ 'v0.0.7' }} KUSTOMIZE_VER: ${{ 'v0.0.8' }}
HELM_VER: ${{ 'v0.0.2' }} HELM_VER: ${{ 'v0.0.4' }}
NOTIFICATION_VER: ${{ 'v0.0.6' }} NOTIFICATION_VER: ${{ 'v0.0.7' }}
run: | run: |
# source-controller CRDs # source-controller CRDs
curl "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md curl "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md

View File

@@ -113,14 +113,6 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("path must begin with ./") return fmt.Errorf("path must begin with ./")
} }
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
kubeClient, err := utils.kubeClient(kubeconfig)
if err != nil {
return err
}
if !export { if !export {
logger.Generatef("generating kustomization") logger.Generatef("generating kustomization")
} }
@@ -190,6 +182,14 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
return exportKs(kustomization) return exportKs(kustomization)
} }
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
kubeClient, err := utils.kubeClient(kubeconfig)
if err != nil {
return err
}
logger.Actionf("applying kustomization") logger.Actionf("applying kustomization")
if err := upsertKustomization(ctx, kubeClient, kustomization); err != nil { if err := upsertKustomization(ctx, kubeClient, kustomization); err != nil {
return err return err

View File

@@ -129,14 +129,6 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("git URL parse failed: %w", err) return fmt.Errorf("git URL parse failed: %w", err)
} }
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
kubeClient, err := utils.kubeClient(kubeconfig)
if err != nil {
return err
}
gitRepository := sourcev1.GitRepository{ gitRepository := sourcev1.GitRepository{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: name, Name: name,
@@ -163,6 +155,14 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
return exportGit(gitRepository) return exportGit(gitRepository)
} }
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
kubeClient, err := utils.kubeClient(kubeconfig)
if err != nil {
return err
}
withAuth := false withAuth := false
// TODO(hidde): move all auth prep to separate func? // TODO(hidde): move all auth prep to separate func?
if u.Scheme == "ssh" { if u.Scheme == "ssh" {

View File

@@ -101,14 +101,6 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("url parse failed: %w", err) return fmt.Errorf("url parse failed: %w", err)
} }
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
kubeClient, err := utils.kubeClient(kubeconfig)
if err != nil {
return err
}
helmRepository := sourcev1.HelmRepository{ helmRepository := sourcev1.HelmRepository{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: name, Name: name,
@@ -126,6 +118,14 @@ func createSourceHelmCmdRun(cmd *cobra.Command, args []string) error {
return exportHelmRepository(helmRepository) return exportHelmRepository(helmRepository)
} }
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
kubeClient, err := utils.kubeClient(kubeconfig)
if err != nil {
return err
}
logger.Generatef("generating source") logger.Generatef("generating source")
secret := corev1.Secret{ secret := corev1.Secret{

View File

@@ -87,7 +87,7 @@ artifact of the referenced `HelmRepository`, fetch the chart, and make
it available as a `HelmChart` artifact to be used by the it available as a `HelmChart` artifact to be used by the
helm-controller. helm-controller.
!!! Note !!! hint "Advanced configuration"
The `HelmRelease` offers an extensive set of configurable flags The `HelmRelease` offers an extensive set of configurable flags
for finer grain control over how Helm actions are performed. for finer grain control over how Helm actions are performed.
See the [`HelmRelease` CRD docs](../components/helm/helmreleases.md) See the [`HelmRelease` CRD docs](../components/helm/helmreleases.md)
@@ -106,9 +106,11 @@ spec:
valuesFrom: valuesFrom:
- kind: ConfigMap - kind: ConfigMap
name: prod-env-values name: prod-env-values
valuesKey: values-prod.yaml
- kind: Secret - kind: Secret
name: prod-secret-values name: prod-tls-values
valuesKey: secret.yaml valuesKey: crt
targetPath: tls.crt
``` ```
The definition of the listed keys is as follows: The definition of the listed keys is as follows:
@@ -116,8 +118,20 @@ The definition of the listed keys is as follows:
- `kind`: Kind of the values referent (`ConfigMap` or `Secret`). - `kind`: Kind of the values referent (`ConfigMap` or `Secret`).
- `name`: Name of the values referent, in the same namespace as the - `name`: Name of the values referent, in the same namespace as the
`HelmRelease`. `HelmRelease`.
- `valuesKey` _(Optional)_: The key in the referent the values can be - `valuesKey` _(Optional)_: The data key where the values.yaml or a
found at. Defaults to `values.yaml` when ommitted. specific value can be found. Defaults to `values.yaml` when omitted.
- `targetPath` _(Optional)_: The YAML dot notation path at which the
value should be merged. When set, the `valuesKey` is expected to be
a single flat value. Defaults to `None` when omitted, which results
in the values getting merged at the root.
!!! hint "Note"
The `targetPath` supports the same formatting as you would supply
as an argument to the `helm` binary using `--set [path]=[value]`.
In addition to this, the referred value can contain the same
value formats (e.g. `{a,b,c}` for a list).
You can read more about the available formats and limitations in
the [Helm documentation](https://helm.sh/docs/intro/using_helm/#the-format-and-limitations-of---set).
## Configure notifications ## Configure notifications

View File

@@ -38,6 +38,7 @@ Tasks
- [ ] Review the git source and kustomize APIs - [ ] Review the git source and kustomize APIs
- [ ] Implement the migration command in tk - [ ] Implement the migration command in tk
- [ ] Create a migration guide for `flux.yaml` kustomize users - [ ] Create a migration guide for `flux.yaml` kustomize users
- [ ] Include [support for SOPS](https://github.com/fluxcd/toolkit/discussions/156)
### Flux image update feature parity ### Flux image update feature parity
@@ -64,28 +65,29 @@ Tasks
### Helm v3 feature parity ### Helm v3 feature parity
[= 50% "50%"] [= 70% "70%"]
Goals Goals
- Offer a migration guide for those that are using Helm Operator with Helm v3 and Helm repositories - Offer a migration guide for those that are using Helm Operator with Helm v3 and charts from
Helm and Git repositories
Non-Goals Non-Goals
- Migrate users that are using Helm v2 - Migrate users that are using Helm v2
Stretch-Goals
- [Migrate users that are using Helm charts from Git](https://github.com/fluxcd/toolkit/discussions/75#discussioncomment-38589)
Tasks Tasks
- [x] <span style="color:grey">Implement a Helm controller for Helm v3 covering all the current release options</span> - [x] <span style="color:grey">Implement a Helm controller for Helm v3 covering all the current release options</span>
- [ ] Discuss and design Helm releases based on source API: - [x] <span style="color:grey">Discuss and design Helm releases based on source API:</span>
* [ ] [Providing values from sources](https://github.com/fluxcd/toolkit/discussions/100) * [x] <span style="color:grey">Providing values from sources</span>
* [ ] [Conditional remediation on failed Helm actions](https://github.com/fluxcd/toolkit/discussions/102) * [x] <span style="color:grey">Conditional remediation on failed Helm actions</span>
* [ ] [Support running Helm test actions on an interval](https://github.com/fluxcd/toolkit/discussions/103) * [x] <span style="color:grey">Support for Helm charts from Git</span>
- [x] <span style="color:grey">Review the Helm release, chart and repository APIs</span> - [x] <span style="color:grey">Review the Helm release, chart and repository APIs</span>
- [x] <span style="color:grey">Implement events in Helm controller</span> - [x] <span style="color:grey">Implement events in Helm controller</span>
- [x] <span style="color:grey">Implement Prometheus metrics in Helm controller</span> - [x] <span style="color:grey">Implement Prometheus metrics in Helm controller</span>
- [x] <span style="color:grey">Implement support for values from `Secret` and `ConfigMap` resources</span>
- [ ] [Implement conditional remediation on (failed) Helm actions](https://github.com/fluxcd/helm-controller/issues/41)
- [ ] [Implement support for Helm charts from Git](https://github.com/fluxcd/source-controller/issues/56)
- [ ] [Implement support for referring to an alternative chart values file](https://github.com/fluxcd/helm-controller/issues/4)
- [ ] Create a migration guide for Helm Operator users - [ ] Create a migration guide for Helm Operator users

13
go.mod
View File

@@ -4,10 +4,12 @@ go 1.14
require ( require (
github.com/blang/semver v3.5.1+incompatible github.com/blang/semver v3.5.1+incompatible
github.com/fluxcd/helm-controller v0.0.2 github.com/fluxcd/helm-controller/api v0.0.4
github.com/fluxcd/kustomize-controller v0.0.7 github.com/fluxcd/kustomize-controller/api v0.0.8
github.com/fluxcd/pkg v0.0.3 github.com/fluxcd/pkg/git v0.0.5
github.com/fluxcd/source-controller v0.0.8 github.com/fluxcd/pkg/ssh v0.0.5
github.com/fluxcd/pkg/untar v0.0.5
github.com/fluxcd/source-controller/api v0.0.10
github.com/manifoldco/promptui v0.7.0 github.com/manifoldco/promptui v0.7.0
github.com/spf13/cobra v1.0.0 github.com/spf13/cobra v1.0.0
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect
@@ -23,6 +25,3 @@ require (
sigs.k8s.io/kustomize/api v0.5.1 sigs.k8s.io/kustomize/api v0.5.1
sigs.k8s.io/yaml v1.2.0 sigs.k8s.io/yaml v1.2.0
) )
// fix AKS auth
replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.0.1+incompatible

457
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- github.com/fluxcd/helm-controller/config//crd?ref=v0.0.2 - github.com/fluxcd/helm-controller/config//crd?ref=v0.0.4
- github.com/fluxcd/helm-controller/config//manager?ref=v0.0.2 - github.com/fluxcd/helm-controller/config//manager?ref=v0.0.4
patchesJson6902: patchesJson6902:
- target: - target:
group: apps group: apps

View File

@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- github.com/fluxcd/kustomize-controller/config//crd?ref=v0.0.7 - github.com/fluxcd/kustomize-controller/config//crd?ref=v0.0.8
- github.com/fluxcd/kustomize-controller/config//manager?ref=v0.0.7 - github.com/fluxcd/kustomize-controller/config//manager?ref=v0.0.8
patchesJson6902: patchesJson6902:
- target: - target:
group: apps group: apps

View File

@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- github.com/fluxcd/source-controller/config//crd?ref=v0.0.8 - github.com/fluxcd/source-controller/config//crd?ref=v0.0.10
- github.com/fluxcd/source-controller/config//manager?ref=v0.0.8 - github.com/fluxcd/source-controller/config//manager?ref=v0.0.10
patchesJson6902: patchesJson6902:
- target: - target:
group: apps group: apps