Commit Graph
208 Commits
Author SHA1 Message Date
e2376c27b4 Envupdate crossupdate fix (#1866)
Co-authored-by: Rahul Bhati <rjbhati009@gmail.com>
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2021-02-05 15:39:59 +05:30
3b4ca09931 Improved readyPod queue implementation and bugfix (#1890)
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2021-02-02 17:11:54 +05:30
Gaurav GahlotandGitHub e438df87fa Fixed golangci-lint issues: /fission/pkg/executor (#1842) 2020-12-03 22:29:35 +05:30
Rahul BhatiandGitHub bb9f4136f5 Readypod optimization in executor (#1860)
A ready pod which can be specialized was fetched for every function earlier, this has been changed to a queue and cache implementation in client-go to improve performance.
2020-11-19 15:23:02 +05:30
fca0a60e5b Fixed typos across fission repo (#1832)
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2020-10-16 17:25:11 +05:30
78e530f506 Improvements from scale testing (#1812)
Poolmanager when tested at high load had some issues and this PR fixes one set of them which were found so far. 

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2020-10-14 13:23:03 +05:30
c605d1d2c6 Added code to prevent deletion of active fn pod (#1724)
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2020-09-28 14:09:55 +05:30
f3fe3123b3 Adding Concurrency in Pool Manager (#1698)
Concurrency in the pool manager allows specializing pods concurrently based on a specified limit. 

Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2020-09-16 18:48:08 +05:30
07b294778a logs: change timestamp to ISO (#1708)
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
2020-09-11 08:04:29 +05:30
darkworonandGitHub 806104626f Make mergePodSpec pick up enableServiceLinks (#1601)
Attribute enableServiceLinks can be now configured in PodSpec so that environment variables are not injected in function pods and DNS is used for discovery
2020-05-13 14:42:07 +05:30
Ta-Ching ChenandGitHub fc5711ce7c Support Function-level idle timeout setting (#1538)
This PR allows users to specify the idle timeout setting at Function-level.
Fix #1050
2020-02-21 02:01:26 +08:00
Ta-Ching ChenandGitHub b61f994746 Append Environment labels to function pod labels (#1530) 2020-02-11 17:49:14 +08:00
Ta-Ching ChenandGitHub eec35b285e Fix executor wrongly deletes rolebindings (#1517)
Executor wrongly deletes role bindings if the user
creates an environment in the reserved namespaces. This
PR is a quick fix to solve the problem by checking if
an environment is under reserved namespaces.
2020-01-29 00:01:21 +08:00
Ta-Ching ChenandGitHub 9eac1512fb Fix poolmanager wrongly delete env pool (#1511)
The root cause of the problem is that eagerPoolCreator
tries to create the deployment when the poolmanager
is trying to delete it. To avoid this, start eager pool
creator after executor starts serving requests.
2020-01-28 00:58:37 +08:00
Ta-Ching ChenandGitHub 8f8afaf139 Use patch for robust pod metadata update in poolmgr (#1509)
Use "Patch" to update pod metadata instead of "Update" to avoid 
dropping fields that the old client-go doesn't support.
2020-01-28 00:04:22 +08:00
Ta-Ching ChenandGitHub 11f9ef1045 Follow kubernetes APIs directory structure (#1497) 2020-01-20 17:06:46 +08:00
Ta-Ching ChenandGitHub bb3e6d6907 Codebase cleanup & optimization (#1493)
Remove old v1 types that are no longer used and move fetcher structs to fetcher directory.
2020-01-16 16:47:32 +08:00
Ta-Ching ChenandGitHub 574fb55fcf Use code-generator to generate clientset/informer/lister (#1492)
To reduce maintenance effort and avoid writing duplicate informer code,
use code-generator to generate clientset/informer/lister code.
2020-01-16 15:18:38 +08:00
Ta-Ching ChenandGitHub b96ca0735d Add config for fetcher resource requests & limits (#1489)
This PR adds fetcher resource requests&limits chart setting 
and remove unreasonable limits value from the charts.
2020-01-15 11:21:48 +08:00
Ta-Ching ChenandGitHub 275da18cf6 Let executor type manages how to do cleanup for old kubeobjects (#1455)
Add CleanupOldExecutorObjects to executor type interface in order
to let an executor type manages how to clean up the resources it created.
2019-12-02 19:47:31 +08:00
Ta-Ching ChenandGitHub 3f3b11ffbf Prevent deployment from rolling update due to different instance-id (#1454)
The pod template is embedded inside the deployment. So if
the pod annotation contains instance-id, the deployment
will get updated and thus triggers a rolling update whenever
a new executor starts which is unwanted.

After this PR, poolmanager will patches instance-id when a
pod is chosen for a function.

For newdeploy, unlike poolmanager manages the lifecycle
of function pod directly, newdeploy is only responsible
to create the deployment so we append instance-id to top-
level controller (deployment) only.
2019-12-02 17:28:19 +08:00
Ta-Ching ChenandGitHub 7f8cb69326 Make AdoptExistingResources optional (#1453) 2019-12-02 07:34:07 +08:00
Ta-Ching ChenandGitHub 003c304105 Prevent newdeploy updates deployment if no resources changed (#1452)
We used to update timestamp in the deployment environment field 
in order to trigger a rolling update when the function referenced 
resources get updated. However, use timestamp means we are not 
able to avoid triggering a rolling update when executor tries to adopt 
orphaned deployment due to timestamp changed which is unwanted. 
In order to let executor adopt deployment without triggering a rolling 
update, we need an identical way to get a value that can reflect res-
ources changed without affecting by time.

To achieve this goal, the sum of the resource version of all referenced 
resources is a good fit for our scenario since the sum of the resource 
version is always the same as long as no resources changed.
2019-12-02 06:35:07 +08:00
Ta-Ching ChenandGitHub 19ae7d5ac6 Fix adopted deployment uses old fetcher image (#1447)
When a new executor starts up, it adopts the orphan kubernetes resources created
by the old executor instance. However, the adopted resource won't reflect the changes
come with the new executor, for example, the fetcher image inside won't be changed.

To solve this, executor updates the resource spec (HPA/Deployment/Service) with the
latest resources spec. By doing this, we can prevent the inconsistency between resources
created by different executor instance, also minimizes the impact on users.
2019-11-29 21:52:59 +08:00
Ta-Ching ChenandGitHub 47aaa85108 Improve executor bootstrap speed (#1446) 2019-11-29 14:18:23 +08:00
Ta-Ching ChenandGitHub 1ad7ac2dcf Adopt existing orphan kubernetes resources when executor starts up (#1443)
Previously, once the executor is deleted for reasons (like upgrade or cluster scale-in),
the new executor deletes all existing resources created by the old executor and creates
new one. This mechanism becomes a problem when there are requests connecting to the
existing pods. Also in the worst case, the cluster may not have enough resources to create
new pods and cause service downtime.

This PR let each executor type adopts existing resources before starting the executor
API services, and so the alive connections won't experience failure. However, the requests
send to the function that doesn't have alive function pods will still fail due to the
executor is in bootstrapping.
2019-11-27 23:08:45 +08:00
Ta-Ching ChenandGitHub 7e8e968013 Fix poolmanager sets 0 timeout for function specialization (#1439) 2019-11-26 19:22:49 +08:00
Ta-Ching ChenandGitHub dfb2c073d2 Collect function metrics after finishing request (#1433) 2019-11-26 02:33:40 +08:00
Ta-Ching ChenandGitHub 51b264e8ca Fix poolmanager terminates running function pod periodically (#1435)
The pool manager keeps terminating function pod periodically even there are
traffic to the function. The root cause is that executor, poolmgr, newdeploy
manage their own functionServiceCache separately. And when router taps a
function, executor updates the access time of the function service entry in its
own cache without notifying executor types to do the update as well. Hence,
the access time of function service entry in poolmanager cache never gets updated.
Due to the access time never gets updated, the idle pod reaper in poolmanager
then thinks the function pod is in idle state and recycle it.

This PR removes the cache in executor itself, and when router tries to tap a function,
executor will call executor type to tap the function and update access time.
2019-11-26 01:16:30 +08:00
Ta-Ching ChenandGitHub 6d2fe08973 Allow to tap multiple function services at one time (#1434)
The router taps function service one by one which is inefficient and
increases the burden of executor. This PR aggregates all requests into
one to solve the problem mentioned above.
2019-11-25 18:44:48 +08:00
Ta-Ching ChenandGitHub ccc551112b Fix poolmanager crashes when failed to list environment (#1432) 2019-11-24 05:59:38 +08:00
Ta-Ching ChenandGitHub 1a5537f4ba Ability to pull builder image from private registry (#1431) 2019-11-24 05:17:56 +08:00
Ta-Ching ChenandGitHub a66de4c601 Support to set imagePullSecret when creating environment (#1429) 2019-11-22 18:19:57 +08:00
Ta-Ching ChenandGitHub af73d0ce1a Fix no kubeobjs get created if fn created before env creation (#1428)
When a function is created before the creation of the environment it's used, the newdeploy will not be able to create kube objs. Hence no function service record is inserted into the cache.

When getFuncSvc is called, the newdeploy tries to find the record in service cache in order to create kube objs with the same name used in previous kubeobjs creation. However, due to no record in the cache, a NotFound error is returned directly and causes the problem. To solve this, we use fn meta UID to ensure we always get the same obj name instead of getting it from the cache.
2019-11-22 01:37:02 +08:00
MengZeLeeandTa-Ching Chen fcd1bc0356 fix typo (#1395) 2019-11-10 14:17:56 +08:00
Ta-Ching ChenandGitHub c7d0c09f01 Poolmanager wait for function specialization timeout when specializing a pod (#1392) 2019-11-10 00:01:19 +08:00
Ta-Ching ChenandGitHub b9a5588ca9 Update staticcheck version and fix all warnings (#1381) 2019-11-05 18:09:12 +08:00
Ta-Ching ChenandGitHub a151f89eec Move route creation to independent function (#1362) 2019-10-30 05:47:51 +08:00
Ta-Ching ChenandGitHub b8311d43ce Fix newdeploy failed to find serviceEntry in cache (#1349)
When a function with executor type newdeploy got created, Newdeploy
is expected to create deployment/HPA/service for it and insert serviceEntry
to the cache for later use. Once clients call the function, newdeploy returns
the serviceEntry to the router.

However, the log shows that the newdeploy was unable to find the entry and
prints "Resource not found - key 'xxx' not found". The root cause is that the
informer controller instead of processing items in parallel, it dispatches XXFunc
to process items one by one. So if there is any problem during the creation of the
kubernetes resource, it takes a longer time to process the next item and hence
the serviceEntry was not inserted before clients call the function.

This PR lets the newdeploy to process items in extra goroutines instead of blocking
the process loop. It's a workaround to solve the problem above, we should consider
using workqueue to solve it in the future.
2019-10-10 23:32:36 +08:00
Ta-Ching ChenandGitHub d358a29b17 Fix the namespace mismatch problem when deploying with a single YAML file (#1344)
If a user deploys fission in the namespace which is different from the one in the single YAML file generated by helm, fission components won't be able to talk to each other due to the wrong namespace appends after the service address.

This PR adds --namespace when generating the YAML file to prevent the mismatch problem.
2019-10-09 01:14:56 +08:00
Ta-Ching ChenandGitHub b18462b10b Fix executor doesn't apply user-configured container spec correctly (#1339)
The merge function executor used wasn't merge container correctly, and it
didn't merge all fields in spec except volumeMount & Env which confused people.

To apply the user-configured container correctly, this PR changes the way of merge
and follows rules:

1. Slices are merged and return an error if the elements in the slice have name conflicts.
2. Maps are merged, the value of map of dst container are overridden if the key is the same.
3. The rest of the fields of dst container are overridden directly.
2019-10-04 05:16:04 +08:00
Ta-Ching ChenandGitHub 7cdc146515 Move Deployment API group from extensions/v1beta1 to apps/v1 (#1331)
In 1.9, kubernetes prompted Deployment to apps/v1 and finally deprecated
extensions/v1beta1 support in 1.16. Users will see the following error message
in log when fission components try to submit Deployment to the k8s API server
and specify extensions/v1beta1 as API group.

error: unable to recognize "deployment": no matches for kind "Deployment" in version "extensions/v1beta1"

This PR updates call to k8s API server and apiKind in chart files to avoid fission failure in 1.16.
2019-09-29 22:16:33 +08:00
Ta-Ching ChenandGitHub 82a7acf408 Set maxSurge to 20% for safe rolling upgrade (#1321) 2019-09-23 16:11:56 +08:00
Ta-Ching ChenandGitHub 7bd57c208a Disable revision history for newdeploy (#1319) 2019-09-23 14:25:49 +08:00
Ta-Ching ChenandGitHub c94e02b302 Fix newdeploy doesn't handle error properly (#1316) 2019-09-16 15:43:36 +08:00
Ta-Ching ChenandGitHub 6d3d277cb9 Fix potential nil pointer problem when using multierror pkg (#1311) 2019-09-16 11:03:23 +08:00
Ta-Ching ChenandGitHub 082c244b0b Fix executor unable to list secrets/configmaps (#1307) 2019-09-11 10:47:20 +08:00
Ta-Ching ChenandGitHub e762471d78 Bump Go version to 1.12 (#1290) 2019-08-28 13:47:40 +08:00
Ta-Ching ChenandGitHub c49377569e Refactor environment CLI command (#1265) 2019-08-27 15:43:59 +08:00
Ta-Ching ChenandGitHub ee18a88664 Update go dependencies (#1240)
NOTES for update k8s dependencies

In go.mod

require (
    k8s.io/api kubernetes-x.x.x
    k8s.io/apiextensions-apiserver kubernetes-x.x.x
    k8s.io/apimachinery kubernetes-x.x.x
    // check here https://github.com/kubernetes/client-go#compatibility-matrix
    k8s.io/client-go v12.0.0+incompatible
)
2019-08-23 16:17:12 +08:00