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

draft: kit tasks #352

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
40 changes: 40 additions & 0 deletions tests/pipelines/kit/kit-cl2-load-run.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: kit-cl2-load-example-run
namespace: tekton-pipelines
spec:
timeout: "12h"
workspaces:
- name: source
emptyDir: {}
- name: results
emptyDir: {}
- name: kubeconfig
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
storageClassName: kit-gp2
resources:
requests:
storage: 1Gi
params:
- name: name
value: "my-cluster-name"
- name: "results-bucket"
value: "my-bucket"
- name: "node_count"
value: "100"
- name: "amp-workspace-id"
value: "my-AMP-workspace"
podTemplate:
nodeSelector:
kubernetes.io/arch: amd64
# TODO: The mounted EBS PV is only writable to root, ideally we should avoid to run containers as root.
securityContext:
runAsNonRoot: false
runAsUser: 0
serviceAccountName: tekton-pipelines-executor
pipelineRef:
name: kit-cl2-load
237 changes: 237 additions & 0 deletions tests/pipelines/kit/kit-cl2-load.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
---
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: kit-cl2-load
namespace: tekton-pipelines
spec:
workspaces:
- name: source
- name: results
- name: kubeconfig
params:
- name: name
description: The name of the test cluster.
default: "guest"
- name: amp-workspace-id
description: The AMP workspace ID where remote write needs to happen.
- name: node_count
description: desired node count for Dataplane, min is 1000 to create DP nodes.
- name: kubernetes-version
default: "1.24"
description: Kubernetes version for the guest cluster.
- name: apiserver-replicas
description: "Desired replicas of the APIServer"
default: "2"
- name: apiserver-image
default: ""
description: Image of apiserver
- name: apiserver-parameters
default: ""
description: |
Parameters of the apiserver. e.g. '["--goaway-chance=0.01"]'
- name: apiserver-instance-type
default: "m5.2xlarge"
description: Instance type for the apiserver
- name: etcd-replicas
default: "3"
description: Number of ETCD replicas
- name: etcd-image
default: ""
description: Image of ETCD
- name: etcd-parameters
default: ""
description: Parameters of the ETCD container
- name: etcd-instance-type
default: "m5.xlarge"
description: Instance type for the ETCD
- name: aws-vpc-cni-version
default: release-1.10
description: The release version for aws vpc cni.
- name: aws-ebs-csi-driver-version
default: release-1.13
description: The release version for aws ebs csi driver.
- name: monitoring-node-instance-types
default: |
["m5.4xlarge"]
description: The desired instance type of the monitoring node.
- name: monitoring-node-selectors
default: 'node.kubernetes.io/instance-type=m5.4xlarge'
description: The selectors to select the monitoring node for tainting.
- name: giturl
description: "git url to clone the package"
default: https://github.com/kubernetes/perf-tests.git
- name: cl2-branch
description: "The branch of clusterloader2 you want to use"
default: "master"
- name: pods-per-node
description: "pod density"
default: "10"
- name: nodes-per-namespace
description: "nodes per namespace to get created for load test "
default: "100"
- name: cl2-load-test-throughput
description: "throughput used for mutate operations"
default: "15"
- name: results-bucket
description: "Results bucket with path of s3 to upload results"
tasks:
- name: setup-control-plane
taskRef:
kind: Task
name: control-plane-setup
params:
- name: name
value: '$(params.name)'
- name: kubernetes-version
value: '$(params.kubernetes-version)'
- name: apiserver-replicas
value: '$(params.apiserver-replicas)'
- name: apiserver-image
value: '$(params.apiserver-image)'
- name: apiserver-parameters
value: '$(params.apiserver-parameters)'
- name: apiserver-instance-type
value: '$(params.apiserver-instance-type)'
- name: etcd-replicas
value: '$(params.etcd-replicas)'
- name: etcd-image
value: '$(params.etcd-image)'
- name: etcd-parameters
value: '$(params.etcd-parameters)'
- name: etcd-instance-type
value: '$(params.etcd-instance-type)'

- name: retieve-kubeconfig
runAfter: [setup-control-plane]
taskRef:
kind: Task
name: kit-retrieve-kubeconfig
params:
- name: cluster-name
value: '$(params.name)'
workspaces:
- name: kubeconfig
workspace: kubeconfig

- name: install-cni
runAfter: [retieve-kubeconfig]
taskRef:
kind: Task
name: install-cni
params:
- name: aws-vpc-cni-version
value: 'release-1.10'
workspaces:
- name: kubeconfig
workspace: kubeconfig

- name: install-csi
runAfter: [install-cni]
taskRef:
kind: Task
name: install-csi
params:
- name: aws-ebs-csi-driver-version
value: 'release-1.13'
workspaces:
- name: kubeconfig
workspace: kubeconfig

- name: setup-monitoring-node
runAfter: [install-csi]
taskRef:
kind: Task
name: data-plane-setup
params:
- name: cluster-name
value: '$(params.name)'
- name: dataplane-name
value: 'monitoring-$(params.name)'
- name: desired-nodes
value: '1'
- name: instance-types
value: '$(params.monitoring-node-instance-types)'

- name: setup-data-plane
runAfter: [label-and-taint-minitoring-node]
taskRef:
kind: Task
name: data-plane-setup
params:
- name: cluster-name
value: '$(params.name)'
- name: desired-nodes
value: '$(params.node_count)'

