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

WIP: Inital PTP events consumer #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode
*kubeconfig*
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,21 @@ Templates for a DU workload deployed with [kube-burner](https://github.com/kube-
* Traffic on primary CNI due to workload expected around 350 KB per sec
* kube api-server incremental load due to workload expected to increase by 5-8%


###### Intended for use in internal system testing pipelines but the templates can be run on any cluster with kube-burner

### Steps to run workload with cpu_utilization tests:
### Steps to run workload with cpu_utilization tests

* Run the MIRROR_SPOKE_OPERATOR_IMAGES stage in ocp-far-edge-vran-deployment pipeline to mirror necessary test images
* Run the cpu_util test using ocp-far-edge-vran-tests pipeline

### Steps to run locally
* export REGISTRY=quay.io/rh_ee_apalanis
* clone and deploy DU workload with `kube-burner init --config du-intensive.yaml`

* clone this repo
* run the following

```shell
export REGISTRY="" # For a connected cluster
export NODE_NAME=$( oc get nodes -ojson | jq .items[0].metadata.name -r) # For SNO
export KUBECONFIG="..."
kube-burner init --config du-intensive.yaml
```
29 changes: 19 additions & 10 deletions du-intensive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
errorOnVerify: true
defaultMissingKeysWithZero: true
objects:

# Template of Gu Pods with fedora-stress-ng
- objectTemplate: templates/common/configmap.yaml
replicas: 2
Expand All @@ -26,8 +25,8 @@ jobs:
- objectTemplate: templates/guaranteed/deployment.yaml
replicas: 1
inputVars:
Image_stressng: "{{ .REGISTRY }}/fedora-stress-ng"
Image_nginx: "{{ .REGISTRY }}/sampleapp"
Image_stressng: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/fedora-stress-ng'
Image_nginx: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/sampleapp'
volumes:
- name: configmap-guaranteed-1
type: configMap
Expand All @@ -54,14 +53,14 @@ jobs:
- objectTemplate: templates/common/configmap.yaml
replicas: 2
- objectTemplate: templates/common/secret.yaml
replicas: 4
replicas: 4

# Template of burstable pods with exec probes
- objectTemplate: templates/webserver/webserver-deployment.yaml
replicas: 4
inputVars:
Image_nginx: "{{ .REGISTRY }}/sampleapp"
Image_stressng: "{{ .REGISTRY }}/fedora-stress-ng"
Image_stressng: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/fedora-stress-ng'
Image_nginx: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/sampleapp'
volumes:
- name: configmap-1
type: configMap
Expand All @@ -86,8 +85,8 @@ jobs:
- objectTemplate: templates/webserver/curl-deployment.yaml
replicas: 4
inputVars:
Image_curl: "{{ .REGISTRY }}/curl"
Image_nginx: "{{ .REGISTRY }}/sampleapp"
Image_nginx: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/sampleapp'
Image_curl: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/curl'
volumes:
- name: configmap-1
type: configMap
Expand Down Expand Up @@ -118,8 +117,8 @@ jobs:
- objectTemplate: templates/kubectlapp/deployment.yaml
replicas: 6
inputVars:
Image_kubectl: "{{ .REGISTRY }}/kubectl"
Image_nginx: "{{ .REGISTRY }}/sampleapp"
Image_nginx: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/sampleapp'
Image_kubectl: '{{ or .REGISTRY "quay.io/rh_ee_apalanis" }}/kubectl'
volumes:
- name: configmap-1
type: configMap
Expand All @@ -139,3 +138,13 @@ jobs:
- name: secret-4
type: secret
path: /var/secret4

- objectTemplate: templates/ptp-events-consumer/service-account.yaml
replicas: 1
- objectTemplate: templates/ptp-events-consumer/deployment.yaml
replicas: 1
inputVars:
Image_ptp_consumer: '{{ or .REGISTRY "quay.io/jenchen" }}/ptp-event-consumer'
short_node_name: '{{ (split "." .NODE_NAME)._0 }}'
- objectTemplate: templates/ptp-events-consumer/service.yaml
replicas: 1
1 change: 1 addition & 0 deletions templates/ptp-events-consumer/READEME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Deploys a consumer of PTP events fromt he ORAN API
60 changes: 60 additions & 0 deletions templates/ptp-events-consumer/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ptp-event-deployment
labels:
app: du-ptp-event-consumer
spec:
replicas: 1
selector:
matchLabels:
app: du-ptp-event-consumer
template:
metadata:
labels:
app: du-ptp-event-consumer
spec:
nodeSelector:
node-role.kubernetes.io/worker: ""
serviceAccountName: ptp-event-consumer-sa
containers:
- name: ptp-consumer
image: {{ .Image_ptp_consumer }}
args:
- "--local-api-addr=127.0.0.1:27017"
- "--api-path=/api/ocloudNotifications/v1/"
- "--api-addr=127.0.0.1:27017"
env:
- name: NODE_NAME
{{ if .short_node_name }}
value: "{{ .short_node_name }}"
{{ else }}
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{ end }}
- name: NODE_NAME_FULL
{{ if .short_node_name }}
value: "{{ .short_node_name }}"
{{ else }}
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{ end }}
- name: NAME_SPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: CONSUMER_PORT
value: "27017"
- name: CONSUMER_TYPE
value: "PTP"
- name: ENABLE_STATUS_CHECK
value: "true"
volumeMounts:
- name: pubsubstore
mountPath: /store
volumes:
- name: pubsubstore
emptyDir: {}
6 changes: 6 additions & 0 deletions templates/ptp-events-consumer/service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: ptp-event-consumer-sa
labels:
app: du-ptp-event-consumer
18 changes: 18 additions & 0 deletions templates/ptp-events-consumer/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
annotations:
prometheus.io/scrape: "true"
name: du-ptp-event-consumer-service
labels:
app: du-ptp-event-consumer
spec:
ports:
- name: sub-port
port: 27017
targetPort: http
selector:
app: du-ptp-event-consumer
clusterIP: None
sessionAffinity: None
type: ClusterIP