Skip to content

Commit

Permalink
allows for image repos to be set via command line
Browse files Browse the repository at this point in the history
    - useful when using a mirrored repo or no access to upstream repos
  • Loading branch information
Eric Hernandez committed Jun 5, 2024
1 parent c6214d6 commit 6221176
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion clusterloader2/testing/load/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
{{$EXEC_TIMEOUT := DefaultParam .CL2_EXEC_TIMEOUT "3600s"}}
{{$SLEEP_AFTER_EXEC_DURATION := DefaultParam .CL2_SLEEP_AFTER_EXEC_DURATION "0s"}}

{{$latencyPodImage := DefaultParam .CL2_LATENCY_POD_IMAGE "registry.k8s.io/pause:3.9"}}
{{$latencyPodImage := DefaultParam .CL2_LATENCY_POD_IMAGE "$registryK8sRepo/pause:3.9"}}
{{$defaultQps := DefaultParam .CL2_DEFAULT_QPS (IfThenElse (le .Nodes 500) 10 100)}}

{{$ADDITIONAL_MEASUREMENT_MODULES := DefaultParam .CL2_ADDITIONAL_MEASUREMENT_MODULES nil}}
Expand Down
3 changes: 1 addition & 2 deletions clusterloader2/testing/load/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{$HostNetworkMode := DefaultParam .CL2_USE_HOST_NETWORK_PODS false}}
{{$Image := DefaultParam .Image "registry.k8s.io/pause:3.9"}}
{{$Env := DefaultParam .Env ""}}
{{$DaemonSetSurge := DefaultParam .CL2_DS_SURGE (MaxInt 10 (DivideInt .Nodes 20))}} # 5% of nodes, but not less than 10
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}
Expand Down Expand Up @@ -29,7 +28,7 @@ spec:
hostNetwork: {{$HostNetworkMode}}
containers:
- name: {{.Name}}
image: {{$Image}}
image: {{.RegistryK8sRepo}}/pause:3.9
env:
- name: TEST_ENV
value: {{$Env}}
Expand Down
6 changes: 3 additions & 3 deletions clusterloader2/testing/load/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ spec:
containers:
{{if .EnableDNSTests}}
{{if $USE_ADVANCED_DNSTEST}}
- image: gcr.io/k8s-staging-perf-tests/dnsperfgo:v1.4.0
- image: {{.GcrRepo}}/k8s-staging-perf-tests/dnsperfgo:v1.4.0
ports:
- containerPort: 9153
name: dnsperfmetrics
protocol: TCP
{{else}}
- image: gcr.io/k8s-staging-perf-tests/dnsperfgo:v1.2.0
- image: {{.GcrRepo}}/k8s-staging-perf-tests/dnsperfgo:v1.2.0
{{end}}
# Fetches the dns server from /etc/resolv.conf and
# sends 1 query per second.
Expand All @@ -72,7 +72,7 @@ spec:
ports:
- containerPort: 80
{{else}}
- image: registry.k8s.io/pause:3.9
- image: {{.RegistryK8sRepo}}/pause:3.9
name: {{.Name}}
{{end}}
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/testing/load/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
containers:
- name: {{.Name}}
# TODO(#799): We should test the "run-to-completion" workflow and hence don't use pause pods.
image: registry.k8s.io/pause:3.9
image: {{.RegistryK8sRepo}}/pause:3.9
resources:
# Keep the CpuRequest/MemoryRequest request equal percentage of 1-core, 4GB node.
# For now we're setting it to 0.5%.
Expand Down
16 changes: 15 additions & 1 deletion clusterloader2/testing/load/modules/reconcile-objects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{$operationTimeout := .operationTimeout}}

# DaemonSets
{{$daemonSetImage := DefaultParam .daemonSetImage "registry.k8s.io/pause:3.9"}}
{{$daemonSetImage := DefaultParam .daemonSetImage "$registryK8sRepo/pause:3.9"}}
{{$daemonSetReplicas := .daemonSetReplicas}}
{{$daemonSetEnv := .daemonSetEnv}}

Expand Down Expand Up @@ -55,6 +55,10 @@
{{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_VALUE := DefaultParam .CL2_NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_VALUE "enforcement-latency"}}
{{$NET_POLICY_SERVER_EVERY_NTH_POD := DefaultParam .CL2_NET_POLICY_SERVER_EVERY_NTH_POD 3}}

