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

Allow running berserker on k8s with configuration #5

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

Conversation

Molter73
Copy link
Contributor

@Molter73 Molter73 commented Sep 4, 2023

This PR adds a basic yaml file that allows running berserker as a daemon set and use configmaps to control its behavior.

For now the image being configured is one on quay.io/rhacs-eng/qa, but it'd be great to update it to a tagged version if we ever do one of those.

effect: NoSchedule
containers:
- name: berserker
image: quay.io/rhacs-eng/qa:berserker-1.0-35-g3d1715a7f3
Copy link
Contributor

Choose a reason for hiding this comment

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

Update to the latest tag 1.0-40-ge3bd96aa5a

Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to add an imagePullSecret. Currently this doesn't work on infra, because it cannot pull the image.

I don't know if I did this the best way, but you can look at how I did this for the long running cluster. Also you will need to make some changes as this is for kube-burner. ACS itself has some other method for setting imagePullSecrets.

Secret template
https://github.com/stackrox/stackrox/blob/master/scripts/release-tools/kube-burner-configs/secret_template.yml

Berserker deployment that uses the secret
https://github.com/stackrox/stackrox/blob/master/scripts/release-tools/kube-burner-configs/cluster-density/deployment.yml

Script that creates the secret from the secret template
https://github.com/stackrox/actions/blob/main/release/start-kube-burner/start-kube-burner.sh

@JoukoVirtanen
Copy link
Contributor

I did the following test

minikube start --driver=docker --cpus=10 --memory=29000 

minikube ssh

docker login quay.io

docker pull quay.io/rhacs-eng/qa:berserker-1.0-35-g3d1715a7f3
docker pull quay.io/rhacs-eng/qa:berserker-1.0-40-ge3bd96aa5a

exit

kubectl create -f endpoints-uniform.yml
kubectl create -f berserker.yml

In a separate terminal run any of the collector integration tests

make -C integration-tests TestChangeProcessNameChildProcessNoFork COLLECTOR_TAG=3.16.x-82-gf1e4d3ca19

This integration test doesn't exist in the master branch but any of them will do

grep berserker TestChangeProcessNameChildProcessNoFork-events.log

When using the berserker-1.0-35-g3d1715a7f3 no endpoints are observed

kubectl edit ds/berserker

Change the image tag to berserker-1.0-40-ge3bd96aa5a

Run the collector integration test again

grep berserker TestChangeProcessNameChildProcessNoFork-events.log

2023/10/08 12:16:27 EndpointInfo: SOCKET_FAMILY_IPV4|L4_PROTOCOL_TCP|address_data:"\000\000\000\000" port:3624 ip_network:"\000\000\000\000 " |(timestamp: nil Timestamp)|process_name:"berserker" process_exec_file_path:"/usr/local/bin/berserker" 
2023/10/08 12:16:27 EndpointInfo: SOCKET_FAMILY_IPV4|L4_PROTOCOL_TCP|address_data:"\000\000\000\000" port:1480 ip_network:"\000\000\000\000 " |(timestamp: nil Timestamp)|process_name:"berserker" process_exec_file_path:"/usr/local/bin/berserker" 
2023/10/08 12:16:27 EndpointInfo: SOCKET_FAMILY_IPV4|L4_PROTOCOL_TCP|address_data:"\000\000\000\000" port:3625 ip_network:"\000\000\000\000 " |(timestamp: nil Timestamp)|process_name:"berserker" process_exec_file_path:"/usr/local/bin/berserker" 
2023/10/08 12:16:27 EndpointInfo: SOCKET_FAMILY_IPV4|L4_PROTOCOL_TCP|address_data:"\000\000\000\000" port:3626 ip_network:"\000\000\000\000 " |(timestamp: nil Timestamp)|process_name:"berserker" process_exec_file_path:"/usr/local/bin/berserker"

Many other endpoints are observed.

Repeat the test for the other config files.

@JoukoVirtanen
Copy link
Contributor

Perhaps in the future we could have some integration tests to make sure that we are getting the desired load from berserker.

@@ -0,0 +1,14 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

[ultra nit] The other files don't start with a blank space.

@@ -0,0 +1,39 @@
---
apiVersion: apps/v1
Copy link
Contributor

Choose a reason for hiding this comment

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

The file names could be improved. They could be either prefixed or suffixed with the kind. E.g berserker-daemonset.yml.

@Molter73 Molter73 force-pushed the mauro/run-berserker-on-k8s branch from db07469 to b4e751a Compare February 19, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants