apache / openwhisk-deploy-kube

The Apache OpenWhisk Kubernetes Deployment repository supports deploying the Apache OpenWhisk system on Kubernetes and OpenShift clusters.
https://openwhisk.apache.org/
Apache License 2.0
302 stars 232 forks source link

Add helm release to invoker pod #639

Closed ningyougang closed 4 years ago

ningyougang commented 4 years ago

If want to deploy two helm release openwhisk cluster, when the second helm release cluster's invokerN pod is restarting, it will delete the first helm release's invokerN runtime pods.

Because when invokerN pod is starting, it will delete runtime pods with label(invoker=invokerN) only. e.g. https://github.com/apache/openwhisk/blob/master/core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/kubernetes/KubernetesContainerFactory.scala#L65

in order to avoid delete other helm release invokerN's runtime pod, it is better to add helm release to invoker pod, and when invoker pod is starting, add label(release=xxxxxx) together with label(invoker=invokerN) to delete runtime pods.

another brother pr: https://github.com/apache/openwhisk/pull/4979

dgrove-oss commented 4 years ago

Repeating the question from the core repo....does deploying to separate namespaces avoid the problem? My intuition is that it should.

ningyougang commented 4 years ago

@dgrove-oss ,hi yes, using two kubernates namespace can avoid the problem. but some users may deploy two deployments in same namespace.

hm..i think add a one more lable(release=xxxx) it is more carefully.

dgrove-oss commented 4 years ago

I don't object too much to the change, but be aware that when you do a helm delete and undeploy the chart, it doesn't remove the action containers (the chart had no idea they exist). So using a namespace for more than a single deployment is a bit dicey in any case. Part of the reason the invoker deletes all the pods when it starts up is to try to clean up from previous deployments in the same namespace.