Commit Graph
269 Commits
Author SHA1 Message Date
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
nickmancariandGitHub f195975bda Added lables to flags '--url', '--prefix', '--method' to reflect their deprecation for the 'fn create' use case. (#2171) 2021-08-31 18:12:58 +05:30
Sanket SudakeandGitHub 3636bb35ff Fix pod name in port forwarding log (#2178)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-31 10:07:42 +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
Sanket SudakeandGitHub 1df59316e7 Add correct context required in executor (#2175)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-25 13:16:26 +05:30
Sanket SudakeandGitHub d6b47c1a4e Add typed informers instead of generic SharedIndexInformers (#2174)
Generally using typed informers is more standard practise
than using SharedIndexInformer(SII) implicity. SII also lack
listers provided by informer factory and few other high level
abstractions.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-23 17:41:55 +05:30
Gaurav GahlotandGitHub 5f17b4f3c5 Add context for traces in executor (#2172)
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
2021-08-20 14:53:06 +05:30
Sanket SudakeandGitHub 1b9d21b5e3 Change default informer resync period to 30 minutes (#2167)
Currently most of informers used in Fission are using resync
period of 30sec which is quite low and causes lot of disturbances
in overall system. Since informers already have watchers which would
be delivering events to the handlers. If any handlers require lower
sync period they should register handler with `AddEventHandlersWithResyncPeriod`
instead of we generaling informer.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-20 09:03:09 +05:30
c51c6b7f7e fix: Add pathType to create networking/v1 ingress (#2164)
* fix: Add pathType to create networking/v1 ingress

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

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-20 08:49:55 +05:30
Gaurav GahlotandGitHub dfcf961f75 Change default function timeout to 60 seconds and pass context to executor from router (#2169)
Patch changes default function timeout to 60 seconds. Also, we are propagating context from router to executor in a proper way.
2021-08-19 19:13:33 +05:30
0cc3ecc2e9 Fission meets OpenTelemetry (#2157)
* add opentracing section and otelCollectorEndpoint
* initialize OTLP exporter
* pkg/controller: changes for context propagation
* pkg/executor: changes for context propagation
* pkg/fetcher: changes for context propagation
* pkg/router: changes for context propagation
* pkg/storagesvc: changes for context propagation
* set no default value for otel collector endpoint
* update readme and add notes to charts
* move common code to pkg/utils/otel
* adding fn and env as attributes
* don't use otelhttp transport for websocket
* URL ignore with common filter UrlsToIgnore

Note: The web socket example does not work when using OTEL HTTP. Here is an issue related to that on open-telemetry/opentelemetry-js-contrib.

Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-19 13:00:30 +05:30
Sanket SudakeandGitHub a24934f1a0 Organize pool manager code and few improvements (#2166)
The patch adds few improvements in pool manager and adds better
function composability by reorganizing code.
1. Added created status in get pool call
2. Improved logging in certain areas and having logger per component
3. Separated deployment-specific code in diff file for extensibility

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-18 13:21:54 +05:30
Sanket SudakeandGitHub 9d54f5daac Consider newdeploy functions only for env update in newdeploy manager (#2165)
Currently when we update env, even if we dont have newdeploy related
functions env is getting is getting triggered. Added filter in finding
related functions to avoid this behaviour.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-17 21:55:38 +05:30
Sanket SudakeandGitHub 672bdbba6f Fixed service name generation for function name < 17 chars (#2142)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-08-03 14:19:04 +05:30
Gaurav GahlotandGitHub 6a527d36a8 reading right flag key for rounds (#2135)
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>
2021-07-29 19:13:06 +05:30
Sanket SudakeandGitHub 2292f472c9 Option to keep or remove prefix when router triggers prefix based function (#2133)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-29 18:50:26 +05:30
Sanket SudakeandGitHub 8bd1a71065 Change Ingress version from v1beta1 to v1 for K8s 1.22+ compatibility (#2124)
* Change Ingress version from v1beta1 to v1 for K8s 1.22+ compatibility

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

* Minor fix

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-26 09:50:42 +05:30
Sanket SudakeandGitHub eb72fdc717 Enable race detector for unit tests (#2085)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-23 13:24:10 +05:30
Sanket SudakeandGitHub a7f819a78e Optimize swagger doc generator for Fission CR types (#2123)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-22 19:05:37 +05:30
Sanket SudakeandGitHub d4d58e166b Avoid dumping request headers in router (#2122)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-22 16:19:39 +05:30
Sanket SudakeandGitHub 6ced9d03d3 Support to dump request/response in router when debug mode enabled (#2119)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-21 20:45:08 +05:30
Sanket SudakeandGitHub 19c7616a4b Newdeploy/container function service names should fit in 63 characters (#2117)
* Add error message on deployment provision failure

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

* Add 63 characters limit for objects created via newdeploy/container

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-19 15:43:10 +05:30
a82281ad1c containers as functions (#1681)
PR adds a new executortype which supports running containers as functions. New CLI under functions is added to create container as functions.

Co-authored-by: Harsh Thakur <harshthakur9030@gmail.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-16 18:08:41 +05:30
Sanket SudakeandGitHub f3e1f9df90 Add go pprof support across fission components (#2112)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-16 13:34:03 +05:30
Sanket SudakeandGitHub ece0475808 Labels and annotation support for functions and environments (#2113)
1. Support for adding labels and annotations to functions & environment via fission CLI through create & update command.
2. Change ensures labels and annotations assigned to the environment would reflect on pods created via executor type pool manager and new deploy.

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-15 17:22:01 +05:30
Sanket SudakeandGitHub 2e0bb9304a Covert maps to sync maps in executor fscache to avoid dirty reads (#2105)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-08 10:40:17 +05:30
Sanket SudakeandGitHub 74c0142968 Replace controller with generated SharedIndexerInformers (#2103)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-06 13:56:10 +05:30
Sanket SudakeandGitHub f86fde81e6 Shared informers (#2092)
* Use shared informers across executor for fission CRs

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

* Add informer for configmap and secrets

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

* Use shared informers in router

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

* Add shared informer for canary config

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

* Add sharedinformer for ready pod check

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

* Refer informer instead of store in resolver

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

* Run informers before executors

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

* Add missing canary config handler calls

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

* Enable websocket test

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

* Run dump collection always

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-05 20:28:26 +05:30
Sanket SudakeandGitHub d5077ee816 Updated Go dependencies and added cache in workflows (#2099)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-07-04 12:38:27 +05:30
Sanket SudakeandGitHub 154fe0d447 Retrieve pod metrics only if metrics server is running and Go lint fixes (#2094)
* Retrieve pod metrics only if metrics server is running

Currently we query pod metrics every 30 sec which floods executor logs,
added check which confirms if metrics server is running then only we start
querying pod metrics for identifying CPU utilization.

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

* Fixed couple of typos and misspells with Go CI

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

* Remove unnecessary conversions with Go CI

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-28 10:06:32 +05:30
Sanket SudakeandGitHub a493f0117d Move informers,clientset and listers to generated package (#2093)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-26 11:13:46 +05:30
Sanket SudakeandGitHub cc0400bdd4 Move clientset,listers,informers to pkg/client from pkg/apis (#2090)
* Move clientset,listers,informers to pkg/client from pkg/apis

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

* Update golangci-lint version and timeout

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-24 12:07:14 +05:30
Sanket SudakeandGitHub 72c89268ec Ignore errors from zap logger Sync (#2086)
Added golang CI lint
Reference issue: https://github.com/uber-go/zap/issues/880

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-21 11:58:48 +05:30
18935dcfdd Lint fix (#2074)
Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-18 13:41:23 +05:30
Sanket SudakeandGitHub 6fbd4878be Generate and archive fission cli per OS and platform (#2071)
* Generate and archive fission cli per OS and platform

* Separate tagging from release script
2021-06-16 13:10:31 +05:30
Harsh ThakurandGitHub 6facdac464 Fix golang lint errors (#2068)
* Fix golang lint errors

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Typo for fields

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Multi error fix

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Multi error fix

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Add nolint to logtostderr errcheck

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>
2021-06-15 15:03:42 +05:30
377600d0a3 Add router cache back for performance comparision (#2036)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2021-06-14 18:30:23 +05:30
673ca25cf2 Support for multiple HTTP verbs in routes/HTTPTrigger (#2064)
* Support for multiple HTTP verbs in routes/HTTPTrigger

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

* Update pkg/apis/core/v1/types.go

Co-authored-by: Harsh Thakur <harshthakur9030@gmail.com>

* Fix fallbackurl for ingress

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

Co-authored-by: Harsh Thakur <harshthakur9030@gmail.com>
2021-06-14 14:48:27 +05:30
4038f0384b Add a SharedIndexInformer for services and deployments to NewDeploy executor (#2061)
* Add a SharedIndexInformer for services and deployments to NewDeploy executor.

This brings the NewDeploy executor behaviour into sync with GenericPoolManager behaviour
by caching Kubernetes services and deployments used in per-request function validation.

* Create informers in executer by executor label

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

Co-authored-by: James Sinclair <irgeek@btc.com.au>
2021-06-11 16:52:53 +05:30
aa45703a99 Enable prefix based routing (#2047)
* Enable prefix based routing

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Optimize checking condition

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

* Disable few tests

* disable router modification for now

* run code generator

* Collect fission dump in CI

* Enable all tests back

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

* Remove unwanted code

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

* Add prefix support at more places and couple of todo's

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

* Few more changes

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

* Improve function trim support

* Support for prefix based urls in fission function test

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

* multi route for fission function test

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

* Improve validations in trigger creations

* Adjust leading / in url from fission

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

* Change suburl to subpath for function test

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

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-10 13:54:49 +05:30
827b64d633 Add poolsize warning for environment create/update CLI (#1837)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-08 11:53:38 +05:30
7bf82c7ea9 Move RBAC v1beta1 to v1 (#2059)
Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-08 08:25:52 +05:30
3055a3ada0 Added body in the error topic header (#1830)
Signed-off-by: therahulbhati <rjbhati009@gmail.com>

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-07 22:28:11 +05:30
Sanket SudakeandGitHub e6c13057ce Change container name for runtime container to environment name in newdeploy (#2044)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2021-06-02 16:23:53 +05:30
4e2632e100 Keda podspec (#2021)
* Add podspec to MQT

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Add preupgrade check

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Use zap logger

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-05-27 14:21:34 +05:30
1e0baf5f6c Crds update (#2033)
* Add code generated using latest code-generator

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

* Update client-go and respective dependencies to v0.19.2

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

* Upgrading CRD version

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Minor changes

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Resolved client-go calls as per new generated code

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

* Function validations fix

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Fix environment and package validations

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Add basic validation to all CRDs

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Remove CRD installation related code

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Modify GHA for CRD installation

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Fix Package and HTTPTrigger validations

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Change Go version in CI to 1.15

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

* Style: kubebuilder marker change

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Fix test with deprecated fields

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Update kind node image to v1.16.15 in CI

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

* Update kind node image to v1.19.11 in CI

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

* Replace context Background with TODO for future implementation

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

* Optimize initial CRD check code

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

* Use Get call only to check CRDs

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

* Add kustomize for CRD apply

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

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-05-26 15:07:03 +05:30
a9c56e5bb2 Add a warning if spec is applied on a dirty worktree (#1966)
* Add a warning if spec is applied on a dirty worktree

* Update go dependencies after rebase

* Use the console package for showing the warning

* Fix merge conflicts

* Handle errors and use better messages

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-05-24 21:36:14 +05:30
3880279e89 do not use deprecated functions/methods (#2027)
Signed-off-by: Gaurav Gahlot <gauravgahlot0107@gmail.com>

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
2021-05-21 13:53:28 +05:30
3bac1d2d9d Fix log sort order when multiple series are returned (#1956)
Series are sorted internal by "order by", but the set of all series returned is not. Tried some ways to sort completely on database, found no way .. client side sort works at least

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2021-05-20 07:55:36 +05:30
d7ac0ee17a feat: Add image pull policy when create KEDA connector deployments (#1944)
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2021-05-20 01:22:25 +05:30