-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from Keysight/bogdan-updates
added containers resources
- Loading branch information
Showing
6 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright Keysight Technologies 2021. | ||
|
||
IMPORTANT: If the Software includes one or more computer programs bearing a Keysight copyright notice and in source code format (“Source Files”), such Source Files are subject to the terms and conditions of the Keysight Software End-User License Agreement (“EULA”) www.Keysight.com/find/sweula and these Supplemental Terms. BY USING THE SOURCE FILES, YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THE EULA INCLUDING THESE SUPPLEMENTAL TERMS. IF YOU DO NOT AGREE TO THESE TERMS AND CONDITIONS, DO NOT COPY OR DISTRIBUTE THE SOURCE FILES. | ||
|
||
Additional Rights and Limitations. Keysight grants you a limited, non-exclusive license, without a right to sub-license, to copy and modify the Source Files solely for use with Keysight products, or systems that contain at least one Keysight product. You own any such modifications and Keysight retains all right, title and interest in the underlying Source Files. All rights not expressly granted are reserved by Keysight. | ||
|
||
General. Capitalized terms used in these Supplemental Terms and not otherwise defined herein shall have the meanings assigned to them in the EULA. To the extent that any of these Supplemental Terms conflict with terms in the EULA, these Supplemental Terms control solely with respect to the Source Files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
============ | ||
Introduction | ||
============ | ||
|
||
The loadcore agent container needs to be run using root privileges and requires the following capabilities: | ||
"NET_ADMIN", "NET_BIND_SERVICE", "NET_RAW", "IPC_LOCK", "SYS_RAWIO", "SYS_NICE", "DAC_READ_SEARCH" and "SYS_PTRACE". | ||
It also requires SCTP to be enabled. | ||
There are several options to use the loadcore agent container: to use directly the container, to install it in Kubernetes or to install it in OpenShift. | ||
|
||
================================================== | ||
Using the loadcore agent docker container directly | ||
================================================== | ||
In order to use the loadcore agent directly from the Docker container, please follow the below steps: | ||
|
||
1. Load the container: | ||
%> docker load -i LoadCore-Agent-Docker-4.4.0.32-1d68ec7237-20240726T121911Z.tar.gz | ||
|
||
1. Create a new docker network: | ||
%> docker network create loadcore-network | ||
|
||
2. Create a new container from the loadcore agent image, specifying the middleware IP, the admin interface (eth0) and the test interface (eth1): | ||
%> docker create --name loadcore-agent --cap-add=NET_ADMIN --cap-add=NET_BIND_SERVICE --cap-add=NET_RAW --cap-add=IPC_LOCK --cap-add=SYS_RAWIO --cap-add=SYS_NICE --cap-add=DAC_READ_SEARCH --cap-add=SYS_PTRACE loadcore-agent:4.4.0.32-1d68ec7237 MIDDLEWARE-IP eth0 eth1 | ||
|
||
3. Connect the container to the network created above: | ||
%> docker network connect loadcore-network loadcore-agent | ||
This will add an extra network interface, named eth1, in the container. | ||
|
||
4. Start the container: | ||
%> docker start loadcore-agent | ||
|
||
=========================================== | ||
Installing the loadcore agent on Kubernetes | ||
=========================================== | ||
Before installing the agent in Kubernetes, make sure that you have Multus installed. | ||
See more information about installing and configuring Multus here: | ||
https://github.com/intel/multus-cni/blob/master/docs/configuration.md | ||
|
||
You can install the agent in kubernetes using the provided helm chart. | ||
See more information about helm and how to install it here: https://helm.sh/ | ||
|
||
The configuration files referred in the steps below can be found in the 'kubernetes' directory. | ||
|
||
In order to install the agent in Kubernetes, please follow the below steps: | ||
|
||
1. Load the container: | ||
%> docker load -i LoadCore-Agent-Docker-4.4.0.32-1d68ec7237-20240726T121911Z.tar.gz | ||
2. Tag the container in order to be pushed in your private docker registry: | ||
%> docker tag loadcore-agent:4.4.0.32-1d68ec7237 <PRIVATE-DOCKER-REGISTRY>/loadcore-agent:4.4.0.32-1d68ec7237 | ||
|
||
3. Push the container in the private docker registry: | ||
%> docker push <PRIVATE-DOCKER-REGISTRY>/loadcore-agent:4.4.0.32-1d68ec7237 | ||
|
||
4. Create the keysight-loadcore-agent namespace: | ||
%> kubectl create namespace keysight-loadcore-agent | ||
|
||
5. Edit the 'my_values.yaml' configuration file and specify the following: | ||
- your private docker registry (substitute PRIVATE-DOCKER-REGISTRY). | ||
- the name of the kubernetes secret so that kubernetes to be able to pull the image from the docker registry (substitute PULL-SECRET-NAME). | ||
- the number of agent replicas (substitute NUMBER-OF-REPLICAS). | ||
- the IP of the middleware (substitute MIDDLEWARE-IP-ADDR). | ||
- the agent test interfaces (you can specify that both net1 and net2 test interfaces will be used). | ||
- the master ethernet interface to be used by the multus interface (substitute MASTER-ETH-INTERFACE). | ||
You can also further tweak the multus agent settings, such as subnet range, gateway, etc. | ||
|
||
6. Install the helm chart: | ||
%> helm install -f my_values.yaml loadcore-agent ./load-core-agent-4.4.0-32+1d68ec7237.20240726.tgz | ||
|
||
7. Confirm that the agent is running: | ||
%> kubectl get pods -n keysight-loadcore-agent | ||
|
||
========================================== | ||
Installing the loadcore agent on OpenShift | ||
========================================== | ||
Make sure that SCTP is enabled on the cluster. See more documentation about SCTP on OpenShift here: | ||
https://docs.openshift.com/container-platform/4.11/networking/using-sctp.html | ||
|
||
The configuration file referred in the steps below can be found in the 'openshift' directory. | ||
|
||
In order to install the agent in OpenShift, please follow the below steps: | ||
|
||
1. Login to the cluster internal registry using podman: | ||
%> REGISTRY="$(oc -n openshift-image-registry get route default-route -o jsonpath='{.spec.host}')" | ||
$> podman login --tls-verify=false -u unused -p $(oc whoami -t) ${REGISTRY} | ||
|
||
2. Load the loadcore agent image: | ||
%> podman load -i LoadCore-Agent-Docker-4.4.0.32-1d68ec7237-20240726T121911Z.tar.gz | ||
|
||
3. See the loaded image details: | ||
%> podman images | ||
|
||
4. Tag the loadcore image using the same image ID returned by 'podman images', for example: | ||
%> podman tag bc99e14756 $REGISTRY/loadcore/loadcore-agent:4.4.0.32-1d68ec7237 | ||
|
||
5. Push the loadcore image to the internal image registry: | ||
%> podman push --tls-verify=false $REGISTRY/loadcore/loadcore-agent:4.4.0.32-1d68ec7237 | ||
|
||
6. We need to configure an extra interface to be used as test interface. Multus is already configured on OpenShift. | ||
Here, is an example of how to add an additional network using Multus: | ||
%> oc edit networks.operator.openshift.io cluster | ||
than add the following: | ||
|
||
spec: | ||
additionalNetworks: | ||
- name : loadcore-network | ||
namespace: loadcore | ||
type: Raw | ||
rawCNIConfig: '{"cniVersion": "0.3.1", "name": "loadcore-network", "type": "bridge", "master": "eth0", "ipam": { "type": "whereabouts", "range": "192.168.1.0/24", "exclude": ["192.168.1.0/32", "192.168.1.1/32", "192.168.1.254/32"]}}' | ||
|
||
7. Get the loadcore image name the registry: | ||
%> oc describe is loadcore-agent | ||
Observe the image name, it is something like this: | ||
image-registry.openshift-image-registry.svc:5000/loadcore/loadcore-agent@sha256:3425980b45b5512d998edf8f65518d8d95605d9fa9899f77e00a7a0c2ccde04e | ||
|
||
8. Update the loadcore-agent-deployment.yaml file with the name of the image obtained at the previou setp and with the IP of the middleware (in the arguments section). | ||
You can also modify the number of agent instances (see the replicas parameter inside the deployment file). | ||
|
||
9. Apply the loadcore agent deployment: | ||
%> oc apply -f loadcore-agent-deployment-loadcore.yaml |
Binary file added
BIN
+2.33 KB
...Open RAN SIM CE 3.0/Templates/kubernetes/load-core-agent-4.4.0-32+1d68ec7237.20240726.tgz
Binary file not shown.
52 changes: 52 additions & 0 deletions
52
Containers/Open RAN SIM CE 3.0/Templates/kubernetes/my_values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
image: | ||
pullPolicy: IfNotPresent | ||
repository: <PRIVATE-DOCKER-REGISTRY> | ||
|
||
imagePullSecrets: | ||
- name: <PULL-SECRET-NAME> | ||
|
||
nodeSelector: {} | ||
tolerations: [] | ||
affinity: {} | ||
resources: {} | ||
env: [] | ||
capabilities: | ||
- "NET_ADMIN" | ||
- "NET_BIND_SERVICE" | ||
- "NET_RAW" | ||
- "IPC_LOCK" | ||
- "SYS_RAWIO" | ||
- "SYS_NICE" | ||
- "DAC_READ_SEARCH" | ||
- "SYS_PTRACE" | ||
privileged: false | ||
|
||
app: | ||
name: load-core-agent | ||
release: load-core-agent | ||
namespace: keysight-loadcore-agent | ||
replicas: <NUMBER-OF-REPLICAS> | ||
args: | ||
middlewareAddr: <MIDDLEWARE-IP-ADDR> | ||
adminInterface: eth0 | ||
testInterfaces: net1,net2 | ||
agentNetworks: load-core-agent-network,load-core-agent-network | ||
testNetwork: | ||
create: true | ||
name: load-core-agent-network | ||
config: '{ | ||
"cniVersion": "0.3.1", | ||
"type": "macvlan", | ||
"master": "<MASTER-ETH-INTERFACE>", | ||
"mode": "bridge", | ||
"ipam": { | ||
"type": "host-local", | ||
"subnet": "192.168.1.0/24", | ||
"rangeStart": "192.168.1.1", | ||
"rangeEnd": "192.168.1.254", | ||
"routes": [ | ||
{ "dst": "0.0.0.0/0" } | ||
], | ||
"gateway": "192.168.1.1" | ||
} | ||
}' |
32 changes: 32 additions & 0 deletions
32
Containers/Open RAN SIM CE 3.0/Templates/openshift/loadcore-agent-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: loadcore-agent | ||
namespace: loadcore | ||
labels: | ||
app: loadcore-agent | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: loadcore-agent | ||
template: | ||
metadata: | ||
labels: | ||
app: loadcore-agent | ||
namespace: loadcore | ||
annotations: | ||
k8s.v1.cni.cncf.io/networks: loadcore-network | ||
spec: | ||
containers: | ||
- name: loadcore-agent | ||
image: <LOADCORE-AGENT-IMAGE> | ||
imagePullPolicy: IfNotPresent | ||
args: ["<MIDDLEWARE-IP>", "eth0", "net1"] | ||
securityContext: | ||
capabilities: | ||
add: ["NET_ADMIN", "NET_BIND_SERVICE", "NET_RAW", "IPC_LOCK", "SYS_RAWIO", "SYS_NICE", "DAC_READ_SEARCH", "SYS_PTRACE"] | ||
ports: | ||
- containerPort: 38412 | ||
name: sctpserver | ||
protocol: SCTP |
22 changes: 22 additions & 0 deletions
22
Containers/Open RAN SIM CE 3.0/Templates/openshift/multus-network-attachement.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: "k8s.cni.cncf.io/v1" | ||
kind: NetworkAttachmentDefinition | ||
metadata: | ||
name: loadcore-network | ||
namespace: loadcore | ||
spec: | ||
config: '{ | ||
"cniVersion": "0.3.1", | ||
"type": "macvlan", | ||
"master": "eth0", | ||
"mode": "bridge", | ||
"ipam": { | ||
"type": "host-local", | ||
"subnet": "192.168.1.0/24", | ||
"rangeStart": "192.168.1.200", | ||
"rangeEnd": "192.168.1.203", | ||
"routes": [ | ||
{ "dst": "0.0.0.0/0" } | ||
], | ||
"gateway": "192.168.1.1" | ||
} | ||
}' |