Commit Graph

45 Commits

Author SHA1 Message Date
Somtochi Onyekwere 13044520c1 Pass polling options to impersonation client
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-06-28 15:28:56 +01:00
Stefan Prodan cafbe253a1
Disallow remote bases usage in Kustomize overlays
Add an optional flag for disabling remote bases. While the `--no-remote-bases` is set to `false` by default, Flux users are encouraged to enable it on production system for security and performance reasons. Using Kustomize remote bases means that kustomize-controller must clone the remote repositories on every reconciliation instead of using the source-controller artifacts cache. Allowing remote bases on multi-tenant clusters, means platform admins have no control over which repositories make up the desired state.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-04-27 14:54:43 +03:00
York Chen 827f814f2f
feat: flags to configure exponential backoff retry
Signed-off-by: York Chen <ychen@d2iq.com>
2022-04-21 10:09:39 -04:00
Sanskar Jaiswal ed5fb9fd6c add custom statusreader for jobs
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-04-01 15:11:13 +05:30
Paulo Gomes d29032e914
Add flags to control kubeconfig support
Two new flags were added to allow users to enable the
use of user.Exec and InsecureTLS in the kubeconfigs
provided remote apply reconciliations.

Breaking change: both functionalities are no longer
enabled by default.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
2022-04-01 10:13:55 +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
David Quagebeur 343f937e59 sops/azkv: support for credentials via SecretRef
Signed-off-by: David Quagebeur <david.quagebeur@worldline.com>
2022-03-14 10:27:55 +01: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
Stefan Prodan 4d7cba91b0
Allow setting a default service account for impersonation
Introduce the flag `--default-service-account` for allowing cluster admins to enforce impersonation for resources reconciliation.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-27 18:25:02 +02: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
Stefan Prodan 02c6708362
Update fluxcd/pkg/ssa to exclude the status field from apply
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-01-13 18:50:56 +02: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 1e01d800c5
Implement reconciliation using server-side apply
Reconciler behaviour:
- Creates an inventory of objects to be applied (persisted in-cluster under `.status.inventory`).
- Applies first custom resource definitions (CRDs) and namespaces, waits for them to register and only then applies the custom resources.
- Validates all resources with server-side dry-run apply (namespaced objects must contain `metadata.namespace`, defaulting to the `default` namespace is no longer supported).
- Reconciles only the resources that drifted.
- Prunes the objects that were previously applied but are missing from the current inventory.
- Emits events for only the resources that where created, configured or deleted.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-09-30 18:34:40 +03:00
Stefan Prodan ca1760b364
Use controller name in LeaderElectionID
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-03-25 14:20:34 +02: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 9d48b6299d
Retry with exponential backoff when fetching artifacts
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-02-26 12:29:14 +02:00
Hidde Beydals b6a9b7023b Enable pprof endpoints on metrics server
Using the helper from `pkg/runtime/pprof`, which follows the suggestion
from controller-runtime to use `AddMetricsExtraHandler`.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-02-07 12:42:44 +01: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
playertwo 51237cae00 Add QPS and Burst kube api client parameters as CLI arguments
Signed-off-by: playertwo <842517+playertwo@users.noreply.github.com>
2021-01-13 18:10:12 +03: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
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 dde74d9ea5
Change copyright to Flux authors
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-27 18:49:02 +02:00
Hidde Beydals 2b861622b1 Move dedicated watchers to in-controller watches
This prevents the resources from getting annotated, and instead uses
the `handler.EnqueueRequestsFromMapFunc` to queue requests based on
changes to the source objects.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-10-27 13:05:34 +01:00
Hidde Beydals 546cbdd78f Setup health and ready endpoints 2020-10-21 11:52:50 +02: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
Stefan Prodan 6223abdd06
Record the ready status as Prometheus metric
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-10-09 16:27:43 +03:00
stefanprodan 50104826ae Promote API to v1beta1 2020-09-30 19:10:27 +03:00
stefanprodan 0d6f715efc Add support for S3 bucket sources 2020-09-19 13:32:38 +03: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
stefanprodan d8fcc297ef Add watch all namespaces flag 2020-09-11 15:52:50 +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 eedd8c519b Configure manager logging and set level to info 2020-09-09 15:05:37 +03:00
Philip Laine 9c54e2cb30 Implement kstatus check 2020-09-06 17:59:25 +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 47d239312a Update source-controller to v0.0.5 2020-07-13 17:14:13 +03:00
stefanprodan e3d437c3f7 Change metrics port to 8080
Use same port as source/helm/notification controllers
2020-07-13 12:59:38 +03:00
stefanprodan 3acb82fa0b Setup production logging
For production the log format is JSON, the timestamps format is ISO8601
and stack traces are logged when the level is set to debug.
2020-07-13 12:03:15 +03:00
stefanprodan 2ebd5b6450 Implement event recording
- emit Kubernetes events for reconciliation actions
- forward events to notification controller
- remove the Profile API/CRD
2020-07-01 20:39:48 +03:00
stefanprodan d11e76d322 Configurable dependency requeuing
Add command argument for configuring the interval at which failing dependencies are reevaluated.
2020-06-20 10:30:37 +03:00
stefanprodan 1f25b5852b Watch resources in the runtime namespace only 2020-06-09 15:53:20 +03:00
stefanprodan 057096853e Add profile controller 2020-04-21 14:03:59 +03:00
stefanprodan 6d28f7c9b2 Introduce JSON logging
- add JSON log format cmd flag
- format apply output as a map of object/operation
- add apply logs to docs
2020-04-18 11:11:44 +03:00
stefanprodan 17ec746136 Implement kustomization reconciler
- fetch artifact from source controller based on the referenced Git repository
- run kustomize build for the specified path
- apply kustomization on cluster
- prune objects based on label selector
2020-04-15 15:20:21 +03:00
stefanprodan 3df6bfebfa Init controller with kubebuilder 2020-04-15 09:58:33 +03:00