-
Notifications
You must be signed in to change notification settings - Fork 472
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
Help needed with constraints #406
Comments
Please fill out the whole template, this is there because we need the information. |
https://github.com/openfaas/faas-netes/blob/master/.github/ISSUE_TEMPLATE.md You'll also need to state if you're using the operator or not. |
Derek set title: Help needed with constraints |
Derek close: inactivity |
I'm going to close this, but feel free to keep commenting. |
I am having exactly the same problem in my cluster which consists of both Linux and Windows nodes. I would like this bug to be fixed. How can I help with this? What kind of information is missing? |
I am also experiencing this issue. Looking at the documentation, the only example of constraints is for docker swarm, but it remains unclear how to format constraints for k8s environments (I'm not so familiar with swarm so maybe it is essentially the same). I'm trying to provide a nodeselector constraint, both via the stack yaml and via cli flags, in this case the node has the label "acceleration=gpu". But I cannot see this anywhere in the deployment and the scheduler disregards this completely. |
So the constraint supported at present corresponds to a nodeSelector. So apply a label to one or more nodes and then you can specify that constraint in your stack.yaml. Hope this helps, if you're still struggling, jump on Slack #kubernetes channel |
Thanks for clarifying! Now I got it to work, but I still find it a bit strange that it didn't work when I tried via the CLI:
while now it works when adding this in the stack yaml:
Also, as I mentioned the documentation only shows a swarm example, where the key and value are separated by == and this is what I tried first, but it seems that was the issue. Perhaps providing a k8s constraint example as well would better clarify the usage in this context, or mentioning that for k8s it is translated directly to a nodeSelector. |
The Kubernetes operator `faas-netes` expects the constraints / nodeSelectors in the format <label-key>=<label-value>. References: - Pull Request ([Node selector support via constraints openfaas#77](openfaas/faas-netes#77)), which introduced the feature - the [source code for the createSelector function](https://github.com/openfaas/faas-netes/blame/master/pkg/handlers/deploy.go#L338), see how the key-value pair is split - an [issue](openfaas/faas-netes#406 (comment)) regarding the difference between constraints for Docker Swarm & Kubernetes also remove some erroneous whitespace in an URL, which broke the link and anchor
The Kubernetes operator `faas-netes` expects the constraints / nodeSelectors in the format <label-key>=<label-value>. references: - pull request ([Node selector support via constraints openfaas#77](openfaas/faas-netes#77)), which introduced the feature - the [source code for the createSelector function](https://github.com/openfaas/faas-netes/blame/master/pkg/handlers/deploy.go#L338), see how the key-value pair is split - an [issue](openfaas/faas-netes#406 (comment)) regarding the difference between constraints for Docker Swarm & Kubernetes Signed-off-by: Robert Groh <robert.groh@amity.group>
The Kubernetes operator `faas-netes` expects the constraints / nodeSelectors in the format <label-key>=<label-value>. references: - pull request ([Node selector support via constraints openfaas#77](openfaas/faas-netes#77)), which introduced the feature - the [source code for the createSelector function](https://github.com/openfaas/faas-netes/blame/master/pkg/handlers/deploy.go#L338), see how the key-value pair is split - an [issue](openfaas/faas-netes#406 (comment)) regarding the difference between constraints for Docker Swarm & Kubernetes also: - fix broken link/anchor by removing erroneous whitespace in the URL Signed-off-by: Robert Groh <robert.groh@amity.group>
Contraints don't end up in the deployment.
Expected Behaviour
When specified constrains with faas-cli, either in the function yaml or in the command line flag, it should end up in the deployment yaml, but it doesn't and hence doesn't deploy.
Current Behaviour
The constraints don't have an effect on the deployment.
I tried having my function deploy to a specific CPU type. I labeled my node, and specified the constraint through the faas-cli.
Preliminary checks, I see a sign of the constraint arriving at the faas-netes pod, but don't see any sign in the deployment, the deployment yaml has neither a nodeSelector nor a labelSelector.
Possible Solution
Steps to Reproduce (for bugs)
Steps to Reproduce (for bugs)
Add a constraints statement to the openfaas function yaml, something like:
constraints:
(where devtype is a label I labeled the nodes)
Or use a built-in node label, such as:
constraints:
Deploy and check to which node the image was deployed. Was it subsequent pods deployed only to specified node types?
Check the deployment yaml to see if a nodeSelector or equivalent statement exists.
Context
This is a follow-up on my previous issue in faas-cli issue #616 after some preliminary debugging.
openfaas/faas-cli#616
Your Environment
I have a small cluster with openfaas on K3S, the master node is an amd64 PC, with two arm rpi nodes as slaves. I want my openfaas function to deploy to its appropriate node by architecture. Tried specifying a function constraint with a node label. The pod didn't deploy to a specific architecture node.
Docker version ( Full output from: docker version ):
Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)?
K3s + FaaS-netes according to @AlexEllisUK great blogs.
Operating System and version (e.g. Linux, Windows, MacOS):
Lubuntu on the arm64 and raspbian on the arm.
Link to your project or a code example to reproduce issue:
Tried it with the hello-python demo. With the contraints statement added to the hello-python.yaml file in the function section
The text was updated successfully, but these errors were encountered: