Commit Graph
185 Commits
Author SHA1 Message Date
Sanket SudakeandGitHub 3ae1742953 Executor user informer factory in executors in place of informers (#2666)
* Use informerfactory across executor
* Run function informer for poolpodcontroller if istio enabled
* Use same namespace for secret as keda mqtriggers

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-11 20:41:12 +05:30
Sanket SudakeandGitHub 300739c031 Remove service account/role binding/role permissions from Fission services (#2655)
* Remove cluster role references
* Convert secret/package getter cluster roles to role
* Remove all cluster role binding permissions
* Remove unwanted permission
* Try removing all RBAC-related code
* Remove additional constants
* Add functionality for service account checks
* Restrict permission across services
* Remove package informer factory from the executor
* Revert service account check code for now
* Skip adding roles in place of cluster roles
* Remove additional permission from the router

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-08 16:15:19 +05:30
Sanket SudakeandGitHub 985d94b5b8 Consume podspec patch directly on executor/builder mounts (#2661)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-08 11:38:57 +05:30
Shubham BansalandGitHub ee623d31b2 Check pods events via infomer in user configured namespaces (#2653)
* informer changes for event checker in multi namespace

* run informers in wait group
2022-12-05 13:06:47 +05:30
Shubham BansalandGitHub 691feaa84f K8s informer to work with specific namespaces for executor (#2651)
Consider specific namespaces mentioned by the user in building informers in the executor
- Confimaps
- Secrets
- Deployments
- Services
- Pods
- Replicasets
2022-12-04 21:01:31 +05:30
526b5f0beb Deployments to work with specific namespaces instead of all namespaces (#2635)
* remove namespaceAll in deployments
* remove GetNamespace function from informer
* added logger and improvement for naming
* move reaper logic to utils

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-29 17:09:51 +05:30
Shubham BansalandGitHub 6d117ad43a Allow empty namespace for fission function and builder (#2621)
Currently, we create Fission resources in the default namespace, function-related resources are created in the fission-function namespace, whereas builder resources are created in the fission-builder namespace. This causes confusion for a lot of users.
In this fix, we allow the user to set the function and builder namespace empty so that function and builder resources are created in the same namespace as the function resource always.

If the user desires older behaviour they can functionNamespace and builderNamespace the same previous before the upgrade.

* use default namespace for fission  function and builder
* support for existing fission namespaces
* Replace builder and function namespace with template
* Fix namespace creation template

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-16 22:16:05 +05:30
Shubham BansalandGitHub 32bd874ab6 List fission resources in specific namespace instead of all namespace (#2604) 2022-11-08 10:25:09 +05:30
Sanket SudakeandGitHub 6af53807aa Monitor specific namespaces for configmap/secret updates (#2598)
We allow functions to refer to configmap/secrets. We are monitoring all namespaces for config maps and secrets and also allow cross-namespace references.
This fix monitors configmaps/secret updates in specific namespaces. Also, we ignore cross-namespace references for configmap/secret updates.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-11-03 14:12:22 +05:30
Shubham BansalandGitHub 9ff9a6e075 newdeploy executor to work with specific namespaces (#2590) 2022-10-31 12:55:57 +05:30
Shubham BansalandGitHub 47cbbef06f List Fission resource for specific namespace in executor reaper (#2587)
* pool manager to work with specific namespaces

* code review changes and revert changes for go.mod and values.yaml file
2022-10-28 20:39:08 +05:30
827baea974 Allow namespace configuration for different CRD resources in Fission (#2539)
* Allow multiple namespaces for builder manager
* Enable multiple namespaces for executor informers
* Added missing context
* helm chart support for multiple namespaces
* Directly consume map type from GetInformerForNamespaces fn
* Optimize function resolver by choosing namespace-specific informer
* helm chart support for multiple namespaces
* consider default namespace and move duplicate code to helm template
* Improve documentation for fission namespace values

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: shubham bansal <shubhambansaliimtgn@gmail.com>
2022-10-19 15:48:47 +05:30
Sanket SudakeandGitHub f2b790921b Remove unwanted permissions from Fission components (#2568)
* Remove unwanted permissions from Fission components
* Remove unwanted permission from buildermgr
* Remove rbac permissions from controller
* Remove unwanted namespace permission
* Remove unwanted fission resource permissions
* Add deployment list permission for buildermgr
* add deployment create permission for buildermgr
* Update action version
* Add rolebinding permission for buildermanager
* Reduce permissions for fetcher and builder components
* Aded deployment delete permission to buildermgr
* Add logger to wait crds function
* Revert "Grant CustomResourcedefintion read permission to specific components (#2567)"

This reverts commit 8fe62b755c.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-10-13 15:04:49 +05:30
Sanket SudakeandGitHub 3fa0f4bde3 Ensuring passing context across fission (#2555)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-26 16:05:45 +05:30
Andrey DudinandGitHub 1102999b4d Add ability to configure object reaper interval for different executor types (#2543)
Added properties to configure object reaper interval, global and specific to exec type.

OBJECT_REAPER_INTERVAL - global
NEWDEPLOY_OBJECT_REAPER_INTERVAL - for new deploy type
CONTAINER_OBJECT_REAPER_INTERVAL - for container type
POOLMGR_OBJECT_REAPER_INTERVAL - for poolmgr
2022-09-23 11:35:13 +05:30
AmborandGitHub da50c3759d feat: add the fn annotations to newdeploy function based deployment (#2554)
* feat: add copy the fn annotations to the deploy annotations

* feat: add copy the fn labels to the deploy labels
2022-09-22 14:21:27 +05:30
Sanket SudakeandGitHub e87c84ee2c Capture context from cobra CLI and pass forward (#2551)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-22 13:54:05 +05:30
Shubham BansalandGitHub d03395949b changes to inject of otelhttp transport in executor (#2552) 2022-09-22 10:47:47 +05:30
7dad7c8399 Ensure newdeploy function pod restart on referred configmap update (#2528)
Configmap inside pods for newdeploy and pool manager executor type were not being updated if the user update the configmap.
This fix will help to update the pods for both executor type with new configmap. As per the changes if there is any configmap update then pods will get restarted for both executor type and then it will refer new configmap.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-09-06 16:12:55 +05:30
Sanket SudakeandGitHub 3b4211b581 Update go dependencies to latest and actions used in workflows (#2510)
* Updated all Go language dependencies to latest version available
* Formatted all files as per gofmt
* Update Golangci-lint version to 1.48.0
* Updated action version wherer application in Github workflows
* Updated Kubernetes version to latest available
* Remove "io/ioutil" references and replace with "io"/"os"

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-08-19 13:36:37 +05:30
Sanket SudakeandGitHub 899e6e96d6 cleanup: Remove Opentracing support as no active users (#2196)
References:
[1] #2193
[2] https://fissionio.slack.com/archives/C3LUX6BBP/p1631706812069300

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-07-12 14:52:17 +05:30
Shubham BansalandGitHub c71867169b Pods immediately terminate for idletimeout in new deployment and container executer type (#2459)
* added waitgroup to handle multiple goroutine scenario
* changes for cache service
* changes to get function service from cache by UID
2022-06-29 11:49:34 +05:30
Ankit ChawlaandGitHub 473acc4e2b Added support to set builder and fn pod specs via helm chart (#2461)
The users can now set the pod spec for builder and fn pods via helm chart.
Currently we have set some default securitycontext for the pods. Before there were no permissions set and the user would by default enter root when kubectl exec into pod. Now the permissions have been set and the user will not be able to access root directory in poolmgr and newdeploy pods.
2022-06-27 16:52:28 +05:30
Ankit ChawlaandGitHub a2b6f95656 Fix for issue in poolmgr fns caused by skipping address validation (#2441) 2022-06-13 15:09:29 +05:30
Ankit ChawlaandGitHub ac3307bd91 Fixed help for ColdStarts metric in executor according to new labels (#2446) 2022-06-02 12:26:05 +05:30
Sanket SudakeandGitHub 39dd65b224 Add support for custom metrics for HPA (#2423)
* Add support for custom metrics for HPA
* Cleanup TargetCPUPercent references from possible places
* HPA v2beta has 80% default  cpu limit if not set

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-05-09 17:16:34 +05:30
Sanket SudakeandGitHub ed4bd2573b Migrate HPA v1 to v2beta2 (#2421)
* Migrate HPA v1 to v2beta2
HPA v2beta2 is defined and supported from 1.19+ onwards.
Also HPA v2 is stable from 1.23 onwards. As we support 1.19+
onwards using HPA v2beta2.
This change is base for custom metrics support we want to add
later by modifying Function spec.
* Add unit tests for hpa operations
* Use constants instead of strings

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-05-02 13:30:21 +05:30
90c479b23c Restructured authmiddleware fn and added tests (#2410)
* Created separate file for authmiddleware fn
* Optimize auth login and middleware
* Added unittests for authmiddleware
* Fixed authURL
* Removed featureConfig as global variable
* Fix integration test according to examples repo changes
* Fix integration test path for go module-example

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-22 14:21:58 +05:30
Sanket SudakeandGitHub 2a43213387 Use Clientset interface instead of type for Fission/kubernetes clients (#2416)
Using interface makes it easy to create a fake client and unit test
a specific portion of the code. We should be able to more write unit
test and increase coverage of code with this change.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-21 16:49:52 +05:30
Sanket SudakeandGitHub 3bdbeb6c87 Fix namespace used in speciallized pod cleanup (#2415)
In pool pod controller we were using pool namespace
rather than pod namespace in cleanup which was causing
issue in few scenarios. Using pod namespace now instead.
Also add unit test for scenario which was failing.
Using kubernetes client interface now across instead of
kubernetes ClientSet for testing.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-21 14:44:09 +05:30
Sanket SudakeandGitHub 24b185db89 Add http retries in executor client with go-retryablehttp (#2414)
* Add http retries in executor client with go-retryablehttp
* Capture service record error

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-20 20:56:46 +05:30
Sanket SudakeandGitHub 8442e21621 Use common httpserver across fission (#2409)
* Defining httpserver package to capture httpserver shutdown and
introduces uniform running of http server across codebase.
* Add unit tests for httpserver

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-14 11:35:58 +05:30
b638a6d047 Prometheus metrics improvements (#2398)
- Enabled metrics in storagesvc, buildermgr and controller.
- Added a middleware in storagesvc, router, executor and controller to monitor total number of http requests, each request's duration and number of requests that are currently being served. These requests can be filtered on their path, method or statuscode.
- Removed functionCallDuration and functionCallResponseSize metrics from router.
- Removed funcAliveSummary, funcIsAlive, funcReapTime and idleTime metrics.
- Replaced function calls for collecting metrics to direct metric calls.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-13 21:49:46 +05:30
Sanket SudakeandGitHub 8b3a3f29a8 Avoid tapservice call to executor with empty URL (#2402)
We should avoid tap service call to executor if service URL retrieved from executor is empty.
Added sanity checks to ensure that.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-04-06 09:41:54 +05:30
Ankit ChawlaandGitHub dd1995064e Fixed poolmgr pod naming error (#2385) 2022-03-17 16:20:00 +05:30
Sanket SudakeandGitHub 26d0a89fd5 Go 1.17 and dependencies update (#2381)
* Update Go version to 1.17 and dependencies
* Changes in ProbeHandler and LifeCycleHandler
* Update CRD definitions
* Update Go version to 1.17 in Github Actions

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-03-14 16:41:40 +05:30
Sanket SudakeandGitHub ded13229c0 Refactoring prometheus metrics and labels (#2375)
This change mainly fixes few things around router and executor
exposed metrices.
1. We are trying to follow standard in metric names.
2. Lables such as namespace are colliding with kube-prometheus standards
so they are getting relabled to exported_namespace. Added function prefix
to resolve this.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-03-02 10:10:58 +05:30
Shubham NazareandGitHub 260de05a63 make graceperiod configurable for container functions (#2337) 2022-01-28 10:18:20 +05:30
Sanket SudakeandGitHub 353453e9a7 Rbac resources per release for multiple installation on same cluster (#2302)
* Change RBAC resource names work for multiple Fission release
* Fetch secret configmap and package cluster role based on the release name
* Remove default namespace hardcoding from helm chart

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-01-18 09:18:53 +05:30
Sanket SudakeandGitHub 327275d1a4 Spell fixes across code (#2288)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-12-28 18:40:07 +05:30
Dylan ArbourandGitHub 223892f121 Simplify if logic in container executor deployment creation (#2282)
Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-12-20 10:43:12 +05:30
Sanket SudakeandGitHub 35a5397a05 Retry pod choose if we get terminated or deleted pod from ready pod controller (#2274)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-12-10 13:45:44 +05:30
Sanket SudakeandGitHub 59e876062f Capture os signals to gracefully shutdown fission components (#2261)
- Currently, fission components don't handle shutdown signals.
So we don't get any to do the required cleanup before the fission process
exits. Adding signal capture process with cancelling context so
that all dependent processes stop working when the process gets term
signal.
- Set log level to error in otel shutdown function

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-11-11 17:02:11 +05:30
Sanket SudakeandGitHub 81e247e1e8 Issue #2258 Reafctor ready pod conroller to use lister and cache sync checks (#2259)
Reactored ready pod controller code to user lister and cache sync checks,
so that we avoid querying lister if cache is not synced in choodPod function.
Also, as noticied in #2258 we were initializing workqueue in goroutine
which was causing nil pointer reference. We have moved it out of goroutine
and kept specific parts in goroutine.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-11-10 16:00:57 +05:30
Sanket SudakeandGitHub 65e842b1c8 Pass context to functionCache functions and debug messages in pool cache (#2244)
* Active requests count tracking with debug messages
* Pass required contexts to cache functions
* Fix duplicate imports

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-11-10 11:11:44 +05:30
Eng Zer JunandGitHub 2f4ec4b2b9 refactor: move from io/ioutil to io and os package (#2236)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-23 17:14:12 +05:30
Sanket SudakeandGitHub 33473a4528 feature: Capture important events with span in fission and add trace id in logs (#2180)
* Capture important open telemetry events with span in fission
* Add context to missing HTTP calls
* Add Trace ID in logs
* capture trace id in the proxy handler function
* Always registry tracer to get traceID

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-09-15 16:41:59 +05:30
Sanket SudakeandGitHub f4c56f81f3 Pass podinformer to poolpodcontroller instead of reference to pool manager (#2184)
In upgrade tests, sometimes in race condition pool manager podlister
takes time to sync in which case, poolpodcontrolller get nil reference
for gpm.podLister. Passing podInformer to poolpodcontroller so that
we wait for podInformer cache to sync.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-09-06 11:57:33 +05:30
Sanket SudakeandGitHub a1cbce810e Add kubernetes objects aware logger with zap (#2179)
Using controller-runtime zap integration which is aware of Kubernetesobjects and logs only name+namespace of the object when complete runtime.Object compatible type is given to logger.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-31 18:38:14 +05:30
Sanket SudakeandGitHub 1d5a09699b Use pool pod controller with env informer (#2161)
Signed-off-by: Sanket Sudake sanketsudake@gmail.com

- Use informers and listers in executors
- Passing context properly in pool manager executor
- Environment updates in the pool manager would not cause updates in the deployment
- Environment update minimizing downtime
- Use replicaset controller and environment delete triggers to cleanup specialized pods
2021-08-31 09:31:32 +05:30