New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Istio integration #421
Istio integration #421
Conversation
e2f11b3
to
b022533
Compare
b022533
to
d4ce8c8
Compare
Thanks @life1347 , this is pretty good. We should turn your PR description into a HOWTO on the docs site once it's merged. Reviewed 20 of 20 files at r1. common.go, line 30 at r1 (raw file):
Please add a function comment? common.go, line 32 at r1 (raw file):
Hmm... io.EOF is not necessarily a network error? buildermgr/buildermgr.go, line 31 at r1 (raw file):
minor nit, can you make this have just one call to Getenv? buildermgr/envwatcher.go, line 134 at r1 (raw file):
another small nit: "retrying later" or "will retry later" buildermgr/envwatcher.go, line 165 at r1 (raw file):
Can you explain this a bit? Why do we return here? Should we retry? controller/functionApi.go, line 130 at r1 (raw file):
remove commented out line? controller/functionApi.go, line 133 at r1 (raw file):
So I think we should have a separate controller loop that watches functions and does stuff like creating a service, instead of doing it inline in API requests. The intention of using CRDs is that users can create/modify our resources directly with It this is too big a change I'm ok with this modification being done in a follow up PR. controller/functionApi.go, line 218 at r1 (raw file):
Same story as the above comment. This will break if user does executor/fscache/functionServiceCache.go, line 166 at r1 (raw file):
Hmm, why did you make this change? The new code won't log errors in some cases, right? executor/poolmgr/gp.go, line 296 at r1 (raw file):
Why is this istio-related? executor/poolmgr/gp.go, line 361 at r1 (raw file):
This is not unique enough... you need metadata.Namespace in there somewhere, otherwise name "A" in namespace "N1" will conflict with "A" in namespace "N2". executor/poolmgr/gp.go, line 473 at r1 (raw file):
Instead of creating the whole deployment spec in two cases, could we have this if statement just modify the parts of the DeploymentSpec that are different for istio? executor/poolmgr/gp.go, line 474 at r1 (raw file):
Would this be useful in non-istio case too? (BTW we should put that function duration in the environment and function specs in the future.) executor/poolmgr/gp.go, line 524 at r1 (raw file):
How about executor/poolmgr/gp.go, line 666 at r1 (raw file):
Can you explain this a bit more? Is this intended to remove old versions of the same function? Or something else...? executor/poolmgr/gp.go, line 722 at r1 (raw file):
Again, we'll need m.Namespace in this name somewhere, to make it unique. executor/poolmgr/gpm.go, line 154 at r1 (raw file):
nit: "Encountered network error, retrying: ..." test/test_utils.sh, line 211 at r1 (raw file):
Waiting for services to become routable... Comments from Reviewable |
d4ce8c8
to
073e930
Compare
Review status: 6 of 19 files reviewed at latest revision, 18 unresolved discussions. common.go, line 30 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. common.go, line 32 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. buildermgr/buildermgr.go, line 31 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. buildermgr/envwatcher.go, line 134 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. controller/functionApi.go, line 130 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. executor/fscache/functionServiceCache.go, line 166 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. executor/poolmgr/gp.go, line 524 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. executor/poolmgr/gpm.go, line 154 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. test/test_utils.sh, line 211 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Readiness probe was added to wait_for_service(), remove this line. Comments from Reviewable |
Review status: 6 of 19 files reviewed at latest revision, 19 unresolved discussions. buildermgr/envwatcher.go, line 165 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Yes, we should retry here. Done. executor/poolmgr/gp.go, line 296 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
If the istio feature is enabled, pods will be removed after terminationGracePeriod (6mins for now). It means that pod will stay alive for up to 11 mins (5 + 6 mins). Buf from the comment below, we can remove these lines and adopt long terminationGracePeriodSeconds for non-istio case. executor/poolmgr/gp.go, line 473 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. executor/poolmgr/gp.go, line 474 at r1 (raw file):
Done. executor/poolmgr/gp.go, line 666 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Yes, it is intended to delete old version function pod. As we discussed, if there are more than one function pods behind the services, then specialize request and function access requests may not be routed to the same pod, and thus the function cannot be served properly. I've added comment to explain this. Comments from Reviewable |
5cbd693
to
738df1a
Compare
Review status: 4 of 24 files reviewed at latest revision, 19 unresolved discussions. executor/poolmgr/gp.go, line 361 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. executor/poolmgr/gp.go, line 722 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. Comments from Reviewable |
Review status: 4 of 24 files reviewed at latest revision, 19 unresolved discussions. executor/poolmgr/gp.go, line 474 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. Comments from Reviewable |
Review status: 4 of 24 files reviewed at latest revision, 19 unresolved discussions. controller/functionApi.go, line 133 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
This change will be done in follow up PR. controller/functionApi.go, line 218 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Same above Comments from Reviewable |
610664e
to
1f955d7
Compare
LGTM. Please merge after addressing a few minor comments. Reviewed 23 of 23 files at r2, 3 of 4 files at r3. types.go, line 237 at r2 (raw file):
Suggest "AllowAccessToExternalNetwork" instead. Also suggest default to true. Most users will want to download dependencies. builder/client/client.go, line 41 at r2 (raw file):
Can you call this flag something like "retry"? Because it is not an istio-specific flag at all. In fact, what if you unconditionally retry, does that cause any problems? buildermgr/envwatcher.go, line 440 at r2 (raw file):
Not sure if this is intentionally in this change, but if you want configmap and secret suport in builders you will also need to add volumes to the deployment spec. controller/functionApi.go, line 133 at r1 (raw file): Previously, life1347 (Ta-Ching Chen) wrote…
Please file an issue so we don't forget. Documentation/docs-site/content/tutorial/istio-integration.md, line 2 at r3 (raw file):
Awesome doc! How about "Enabling Istio on Fission" as the title? Documentation/docs-site/content/tutorial/istio-integration.md, line 119 at r3 (raw file):
Remove --debug? Documentation/docs-site/content/tutorial/istio-integration.md, line 122 at r3 (raw file):
Just "Create a function" would work too. environments/fetcher/cmd/main.go, line 131 at r2 (raw file):
Why is this removed? Comments from Reviewable |
…for non-istio case.
01624a4
to
1ec6462
Compare
Review status: 11 of 29 files reviewed at latest revision, 9 unresolved discussions. types.go, line 237 at r2 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. builder/client/client.go, line 41 at r2 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Remove this flag, and do unconditionally retry. buildermgr/envwatcher.go, line 440 at r2 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Let me fix this in PR512 controller/functionApi.go, line 133 at r1 (raw file): Previously, soamvasani (Soam Vasani) wrote…
environments/fetcher/cmd/main.go, line 131 at r2 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Discussed with @Vishal, we decided to switch to httpget for overall consistency. Documentation/docs-site/content/tutorial/istio-integration.md, line 2 at r3 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. Documentation/docs-site/content/tutorial/istio-integration.md, line 119 at r3 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. Documentation/docs-site/content/tutorial/istio-integration.md, line 122 at r3 (raw file): Previously, soamvasani (Soam Vasani) wrote…
Done. Comments from Reviewable |
LGTM Reviewed 1 of 5 files at r3, 18 of 18 files at r4. Comments from Reviewable |
Waiting for this moment for a long time. 🎉 |
Congrats on getting this done, I am looking forward to playing with it soon! 🎊 |
This is the very first step for fission to integrate with Istio and there are still couple problems need to be solved. For those interested in trying integrate fission with istio, following is the set up tutorial (Tutorial also post on here). (#278, #344)
Test Environment
Set Up
Create Kubernetes v1.8+ alpha cluster
Enable both RBAC & initializer features on kubernetes cluster.
** NOTICE **
kubectl logs -f
is not working correctly on GKE alpha cluster right now.Grant cluster admin permissions
Grant admin permission for
system:serviceaccount:kube-system:default
and current user.Set up Istio environment
Download Istio 0.2.12
Apply istio related YAML files
Since helm uses jobs to install charts, we have to remove
jobs
frominitializers.rules.resources
due to a known bug in istio pilot as a workaround.Set default namespace to
fission
Install fission
fission-bundle docker image for demo:
life1347/fission-istio-integration:1.0.0
Create custom function
Set environment
demo function: hello.js
Create environment
Create function
Create route
Access function
Install Add-ons
Web Link: http://127.0.0.1:9090/graph
Please install Prometheus first.
Web Link: http://127.0.0.1:3000/dashboard/db/istio-dashboard
Web Link: http://localhost:16686
This change is