- name: validate-data-plane
runAfter: [setup-data-plane]
taskRef:
kind: Task
name: validate-data-plane
params:
- name: desired-nodes
value: '$(($(params.node_count)+1))'
workspaces:
- name: kubeconfig
workspace: kubeconfig

- name: label-and-taint-minitoring-node
runAfter: [setup-monitoring-node]
taskRef:
kind: Task
name: label-and-taint-node
params:
- name: cluster-name
value: '$(params.name)'
- name: selectors
value: '$(params.monitoring-node-selectors)'
- name: taint
value: 'monitoring=true:NoSchedule'
# We add another label to ensure Prometheus stack only run on the dedicated node in
# https://github.com/awslabs/kubernetes-iteration-toolkit/blob/e95b99e09e89f23a4aa8162632ba78b6c351dec5/tests/tasks/generators/clusterloader/load.yaml#L84
- name: labels
value: 'eks.amazonaws.com/nodegroup=monitoring-$(params.name)-nodes-1'
workspaces:
- name: kubeconfig
workspace: kubeconfig

- name: load
runAfter: [validate-data-plane]
taskRef:
kind: Task
name: load
params:
- name: cluster-name
value: '$(params.name)'
- name: cl2-branch
value: '$(params.cl2-branch)'
- name: giturl
value: '$(params.giturl)'
- name: pods-per-node
value: '$(params.pods-per-node)'
- name: nodes-per-namespace
value: '$(params.nodes-per-namespace)'
- name: cl2-load-test-throughput
value: '$(params.cl2-load-test-throughput)'
- name: results-bucket
value: '$(params.results-bucket)'
- name: nodes
value: '$(params.node_count)'
- name: amp-workspace-id
value: '$(params.amp-workspace-id)'
workspaces:
- name: source
workspace: source
- name: results
workspace: results
- name: kubeconfig
workspace: kubeconfig

# finally:
# - name: teardown
# taskRef:
# name: teardown
# params:
# - name: name
# value: '$(params.name)'
20 changes: 9 additions & 11 deletions tests/tasks/generators/clusterloader/load.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ spec:
- name: region
default: "us-west-2"
description: The region where the cluster is in.
- name: endpoint
default: ""
description: "aws eks enpoint to create clusters against"
- name: cluster-name
description: The name of the EKS cluster you want to spin.
- name: amp-workspace-id
Expand All @@ -47,6 +44,8 @@ spec:
- name: source
mountPath: /src/k8s.io/
- name: results
- name: kubeconfig
description: kubeconfig of the guest cluster
steps:
- name: git-clone
image: alpine/git
Expand Down Expand Up @@ -125,23 +124,22 @@ spec:
fi
# Building clusterloader2 binary
cd $(workspaces.source.path)/perf-tests/clusterloader2/
GOPROXY=direct GOOS=linux CGO_ENABLED=0 go build -v -o ./clusterloader ./cmd
GOOS=linux CGO_ENABLED=0 go build -v -o ./clusterloader ./cmd
- name: run-loadtest
image: alpine/k8s:1.22.6
onError: continue
script: |
#!/bin/bash
ENDPOINT_FLAG=""
if [ -n "$(params.endpoint)" ]; then
ENDPOINT_FLAG="--endpoint $(params.endpoint)"
fi
if [ -n "$(params.amp-workspace-id)" ]; then
CL2_PROMETHEUS_FLAGS="--enable-prometheus-server=true --prometheus-pvc-storage-class gp2 --prometheus-manifest-path=$(workspaces.source.path)/perf-tests/clusterloader2/pkg/prometheus/manifests/"
# CL2_PROMETHEUS_FLAGS="--enable-prometheus-server=true --prometheus-pvc-storage-class gp2 --prometheus-manifest-path=$(workspaces.source.path)/perf-tests/clusterloader2/pkg/prometheus/manifests/"
CL2_PROMETHEUS_FLAGS="--enable-prometheus-server=true --prometheus-pvc-storage-class gp2 --prometheus-storage-class-provisioner ebs.csi.aws.com --prometheus-manifest-path=$(workspaces.source.path)/perf-tests/clusterloader2/pkg/prometheus/manifests/"
fi
aws eks $ENDPOINT_FLAG update-kubeconfig --name $(params.cluster-name) --region $(params.region)

export KUBECONFIG=$(workspaces.kubeconfig.path)/kubeconfig
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will be need to make changes to the EKS scale test pipeline before merging.


cat $(workspaces.source.path)/perf-tests/clusterloader2/testing/load/config.yaml
cd $(workspaces.source.path)/perf-tests/clusterloader2/
ENABLE_EXEC_SERVICE=false ./clusterloader --kubeconfig=/root/.kube/config --testconfig=$(workspaces.source.path)/perf-tests/clusterloader2/testing/load/config.yaml --testoverrides=$(workspaces.source.path)/overrides.yaml --nodes=$(params.nodes) --provider=eks --report-dir=$(workspaces.results.path) --alsologtostderr --v=2 $CL2_PROMETHEUS_FLAGS
ENABLE_EXEC_SERVICE=false ./clusterloader --testconfig=$(workspaces.source.path)/perf-tests/clusterloader2/testing/load/config.yaml --testoverrides=$(workspaces.source.path)/overrides.yaml --nodes=$(params.nodes) --provider=eks --report-dir=$(workspaces.results.path) --alsologtostderr --v=2 $CL2_PROMETHEUS_FLAGS
exit_code=$?
if [ $exit_code -eq 0 ]; then
echo "1" | tee $(results.datapoint.path)
Expand Down
Loading