Skip to content
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

Topology aware scale-from-zero running of NSEs in response to NSC demand: Implement a chain element that can produce pod based on the passed template #141

Closed
denis-tingaikin opened this issue May 6, 2021 · 0 comments · Fixed by #147
Assignees
Labels
enhancement New feature or request Planning Planning The issue that related to current SOW

Comments

@denis-tingaikin
Copy link
Member

denis-tingaikin commented May 6, 2021

Description

We need to implement a chain element that could supply pod on the specific node on Request.

Implementation details

  1. Add new networkservice chain element and put it into /pkg/networkservice/common
  2. Constructor should expect two mandatory parameters:
    2.1. Pod spec. See the model definition: https://pkg.go.dev/k8s.io/api/core/v1#Pod
    2.2. K8s API client interface. See at an example: https://github.com/networkservicemesh/sdk-k8s/blob/main/pkg/registry/etcd/nse_server.go#L145
  3. Method request should try to verify that label with node is set. For tests you could use https://github.com/networkservicemesh/sdk/tree/main/pkg/networkservice/common/clientinfo
  4. Method request should produce a pod from the template (2.1) at the node from step 3 via k8s api client. Note: we also need to inject env with NSE labels into producing pod. See at env example: https://github.com/networkservicemesh/cmd-nse-icmp-responder/blob/main/main.go#L74
    Default env name: "NSM_LABELS"
    Value should be: nodeName: ${node_name_from_request}
    Also, we could make the env name configurable.
  5. If step 4 was a success then the chain element should return an error. For example
return resp, errors.New("cannot provide required networkservice")

Note: It is required because we need to make permutation on nsmgr side to select the endpoint that we created on step 4.
6. Add unit tests to cover

References

networkservicemesh/sdk#892

@denis-tingaikin denis-tingaikin added enhancement New feature or request Planning Planning The issue that related to current SOW labels May 6, 2021
@d-uzlov d-uzlov mentioned this issue May 11, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Planning Planning The issue that related to current SOW
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants