Commit Graph

181 Commits

Author SHA1 Message Date
Hidde Beydals 592a23fd0e api: update dependencies
- github.com/fluxcd/pkg/apis/kustomize to v0.3.2
- k8s.io/apiextensions-apiserver to v0.23.4
- k8s.io/apimachinery to v0.23.4

Kubernetes dependencies have been updated to `v0.23.4` due to
(apparent) release issues with `v0.23.5`, leaving some of the
submodules unpublished (for at least `k8s.io/apiextensions-apiserver`).

Ref: https://github.com/kubernetes/kubernetes/issues/108763

Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-18 14:09:00 +01:00
Hidde Beydals 855d57c491 Use new standardized meta and runtime pkgs
This includes an update of the source-controller to v0.22.0, to pull in
the v1beta2 API which makes use of the same packages.

Co-authored-by: Sunny <darkowlzz@protonmail.com>
Signed-off-by: Hidde Beydals <hello@hidde.co>
2022-03-18 12:04:39 +01:00
Stefan Prodan d56695a93b
Allow shared ownership of in-cluster objects applied with kubectl
Introduce an annotation that configures kustomize-controller to co-manage objects applied with kubectl.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-04 12:37:30 +02:00
Sunny 869ef77fdf
api: Move Status in CRD printcolumn to the end
Status content could be very long compare to other fields. Moving it to
the end helps improve the visibility of other fields.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2022-02-25 15:23:46 +02:00
Stefan Prodan 55ebe211ed
Convert `stringData` to `data` before applying Secrets
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-02-22 17:54:33 +02:00
Steven E. Harris eba4168672
Tolerate absence of resources in post-build subst.
In a Kustomization's post-build substitution sources, introduce a new
"Optional" field to allow referencing a Kubernetes ConfigMap or Secret
that may not exist at time of reconciliation. Treat substitution when
the referenced object is missing as if the object had been present but
empty, lacking any variable bindings.

Retain the longstanding behavior of interpreting references to
Kubernetes objects being mandatory by default, such that
reconciliation fails if such a referenced object does not exist. Only
when the "Optional" field is set to true will reconciliation tolerate
finding the referenced object to be missing.

Signed-off-by: Steven E. Harris <seh@panix.com>
2022-02-15 09:27:41 -05:00
Stefan Prodan 518c8a021b
Allow disabling cross-namespace references
Introduce the flag `--no-cross-namespace-refs` (defaults to false) for allowing cluster admins to disable cross-namespace references to sources.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-26 22:50:10 +02:00
Aurel Canciu ec9fdb1550
Update flux pkg components
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-12-20 14:50:41 +01:00
Aurel Canciu 57220f8c70
Update Go to v1.17
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-12-16 14:23:15 +01:00
Stefan Prodan 24bdda0c1c
Update dependencies
- fluxcd/pkg/ssa v0.6.0
- fluxcd/source-controller/api v0.19.1
- github.com/opencontainers/runc to v1.0.3 (fix CVE-2021-43784)

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-12-09 11:47:50 +02:00
Stefan Prodan 8eac59574f
Release v0.17.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-11-09 14:18:49 +02:00
Stefan Prodan 51a7189087
Restore `spec.validation` and mark it as deprecated
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-07 14:17:02 +03:00
Stefan Prodan dba56a569e
Add example for `.spec.wait` usage
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-07 11:37:39 +03:00
Stefan Prodan 6346591f02
Use ssa package from fluxcd/pkg
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-10-01 10:21:15 +03:00
Stefan Prodan 9c8f284b7f
Add `spec.wait` usage to the API docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:40 +03:00
Stefan Prodan 468f00e416
Implement health checking for all resources
- Add `.spec.wait` optional boolean field to API
- Wait for all applied resources to become ready when `.spec.wait` is set to `true`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan 69069c3ab3
Refactor reconciliation into actions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan b33e3b3449
Update the status when health checking starts
Set the healthiness status to progressing and specify the health check timeout in the condition message.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:35:39 +03:00
Stefan Prodan 7ffe62b8e7
Introduce v1beta2 API
Changes from v1beta1:
- `spec.validation` removed (server-side validation is implicit)
- `spec.status.snapshot` replaced by `spec.status.inventory`
- `spec.patchesStrategicMerge` deprecated in favour of `spec.patches`
- `spec.patchesJson6902` deprecated in favour of `spec.patches`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:33:26 +03:00
Stefan Prodan 14329c6fa0
Refactor tests
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-10 16:51:22 +03:00
Max Jonas Werner d7690d8564
feat: set default observedGeneration to -1 on Kustomizations
This is a follow-up to
https://github.com/fluxcd/helm-controller/pull/294, porting the same
code to the kustomize-controller so that all Flux 2 controllers work
the same way in this regard.

Signed-off-by: Max Jonas Werner <mail@makk.es>
2021-08-27 17:15:24 +02:00
James Alseth 6f32e53970
Improve trimString function
Previously, the function iterated until the length limit was hit, which
is relatively slow and increases with the length of the limit. The new
implementation is easier to reason about and operates in constant time,
leading to better performance.

Signed-off-by: James Alseth <james@jalseth.me>
2021-08-24 19:18:41 -07:00
Stefan Prodan fe0f946840
Update dependencies
- k8s.io/* v0.21.3
- controller-runtime v0.9.5
- kubectl 1.21.3

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-08-05 10:45:32 +03:00
Stefan Prodan 2370360c10
Add the generic patch field to the API spec docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-18 10:42:34 +03:00
Guillaume Le Biller 14bce3c666
Update pkg/apis/kustomize to v0.2.0
Signed-off-by: Guillaume Le Biller <glebiller@Traveldoo.com>
2021-06-11 16:45:50 +02:00
Guillaume Le Biller b797eac907
Implement generic patches in Kustomization
Allow patching multiple resources instead of a single existing one as
StrategicMerge & JSON6902 are forced to target existing named resources.

Signed-off-by: Guillaume Le Biller <glebiller@Traveldoo.com>
2021-06-11 09:04:37 +02:00
Stefan Prodan ce4445f714
Update fluxcd/pkg/runtime to v0.12.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-08 20:34:33 +03:00
Stefan Prodan dce166f7a6
Update controller-runtime and controller-gen
- Bump controller-runtime to v0.9.0
- Bump controller-gen to v0.5.0
- Use Environment.AddUser to generate the envtest cluster admin kubeconfig

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-08 20:34:16 +03:00
Stefan Prodan 3bb5bece0c
Update source-controller/api to v0.13.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-26 16:46:11 +03:00
Stefan Prodan 036e3cf42b
Update fluxcd/source-controller/api to v0.12.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 10:40:17 +03:00
Stefan Prodan 56a1fab4c2
Update fluxcd/pkg/apis/meta to v0.9.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-21 13:41:34 +03:00
Stefan Prodan aa66416734
Update fluxcd/pkg/runtime to v0.10.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-19 15:03:00 +03:00
Stefan Prodan 43c05a7a20
Set leader election deadline to 30s
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-25 13:33:15 +02:00
Stefan Prodan 446545c71f
Expose suspended status as Prometheus metric
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-17 11:27:21 +02:00
Stefan Prodan 95c2f1d04c
Update dependencies
- github.com/fluxcd/source-controller/api v0.9.1
- github.com/fluxcd/pkg/runtime v0.8.4
- sigs.k8s.io/controller-runtime v0.8.3

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-15 16:29:52 +02:00
Stefan Prodan 750cbdfbb2
Update dependencies
- fluxcd/pkg/apis/meta v0.8.0
- fluxcd/source-controller/api v0.9.0

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-23 16:45:38 +02:00
Stefan Prodan 65cfce2978
Add spec.force to API docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-22 17:36:37 +02:00
Stefan Prodan 30c793ed60
Update fluxcd/pkg/runtime to v0.8.3
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-22 17:04:19 +02:00
Aurel Canciu 729dc9770e
Support recreating objects on immutable field updates
Allow passing --force to kubectl apply. Useful when dealing with
immutable field changes in resources.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-02-22 16:59:01 +02:00
Stefan Prodan 401fec6c8d
Allow disabling var substitution for certain resources
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-16 10:40:01 +02:00
Stefan Prodan 0ac1f9e631
Implement var substitution from ConfigMaps and Secrets
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-16 09:20:00 +02:00
Stefan Prodan f3d9c36691
Add support for variable substitutions
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-11 18:17:53 +02:00
Stefan Prodan e99f328200
Add source kind and name to not found error
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-08 15:20:13 +02:00
Hidde Beydals 17a6bff52e Add Patches{StrategicMerge,JSON6902} fields to API
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-03 20:31:11 +01:00
Hidde Beydals 02de763ad8 Depend on the Kustomize API from `fluxcd/pkg`
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-03 20:12:58 +01:00
Stefan Prodan 5e17dd48f4
Add Healthy status condition
- record the last health assessment result in a dedicated status condition
- use the condition status when issuing events to prevent notifications spam

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-02 14:59:06 +02:00
Stefan Prodan 0e0277aaef
Update RetryInterval description
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-22 16:22:37 +02:00
Stefan Prodan 4df56cb7ab
Add RetryInterval as optional field to API
The spec.retryInterval is the interval at which to retry a previously failed reconciliation.
When not specified, it defaults to the spec.interval value.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-22 15:48:28 +02:00
Stefan Prodan 95cf7ddba4
Update source-controller/api to v0.7.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-21 18:37:40 +02:00
Stefan Prodan 62a764a28e
Use the object reference type from fluxcd/pkg/meta
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-21 13:24:32 +02:00
Stefan Prodan 9a7185e3c3
Update fluxcd/pkg/runtime to v0.8.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-21 13:08:41 +02:00
Stefan Prodan d58bff0fe6
Update Kubernetes packages to v1.20.2
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-16 15:53:45 +02:00
Hidde Beydals c6353b4afd Upgrade runtime package to v0.6.2
To include a bug fix to the `ReconcilateAtChangedPredicate`
and renaming to `ReconcileRequestedPredicate`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-14 12:34:10 +01:00
Stefan Prodan 6b9db36a49
Update fluxcd/pkg/runtime to v0.6.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-04 11:50:59 +02:00
Stefan Prodan 696f91d380
Refactor impersonation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-04 11:50:59 +02:00
Stefan Prodan f14cd2323c
Upgrade controller-runtime to v0.7.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-04 11:50:58 +02:00
Hidde Beydals 69a7e75a91 Make Path an optional field and remove validation
As due to secure joins, the requirement on both providing a path
and/or requiring it to be in a certain format offers little value
over the UX experience of not having to provide it when you just
want to reconcile whatever can be found in the root of the source
reference.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-12-16 12:44:13 +01:00
Stefan Prodan d65ea71699
Refactor apply error reporting
- filter kubectl apply output and extract errors
- limit apply output to 20K charts (avoid reaching max etcd size)
- log kubectl exit code when the process is killed

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-14 17:34:55 +02:00
Stefan Prodan b09af484ec
Release v0.5.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-11 13:54:43 +02:00
Stefan Prodan 1438ef8735
Upgrade dependencies
- `github.com/fluxcd/pkg/apis/meta` to `v0.5.0`
- `github.com/fluxcd/pkg/runtime` to `v0.4.0`
- `github.com/fluxcd/source-controller/api` to `v0.5.1`
- `k8s.io/{api,apiextensions-apiserver,apimachinery,cli-runtime,client-go}` to `v0.19.4`
- `sigs.k8s.io/controller-runtime` to `v0.6.4`

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-10 19:48:41 +02:00
Somtochi Onyekwere 5b3d8df5b5 Add image type to API spec
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2020-12-10 13:23:55 +01:00
Stefan Prodan 53e31d663f
Remove default value from suspend field
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-26 14:17:38 +02:00
Stefan Prodan bed1418a01
Setup probes with runtime helpers
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-26 09:51:59 +02:00
Stefan Prodan 2312d69a51
Do not mark suspended resource as not ready
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-26 09:00:52 +02:00
Stefan Prodan 8f7f0d8c8f
Document that KubeConfig takes precedence over ServiceAccountName
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-20 11:34:35 +02:00
Stefan Prodan 0c9170241f
Use ServiceAccountName for impersonation
Drop the ServiceAccount field in favour of ServiceAccountName to prevent privilege escalation in multi-tenancy environments.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-20 10:58:24 +02:00
Aurel Canciu ac6cc88e29
Refactor to adopt k8s standardized Condition type
Updates to use metav1.Condition type and removes references for
deprecated corev1.Condition* constants and uses the new k8s api/meta
helpers in place of the old pkg/apis/meta types.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-11-19 19:49:04 +02:00
Stefan Prodan 2ba6252d76
Allow disabling validation
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-11-12 12:18:04 +02:00
Aurel Canciu fc85f6f746
Update pkg components & k8s 1.19, kustomize 0.6.4
Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-11-01 18:14:07 +02:00
Stefan Prodan dde74d9ea5
Change copyright to Flux authors
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-27 18:49:02 +02:00
Michael Bridgen b8d71327f7 Use reconcile request annotation helpers
Per https://github.com/fluxcd/pkg/issues/39
2020-10-22 11:37:13 +01:00
Hidde Beydals 154560f60e Improve remote cluster documentation
To highlight the fact that it works with just a KubeConfig, and not just
CAPI.
2020-10-20 14:03:53 +02:00
Stefan Prodan 028c368975
Add targeting non-capi clusters to docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-16 12:40:17 +03:00
leigh capili ceb439d13c Document Kustomization.spec.kubeConfig for Cluster API 2020-10-15 09:44:44 -06:00
Stefan Prodan 2125d6c938
Release v0.1.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-13 17:59:46 +03:00
Stefan Prodan d4cef2f046
Use events and metrics from fluxcd/pkg/runtime
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-13 12:37:45 +03:00
stefanprodan 50104826ae Promote API to v1beta1 2020-09-30 19:10:27 +03:00
stefanprodan 7b8fef2984 Implement `fluxcd/pkg/meta/api` in APIs 2020-09-30 14:01:17 +03:00
stefanprodan 2da8d7ca0c Add KubeConfig field to API 2020-09-30 01:00:44 +03:00
stefanprodan 45bfe6dfe5 Record last handled reconcile at annotation 2020-09-29 21:14:19 +03:00
stefanprodan a0f705ff6e Add TargetNamespace to API 2020-09-29 15:38:47 +03:00
stefanprodan 0d6f715efc Add support for S3 bucket sources 2020-09-19 13:32:38 +03:00
stefanprodan 2b9370e658 Normalize the ready condition reasons
- use reconciliation instead of apply for condition reasons
- add the reconciliation errors to the condition message
- trim the condition message to 4000 characters
- update the API docs and readme with the new condition reasons
2020-09-17 12:23:50 +03:00
stefanprodan 544e7cf0eb Use manifests checksum in GC snapshot 2020-09-16 09:34:22 +03:00
Hidde Beydals e46add39ed Support dependency references to other namespaces 2020-09-15 15:18:34 +02:00
stefanprodan 9363703634 Refactor kstatus health check 2020-09-14 10:48:24 +03:00
Stefan Prodan d105ecff2f
Merge pull request #101 from phillebaba/feature/kstatus
Implement kstatus for health checks
2020-09-14 09:43:24 +03:00
Stefan Prodan 845947c814
Merge pull request #103 from fluxcd/use-pkg-for-runtime-bits
Use annotation and predicate from fluxcd/pkg
2020-09-10 15:56:20 +03:00
Michael Bridgen 47f5d0b4b0 Use annotation and predicate from fluxcd/pkg
The reconcileAt annotation and the predicate that recognises it are
now in fluxcd/pkg/runtime. This removes (near) duplicate definitions
in favour of using those.
2020-09-10 13:43:49 +01:00
stefanprodan 087be46136 Refactor garbage collector 2020-09-10 14:26:14 +03:00
Philip Laine c113c2043f Change SourceRef to use CrossNamespaceSourceReference 2020-09-08 21:48:42 +02:00
Philip Laine ea627e3448 Change health check from WorkloadReference to CrossNamespaceObjectReference 2020-09-07 23:31:31 +02:00
Philip Laine ca80431ef8 Change kind ref in health checks to group kind 2020-09-06 20:43:00 +02:00
stefanprodan c605ccf6d2 Implement Mozilla SOPS decryption 2020-09-01 15:51:22 +03:00
stefanprodan 86e96a0976 Add decryption optional field to API 2020-09-01 12:35:55 +03:00
Hidde Beydals 1628d827a0 api: rename Unsortable to CircularDependencyError
As this better reflects the error's contents.
2020-08-28 10:53:57 +02:00
stefanprodan e34fe0c0d5 Use logger package from fluxcd/pkg
Update source-controller/api to v0.0.11, client-go to v0.18.8 and controller-runtime to v0.6.2
2020-08-21 12:37:33 +03:00
stefanprodan c2db29b2f6 Make the api package a dedicated module 2020-08-18 14:15:26 +03:00
stefanprodan b13949d373 Add ks as short name to CRD 2020-08-06 13:31:51 +03:00
Hidde Beydals 5905f3a85f Change CRD domain to 'kustomize.toolkit.fluxcd.io'
Due to required domain changes for the helm-controller so that it
can co-exist in a cluster with the Helm Operator, other Toolkit
components are moving to a *.toolklit.fluxcd.io domain too.
2020-07-30 22:40:16 +02:00