## Image Repositories
{{$registryK8sRepo := DefaultParam .CL2_REGISTRY_K8S_REPO "registry.k8s.io"}}
{{$gcrRepo := DefaultParam .CL2_GCR_REPO "gcr.io"}}

steps:
- name: Starting measurement for '{{$actionName}}'
measurements:
Expand Down Expand Up @@ -96,6 +100,7 @@ steps:
templateFillMap:
Image: {{$daemonSetImage}}
Env: {{$daemonSetEnv}}
RegistryK8sRepo: {{$registryK8sRepo}}
{{end}}
- namespaceRange:
min: 1
Expand All @@ -115,6 +120,7 @@ steps:
ReplicasMin: {{MultiplyInt $bigDeploymentSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $bigDeploymentSize $maxReplicaFactor}}
SvcName: big-service
RegistryK8sRepo: {{$registryK8sRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -132,6 +138,7 @@ steps:
ReplicasMin: {{MultiplyInt $mediumDeploymentSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $mediumDeploymentSize $maxReplicaFactor}}
SvcName: medium-service
RegistryK8sRepo: {{$registryK8sRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -154,6 +161,8 @@ steps:
TargetLabelKey: {{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_KEY}}
TargetLabelValue: {{$NET_POLICY_ENFORCEMENT_LATENCY_TARGET_LABEL_VALUE}}
NetPolServerOnEveryNthPod: {{$NET_POLICY_SERVER_EVERY_NTH_POD}}
RegistryK8sRepo: {{$registryK8sRepo}}
GcrRepo: {{$gcrRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -167,6 +176,7 @@ steps:
templateFillMap:
ReplicasMin: {{MultiplyInt $smallStatefulSetSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $smallStatefulSetSize $maxReplicaFactor}}
RegistryK8sRepo: {{$registryK8sRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -180,6 +190,7 @@ steps:
templateFillMap:
ReplicasMin: {{MultiplyInt $mediumStatefulSetSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $mediumStatefulSetSize $maxReplicaFactor}}
RegistryK8sRepo: {{$registryK8sRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -192,6 +203,7 @@ steps:
Completions: {{MultiplyInt $smallJobSize $completionsFactor}}
ReplicasMin: {{MultiplyInt $smallJobSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $smallJobSize $maxReplicaFactor}}
RegistryK8sRepo: {{$registryK8sRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -204,6 +216,7 @@ steps:
Completions: {{MultiplyInt $mediumJobSize $completionsFactor}}
ReplicasMin: {{MultiplyInt $mediumJobSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $mediumJobSize $maxReplicaFactor}}
RegistryK8sRepo: {{$registryK8sRepo}}
- namespaceRange:
min: 1
max: {{$namespaces}}
Expand All @@ -216,6 +229,7 @@ steps:
Completions: {{MultiplyInt $bigJobSize $completionsFactor}}
ReplicasMin: {{MultiplyInt $bigJobSize $minReplicaFactor}}
ReplicasMax: {{MultiplyInt $bigJobSize $maxReplicaFactor}}
RegistryK8sRepo: {{$registryK8sRepo}}
{{if and $is_deleting $ENABLE_PVS}}
- namespaceRange:
min: 1
Expand Down
3 changes: 1 addition & 2 deletions clusterloader2/testing/load/simple-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{{$CpuRequest := DefaultParam .CpuRequest "5m"}}
{{$EnvVar := DefaultParam .EnvVar "a"}}
{{$MemoryRequest := DefaultParam .MemoryRequest "20M"}}
{{$Image := DefaultParam .Image "registry.k8s.io/pause:3.9"}}
{{$RUN_ON_ARM_NODES := DefaultParam .CL2_RUN_ON_ARM_NODES false}}

apiVersion: apps/v1
Expand Down Expand Up @@ -32,7 +31,7 @@ spec:
- env:
- name: ENV_VAR
value: {{$EnvVar}}
image: {{$Image}}
image: {{.RegistryK8sRepo}}/pause:3.9
imagePullPolicy: IfNotPresent
name: {{.Name}}
ports:
Expand Down
2 changes: 1 addition & 1 deletion clusterloader2/testing/load/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
hostNetwork: {{$HostNetworkMode}}
containers:
- name: {{.Name}}
image: registry.k8s.io/pause:3.9
image: {{.RegistryK8sRepo}}/pause:3.9
ports:
- containerPort: 80
name: web
Expand Down

0 comments on commit 6221176

Please sign in to comment.