-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add cl2 config to deploy kapinger
Signed-off-by: Alex Castilio dos Santos <[email protected]>
- Loading branch information
1 parent
298a7d6
commit 3e1a126
Showing
9 changed files
with
224 additions
and
4 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,35 @@ | ||
name: test | ||
namespace: | ||
number: 1 | ||
prefix: traffic | ||
tuningSets: | ||
- name: Uniform1qps | ||
qpsLoad: | ||
qps: 1 | ||
- name: Uniform500qps | ||
qpsLoad: | ||
qps: 500 | ||
steps: | ||
- name: Start measurements | ||
measurements: | ||
- Identifier: WaitForControlledPodsRunning | ||
Method: WaitForControlledPodsRunning | ||
Params: | ||
action: start | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
labelSelector: is-real = true | ||
operationTimeout: 120s | ||
- module: | ||
path: /traffic/kapinger.yaml | ||
params: | ||
namespace: traffic-1 | ||
tuningSet: Uniform500qps | ||
deployments: 10 | ||
podReplicas: 5 | ||
- name: Wait for pods to be running | ||
measurements: | ||
- Identifier: WaitForControlledPodsRunning | ||
Method: WaitForControlledPodsRunning | ||
Params: | ||
action: gather |
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,19 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
name: {{.Name}} | ||
labels: | ||
app: kapinger | ||
spec: | ||
policyTypes: | ||
- Ingress | ||
- Egress | ||
podSelector: | ||
matchLabels: | ||
shared-N: N | ||
unique-dep-label: "{{.Index}}" | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app: shared-{{???}} |
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,61 @@ | ||
## Kapinger module creates kapinger components | ||
|
||
# Namespaces where kapinger will be deployed to | ||
{{$namespace := DefaultParam .namespace "traffic-1"}} | ||
# Tuning set | ||
{{$tuningSet := DefaultParam .tuningSet "Uniform500qps"}} | ||
# Number of deployments | ||
{{$deployments := DefaultParam .deployments 1000}} | ||
# Number of pods per deploymen | ||
{{$podReplicas := DefaultParam .podReplicas 20}} | ||
|
||
steps: | ||
- name: Create service accounts | ||
phases: | ||
- namespaceList: | ||
- {{$namespace}} | ||
replicasPerNamespace: 1 | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger-sa | ||
objectTemplatePath: "traffic/kapinger/sa.yaml" | ||
- name: Create cluster role | ||
phases: | ||
- namespaceList: | ||
- "" | ||
replicasPerNamespace: 1 | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger-role | ||
objectTemplatePath: "traffic/kapinger/role.yaml" | ||
- name: Create cluster role binding | ||
phases: | ||
- namespaceList: | ||
- "" | ||
replicasPerNamespace: 1 | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger-rolebinding | ||
objectTemplatePath: "traffic/kapinger/rolebinding.yaml" | ||
templateFillMap: | ||
subjectNamespace: {{$namespace}} | ||
- name: Create deployments | ||
phases: | ||
- namespaceList: | ||
- {{$namespace}} | ||
replicasPerNamespace: {{$deployments}} | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger | ||
objectTemplatePath: "traffic/kapinger/deployment.yaml" | ||
templateFillMap: | ||
Replicas: {{$podReplicas}} | ||
- name: Create services | ||
phases: | ||
- namespaceList: | ||
- {{$namespace}} | ||
replicasPerNamespace: {{$deployments}} | ||
tuningSet: {{$tuningSet}} | ||
objectBundle: | ||
- basename: kapinger | ||
objectTemplatePath: "traffic/kapinger/svc.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,54 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{.Name}} | ||
labels: | ||
is-real: "true" | ||
spec: | ||
replicas: {{.Replicas}} | ||
selector: | ||
matchLabels: | ||
app: kapinger | ||
template: | ||
metadata: | ||
labels: | ||
app: kapinger | ||
is-real: "true" | ||
unique-dep-label: "{{.Index}}" | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
scale-test: "true" | ||
kubernetes.io/arch: amd64 | ||
affinity: | ||
podAntiAffinity: | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 100 | ||
podAffinityTerm: | ||
topologyKey: kubernetes.io/hostname | ||
labelSelector: | ||
matchLabels: | ||
app: kapinger | ||
serviceAccountName: kapinger-sa-0 | ||
containers: | ||
- image: acnpublic.azurecr.io/kapinger:20241014.7 | ||
name: kapinger | ||
resources: | ||
limits: | ||
memory: 80Mi | ||
requests: | ||
memory: 20Mi | ||
ports: | ||
- containerPort: 8080 | ||
env: | ||
- name: GODEBUG | ||
value: "netdns=go" | ||
- name: TARGET_TYPE | ||
value: "service" | ||
- name: HTTP_PORT | ||
value: "8080" | ||
- name: TCP_PORT | ||
value: "8085" | ||
- name: UDP_PORT | ||
value: "8086" | ||
|
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: ClusterRole | ||
metadata: | ||
name: kapinger-role | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
- pods | ||
verbs: | ||
- get | ||
- list |
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,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kapinger-rolebinding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kapinger-sa-0 | ||
namespace: {{.subjectNamespace}} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kapinger-role-0 |
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,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kapinger-sa |
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: | ||
name: {{.Name}} | ||
labels: | ||
app: kapinger | ||
spec: | ||
selector: | ||
app: kapinger | ||
unique-dep-label: "{{.Index}}" | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 |
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