-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Kube-Burner to Tools Directory for ArgoCD Benchmarking #4
Open
Mangaal
wants to merge
12
commits into
argoproj-labs:main
Choose a base branch
from
Mangaal:kube-burner
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fbb5ef1
add kube-burner config
Mangaal 2a48f48
add readme for kube-burner
Mangaal a0a667c
add readme for kube-burner
Mangaal 16fe9f2
remove unwanted fields
Mangaal 196a115
update kube-burner config for argocd application
Mangaal 0a50041
update readme
Mangaal 9c6d9a7
update readme
Mangaal 18f8637
update readme
Mangaal a0d8d3e
update readme
Mangaal 1cb8fe1
update readme
Mangaal 3ca6f19
update readme
Mangaal c18d19d
update readme
Mangaal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,60 @@ | ||
# Global configuration | ||
global: | ||
gc: false | ||
|
||
# Jobs configuration | ||
jobs: | ||
# Job to create Namespaces, Roles, and RoleBindings | ||
- name: create-namespaces | ||
jobIterations: 100 | ||
namespace: kube-burner-argocd-test | ||
namespacedIterations: true | ||
cleanup: false | ||
iterationsPerNamespace: 1 | ||
qps: 50 # Increased qps to handle more requests | ||
burst: 100 # Increased burst to allow higher initial throughput | ||
objects: | ||
- kind: Namespace | ||
objectTemplate: template/namespace.yaml | ||
replicas: 1 | ||
- name: create-role | ||
jobIterations: 100 | ||
namespace: kube-burner-argocd-test | ||
namespacedIterations: true | ||
cleanup: false | ||
iterationsPerNamespace: 1 | ||
qps: 50 | ||
burst: 100 | ||
objects: | ||
- kind: Role | ||
objectTemplate: template/role.yaml | ||
replicas: 1 | ||
- name: create-rolebinding | ||
jobIterations: 100 | ||
namespace: kube-burner-argocd-test | ||
namespacedIterations: true | ||
cleanup: false | ||
iterationsPerNamespace: 1 | ||
qps: 50 | ||
burst: 100 | ||
objects: | ||
- kind: RoleBinding | ||
objectTemplate: template/rolebinding.yaml | ||
replicas: 1 | ||
# Job to create ArgoCD applications | ||
- name: create-applications | ||
jobIterations: 100 | ||
namespace: kube-burner-argocd-test | ||
namespacedIterations: true | ||
cleanup: false | ||
iterationsPerNamespace: 1 | ||
waitWhenFinished: true | ||
qps: 50 | ||
burst: 100 | ||
objects: | ||
- kind: Application | ||
objectTemplate: template/application.yaml | ||
replicas: 1 | ||
waitOptions: | ||
kind: Deployment | ||
labelSelector: {kube-burner: argocd-performance-test} |
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 @@ | ||
- endpoint: <metric-endpoint> | ||
token: "" | ||
metrics: | ||
- metric/metrics-profile.yaml | ||
indexer: | ||
type: local | ||
metricsDirectory: my-metrics |
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,34 @@ | ||
# Metrics Profile for ArgoCD Performance Testing | ||
|
||
# CPU Usage of ArgoCD Application Controller | ||
- query: irate(process_cpu_seconds_total{container="argocd-application-controller",namespace=~".+"}[1m]) | ||
metricName: argocdAppControllerCPU | ||
|
||
# Memory Usage of ArgoCD Application Controller | ||
- query: go_memstats_heap_alloc_bytes{container="argocd-application-controller",namespace=~".+"} | ||
metricName: argocdAppControllerHeapAllocMemory | ||
|
||
- query: go_memstats_heap_inuse_bytes{container="argocd-application-controller",namespace=~".+"} | ||
metricName: argocdAppControllerHeapInuseMemory | ||
|
||
|
||
# Number of k8s resource objects in the cache | ||
- query: sum(argocd_cluster_api_resource_objects{namespace=~".+"}) | ||
metricName: argocdClusterApiResourceObjects | ||
|
||
# Number of monitored Kubernetes API resources | ||
- query: sum(argocd_cluster_api_resources{namespace=~".+"}) | ||
metricName: argocdClusterApiResources | ||
|
||
# Total IO Operations of ArgoCD Application Controller | ||
- query: sum(rate(container_fs_reads_total{pod=~"openshift-gitops-application-controller-.*",namespace=~".+"}[1m]))+ sum(rate(container_fs_writes_total{pod=~"openshift-gitops-application-controller-.*",namespace=~".+"}[1m])) | ||
metricName: argocdAppControllerIO | ||
|
||
|
||
# ArgoCD Pending Kubectl Exec | ||
- query: sum(argocd_kubectl_exec_pending{namespace=~".+"}) | ||
metricName: argocdPendingKubectlExec | ||
|
||
|
||
|
||
|
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,167 @@ | ||
# ArgoCD Performance Testing with Kube-Burner | ||
|
||
This repository contains the configuration that is used to test ArgoCD's performance when managing multiple applications across different namespaces. | ||
|
||
## Prerequisites | ||
|
||
- **ArgoCD Installation**: Ensure that ArgoCD is installed and configured in your cluster. | ||
- **OpenShift Cluster**: This setup is designed for an OpenShift cluster, but it should work on any Kubernetes-compatible environment. | ||
- **Kube-Burner**: Install Kube-Burner for resource creation and metrics collection. You can find installation instructions on the [Kube-Burner GitHub page](https://github.com/kube-burner/kube-burner). | ||
|
||
## Why Use Kube-Burner? | ||
|
||
[Kube-Burner](https://kube-burner.github.io/kube-burner/latest/) is a versatile tool that creates resources, waits for them to reach a desired state, and collects relevant metrics. This makes it ideal for performance testing and benchmarking. While Kube-Burner cannot directly check or wait for ArgoCD applications to sync, it can monitor the child resources created by ArgoCD using labels and collect the necessary metrics. | ||
|
||
### Wait Configuration Example | ||
|
||
The following example illustrates the wait configuration used in this setup: | ||
|
||
```yaml | ||
objects: | ||
- kind: Application | ||
objectTemplate: template/application.yaml | ||
replicas: 1 | ||
waitOptions: | ||
kind: Deployment | ||
labelSelector: {kube-burner: argocd-performance-test} | ||
``` | ||
|
||
### Kube-Burner Configuration Details | ||
|
||
#### Metrics Profile | ||
|
||
The metric/metrics-profile.yaml file defines the metrics profile for ArgoCD performance testing, capturing essential metrics: | ||
|
||
- ***CPU Usage of ArgoCD Application Controller:*** | ||
``` | ||
- query: irate(process_cpu_seconds_total{container="argocd-application-controller",namespace=~".+"}[1m]) | ||
metricName: argocdAppControllerCPU | ||
``` | ||
- ***Memory Usage of ArgoCD Application Controller:*** | ||
``` | ||
- query: go_memstats_heap_alloc_bytes{container="argocd-application-controller",namespace=~".+"} | ||
metricName: argocdAppControllerHeapAllocMemory | ||
|
||
- query: go_memstats_heap_inuse_bytes{container="argocd-application-controller",namespace=~".+"} | ||
metricName: argocdAppControllerHeapInuseMemory | ||
``` | ||
- ***Number of Kubernetes Resource Objects in the Cache:*** | ||
``` | ||
- query: sum(argocd_cluster_api_resource_objects{namespace=~".+"}) | ||
metricName: argocdClusterApiResourceObjects | ||
``` | ||
- ***Number of Monitored Kubernetes API Resources:*** | ||
``` | ||
- query: sum(argocd_cluster_api_resources{namespace=~".+"}) | ||
metricName: argocdClusterApiResources | ||
``` | ||
- ***Total IO Operations of ArgoCD Application Controller:*** | ||
``` | ||
- query: sum(rate(container_fs_reads_total{pod=~"openshift-gitops-application-controller-.*",namespace=~".+"}[1m])) + sum(rate(container_fs_writes_total{pod=~"openshift-gitops-application-controller-.*",namespace=~".+"}[1m])) | ||
metricName: argocdAppControllerIO | ||
``` | ||
- ***ArgoCD Pending Kubectl Exec:*** | ||
``` | ||
- query: sum(argocd_kubectl_exec_pending{namespace=~".+"}) | ||
metricName: argocdPendingKubectlExec | ||
``` | ||
|
||
### Sample Metrics Data | ||
|
||
Below is a sample of metrics data collected using Kube-Burner: | ||
|
||
```json | ||
[ | ||
{ | ||
"timestamp": "2024-08-22T10:17:39.867Z", | ||
"labels": { | ||
"container": "argocd-application-controller", | ||
"endpoint": "metrics", | ||
"instance": "10.131.1.218:8082", | ||
"job": "openshift-gitops-metrics", | ||
"namespace": "openshift-gitops", | ||
"pod": "openshift-gitops-application-controller-0", | ||
"service": "openshift-gitops-metrics" | ||
}, | ||
"value": 1281433176, | ||
"uuid": "1234", | ||
"query": "go_memstats_heap_alloc_bytes{container=\"argocd-application-controller\",namespace=~\".+\"}", | ||
"metricName": "argocdAppControllerHeapAllocMemory", | ||
"jobName": "create-applications" | ||
}, | ||
{ | ||
"timestamp": "2024-08-22T10:16:53.241Z", | ||
"labels": { | ||
"container": "argocd-application-controller", | ||
"endpoint": "metrics", | ||
"instance": "10.131.1.218:8082", | ||
"job": "openshift-gitops-metrics", | ||
"namespace": "openshift-gitops", | ||
"pod": "openshift-gitops-application-controller-0", | ||
"service": "openshift-gitops-metrics" | ||
}, | ||
"value": 188994960, | ||
"uuid": "1234", | ||
"query": "go_memstats_heap_alloc_bytes{container=\"argocd-application-controller\",namespace=~\".+\"}", | ||
"metricName": "argocdAppControllerHeapAllocMemory", | ||
"jobName": "create-namespaces" | ||
}, | ||
{ | ||
"timestamp": "2024-08-22T10:17:04.303Z", | ||
"labels": { | ||
"container": "argocd-application-controller", | ||
"endpoint": "metrics", | ||
"instance": "10.131.1.218:8082", | ||
"job": "openshift-gitops-metrics", | ||
"namespace": "openshift-gitops", | ||
"pod": "openshift-gitops-application-controller-0", | ||
"service": "openshift-gitops-metrics" | ||
}, | ||
"value": 202814368, | ||
"uuid": "1234", | ||
"query": "go_memstats_heap_alloc_bytes{container=\"argocd-application-controller\",namespace=~\".+\"}", | ||
"metricName": "argocdAppControllerHeapAllocMemory", | ||
"jobName": "create-role" | ||
} | ||
] | ||
``` | ||
|
||
### Metric Endpoint Configuration | ||
|
||
To configure metric collection, update the metric/ep.yaml file as follows: | ||
```yaml | ||
endpoint: <metric-endpoint> | ||
token: "" | ||
metrics: | ||
- metric/metrics-profile.yaml # Path to the metrics query profile | ||
indexer: | ||
type: local | ||
metricsDirectory: my-metrics # Directory where metrics will be collected | ||
``` | ||
Replace <metric-endpoint> with the appropriate endpoint for your setup. | ||
|
||
### Template Customization | ||
|
||
Customize the YAML templates in the template directory before deployment: | ||
|
||
- application.yaml: Update the namespace field with ```<argocd-namespace>```. | ||
|
||
- namespace.yaml: | ||
```yaml | ||
labels: | ||
argocd.argoproj.io/managed-by: <argocd-namespace> | ||
``` | ||
- rolebinding.yaml: | ||
```yaml | ||
subjects: | ||
- kind: ServiceAccount | ||
name: <application-controller-service-account-name> | ||
namespace: <argocd-namespace> | ||
``` | ||
|
||
Replace ```<argocd-namespace>``` and ```<application-controller-service-account-name>``` with the values relevant to your environment. | ||
|
||
### Deploying the Test Setup | ||
To deploy and start the performance test, navigate to the kube-burner directory and execute: | ||
|
||
``` kube-burner init -c config.yaml -e metric/ep.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,25 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
kube-burner: argocd-performance-test | ||
app: bubble-animation | ||
name: bubble-animation | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: bubble-animation | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
app: bubble-animation | ||
spec: | ||
containers: | ||
- image: quay.io/rhdevelopers/bgd:1.0.0 | ||
name: bubble-animation | ||
env: | ||
- name: COLOR | ||
value: "blue" |
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,14 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: bubble-animation | ||
name: bubble-animation | ||
spec: | ||
ports: | ||
- port: 8081 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: bubble-animation |
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,16 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: app-{{.Iteration}} | ||
namespace: <argocd-namespace> | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/Mangaal/argocd-performance-test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be updated to the argoproj-labs repo eventually? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I need to update this |
||
targetRevision: HEAD | ||
path: test-resources | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: argocd-test-{{.Iteration}} | ||
syncPolicy: | ||
automated: {} |
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,6 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
argocd.argoproj.io/managed-by: <argocd-namespace> | ||
name: argocd-test-{{.Iteration}} |
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,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: argocd-role | ||
namespace: argocd-test-{{.Iteration}} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["services"] | ||
verbs: ["create", "get", "list", "watch", "update", "patch", "delete"] | ||
- apiGroups: ["apps"] | ||
resources: ["deployments"] | ||
verbs: ["create", "get", "list", "watch", "update", "patch", "delete"] | ||
|
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,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: argocd-rolebinding | ||
namespace: argocd-test-{{.Iteration}} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: <application-controller-service-account-name> | ||
namespace: <argocd-namespace> | ||
roleRef: | ||
kind: Role | ||
name: argocd-role | ||
apiGroup: rbac.authorization.k8s.io |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a short entry in the main README.md with a link to this new folder?, following the example that is already there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added the kube-burer as a second tools