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

connect fn and resource injections #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

henderiw
Copy link
Contributor

@henderiw henderiw commented Jun 11, 2023

this adds to the cluster the connectivity to the network. It specifies a link that represents the connectivity to the network. The nodes are the network devices to which the link is supported.

The connect-fn uses the names to find the ports on the switch/router.

so I use edge01, edge02, edge03, edge04

edge w/o a number is the same as edge01
edge01, uses port 1-4
edge02, uses port 5-8
edge03: uses port 9-12
edge04: uses port 13-16
regional e/o a number is the same as regional01
regional01, uses port 17-20
regional02, uses port 21-24
regional03: uses port 25-28
regional04: uses port 29-32

The connect fn takes care of this. I allow dual homing and single homing. Up to 4 nodes in a cluster and max 4 edge sites and max 4 regional sites. We can do other scenario's but this is what the connect-fn supports right now.

  • it uses a node resource: right now I added leaf1 as a fixed name -> other topologies can be added like a dual leaf, etc
    the node that is injected is provisioned already during install scripts.

this is what we should add to the install script. deploying the node is still through clab but we will create an operator going fwd. clap installs a bunch of things like CERT, network for mgmt, default config for ssh/gnmi/etc etc. So this is why we should retain it for now. Will replace it with an operator. I give it a fixed ip from the docker kind bridge. we can change it.

besides crab we provision a secret to connect to the device and 2 CR(s) to make the controllers aware about the existence of the node. The node will be used in config injection. The target is used by the controller to configure the config of the switch.

So this should be added to the install.

name: nephio

mgmt:
  network: kind

topology:
  kinds:
    srl:
      type: ixrd3
      image: ghcr.io/nokia/srlinux:22.11.2-116
  nodes:
    srl:
      kind: srl
      mgmt-ipv4: 172.18.0.3

sudo clab deploy -t clab/srl-nephio.yaml

kubectl create secret generic -n default srl.nokia.com \
  --from-literal username=admin \
  --from-literal password=NokiaSrl1! \
  --type kubernetes.io/basic-auth
cat <<EOF | kubectl apply -f -
apiVersion: inv.nephio.org/v1alpha1
kind: Target
metadata:
  name: leaf1
  labels:
    nephio.org/node-name: srl
    nephio.org/provider: srl.nokia.com
    nephio.org/topology: nephio-sandbox
spec:
  address: 172.18.0.3:57400
  provider: srl.nokia.com
  secretName: srl.nokia.com
---
apiVersion: inv.nephio.org/v1alpha1
kind: Node
metadata:
  name: leaf1
  labels:
    nephio.org/node-name: srl
    nephio.org/provider: srl.nokia.com
    nephio.org/topology: nephio-sandbox
spec:
  provider: srl.nokia.com
EOF

@nephio-prow
Copy link
Contributor

nephio-prow bot commented Jun 11, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from henderiw by writing /assign @henderiw in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@henderiw henderiw requested review from electrocucaracha and vjayaramrh and removed request for tliron June 11, 2023 12:32
@@ -16,6 +16,10 @@ spec:
injectors:
- kind: WorkloadCluster

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to map from the command output of kubectl explain PackageVariant.spec.injectors and what you have in L17 and L22. I am getting the impression that kind and name are repeated twice, I could be reading this wrong

ubuntu@nephio-r1-e2e-vish:~$ kubectl explain PackageVariant.spec.injectors
KIND:     PackageVariant
VERSION:  config.porch.kpt.dev/v1alpha1

RESOURCE: injectors <[]Object>

DESCRIPTION:

     InjectionSelector specifies how to select in-cluster objects for resolving
     injection points.

FIELDS:
   group	<string>

   kind	<string>

   name	<string> -required-

   version	<string>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, the injectors is a list of Objects and not a single object

@johnbelamaric
Copy link
Member

/hold

Let's hold off a bit on the dynamic network piece until we have specialization working for the current AMF, SMF packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants