Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9d4809e
Add workload identity webhook benchmark pipeline
liyu-ma Oct 29, 2026
fc3ba51
Simplify WI webhook benchmark and add shared kperf runner
liyu-ma Oct 29, 2026
df48460
Restore aks-preview before H2 cluster creation
liyu-ma Oct 29, 2026
325191b
Simplify kperf runner and reduce WI benchmark traffic
liyu-ma Oct 30, 2026
02eb514
Simplify WI identity setup and enlarge system nodes
liyu-ma Oct 30, 2026
353a6ef
Support existing WI benchmark clusters and enable Prometheus
liyu-ma Oct 30, 2026
76e0089
Run WI benchmark at three sequential traffic rates
liyu-ma Nov 2, 2026
46b9c16
Create Prometheus workspace with benchmark cluster resources
liyu-ma Nov 2, 2026
24bb3a2
Use per-rate namespaces for WI benchmark cleanup
liyu-ma Nov 3, 2026
6a30f94
Use 50/100/150 RPS for WI webhook benchmark
liyu-ma Nov 3, 2026
410eec2
Refactor WI benchmark steps and reuse reporting helpers
liyu-ma Nov 3, 2026
32fb912
Simplify WI benchmark provisioning and cleanup
liyu-ma Nov 3, 2026
cf314f7
Remove managed Prometheus setup from WI benchmark
liyu-ma Nov 3, 2026
bdd7a1c
Minor change
liyu-ma Nov 3, 2026
6053571
Wait for WI benchmark namespace cleanup without blocking on failure
liyu-ma Nov 4, 2026
8e8bcd1
Remove unused user pool from WI webhook benchmark
liyu-ma Nov 4, 2026
e124911
Address review comments
liyu-ma Nov 5, 2026
e03fe08
Use runner groups for WI webhook benchmark
liyu-ma Nov 5, 2026
63349c3
Add resilient runner-group result collection helper
liyu-ma Nov 5, 2026
f79e0b5
Add 200 RPS phase to WI webhook benchmark
liyu-ma Nov 5, 2026
f822b3a
Update WI webhook benchmark rates to 100/150/200/250 RPS
liyu-ma Nov 5, 2026
2b14363
Use official kperf 0.3.7 for WI benchmark
liyu-ma Nov 6, 2026
a074c1b
Update comment
liyu-ma Nov 6, 2026
e18bf45
Use default WI benchmark cleanup conditions and cancel timeout
liyu-ma Nov 13, 2026
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
4 changes: 2 additions & 2 deletions kcl/lib/steps/kperf/run_benchmark.k
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ done

# RunKperfRunnerGroup runs `kperf rg run` with the specified runner image, runner
# group manifest, optional flow control setting, and optional affinity selector.
RunKperfRunnerGroup = lambda runnerImage: str, runnerGroup: str, flowcontrol: str = "", affinity: str = "", target: str = Undefined -> steps.Step {
RunKperfRunnerGroup = lambda runnerImage: str, runnerGroup: str, flowcontrol: str = "", affinity: str = "", target: str = Undefined, displayName: str = "Run kperf runner group" -> steps.Step {
steps.Script {
script = """
set -euo pipefail
Expand Down Expand Up @@ -94,7 +94,7 @@ until run_rg; do
sleep 120
done
"""
displayName = "Run kperf runner group"
displayName = displayName
target = target
}
}
179 changes: 179 additions & 0 deletions kcl/workload_identity_webhook/pipeline.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
import azure_pipelines.ap
import azure_pipelines.ap.jobs.job
import azure_pipelines.ap.steps
import lib.const
import lib.steps.azure
import lib.steps.common
import lib.steps.kperf
import lib.util.asi_dashboard

SUBSCRIPTION_ID = "b8ceb4e5-f05b-4562-a9f5-14acb1f24219"
LOCATION = "australiaeast"
RUNNER_IMAGE = "ghcr.io/azure/kperf:0.3.7"
RATES = [100, 150, 200, 250]

RunBenchmark = lambda rate: int -> [steps.Step] {
[
steps.Bash {
bash = """
set -euo pipefail
namespace="$(RUN_ID)-r${rate}"
kubectl create namespace "$namespace" --dry-run=client -o yaml | kubectl --request-timeout=60s apply -f -
kubectl create serviceaccount pod-benchmark --namespace "$namespace" --dry-run=client -o yaml | kubectl --request-timeout=60s apply -f -
# Use a fake client ID because benchmark Pods do not access Azure resources.
kubectl --request-timeout=60s annotate serviceaccount pod-benchmark \\
--namespace "$namespace" \\
"azure.workload.identity/client-id=00000000-0000-4000-8000-000000000001" \\
--overwrite
"""
displayName = "Prepare WI resources for ${rate}/sec"
},
steps.Bash {
bash = """
set -euo pipefail
profile="$(Agent.TempDirectory)/$(RUN_ID)-r${rate}-runner-group.yaml"
sed \\
-e 's/__RUN_NAMESPACE__/$(RUN_ID)-r${rate}/g' \\
-e 's/__RATE__/${rate}/g' \\
-e 's/__PHASE_RUN_ID__/$(RUN_ID)-r${rate}/g' \\
"$(Build.SourcesDirectory)/kcl/workload_identity_webhook/runner-group.yaml" > "$profile"
if grep -q '__[A-Z_]*__' "$profile"; then
echo "Unresolved runner-group placeholders" >&2
exit 1
fi
"""
displayName = "Prepare ${rate}/sec runner group"
},
kperf.RunKperfRunnerGroup(
RUNNER_IMAGE,
"file://$(Agent.TempDirectory)/$(RUN_ID)-r${rate}-runner-group.yaml",
affinity="agentpool=runner",
displayName="Run kperf runner group at ${rate} CREATEs/sec"),
kperf.FetchKperfRunnerGroupResult(
displayName="Wait for ${rate}/sec runner group result"),
steps.Bash {
bash = """
set -euo pipefail
kubectl delete namespace "$(RUN_ID)-r${rate}" \\
--ignore-not-found=true \\
--wait=true
echo "Namespace cleanup completed for ${rate}/sec phase at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
"""
displayName = "Delete namespace from ${rate}/sec run"
continueOnError = True
timeoutInMinutes = 15
},
steps.Bash {
bash = """
set -euo pipefail
echo "Starting five-minute pause after ${rate}/sec phase at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
sleep 300
echo "Finished pause after ${rate}/sec phase at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
"""
displayName = "Pause 5 minutes after kperf run"
timeoutInMinutes = 6
},
]
}

output = ap.Pipeline {
name = "Workload Identity Webhook Benchmark"
trigger = "none"
pr = "none"
pool = const.DEFAULT_POOL
parameters = [
ap.Parameter {
name = "keep_cluster"
displayName = "Keep cluster after benchmark (phase namespaces are deleted)"
type = "boolean"
default = False
},
]
jobs = [
job.Job {
job = "benchmark"
displayName = "Baseline Run: 100/150/200/250 RPS"
timeoutInMinutes = 240
variables = {
RESOURCE_GROUP = "$(RUN_ID)"
CLUSTER = "wi-webhook"
}
steps = [
common.SetRunId(),
azure.Login(
const.DEFAULT_SERVICE_CONNECTION,
SUBSCRIPTION_ID,
LOCATION),
azure.CreateResourceGroup(
const.DEFAULT_SERVICE_CONNECTION,
"$(RESOURCE_GROUP)",
LOCATION,
SUBSCRIPTION_ID),
azure.AzCli(
const.DEFAULT_SERVICE_CONNECTION,
"Create H2 cluster with OIDC and workload identity",
"""
az extension add \\
--name aks-preview \\
--version 21.0.0b17 \\
--allow-preview true \\
--yes
az aks create \\
--subscription "${SUBSCRIPTION_ID}" \\
--resource-group "$(RESOURCE_GROUP)" \\
--name "$(CLUSTER)" \\
--location "${LOCATION}" \\
--kubernetes-version "1.36" \\
--dns-name-prefix "$(RUN_ID)" \\
--tier standard \\
--control-plane-scaling-size H2 \\
--enable-oidc-issuer \\
--enable-workload-identity \\
--generate-ssh-keys \\
--nodepool-name systempool \\
--node-count 3 \\
--node-vm-size Standard_D4_v4 \\
--max-pods 50 \\
--network-plugin azure \\
--network-plugin-mode overlay \\
--pod-cidr 10.64.0.0/10 \\
--service-cidr 10.0.0.0/16 \\
--dns-service-ip 10.0.0.10 \\
--outbound-type managedNATGateway \\
--nat-gateway-managed-outbound-ip-count 10 \\
--tags SkipAKSCluster=true \\
--yes
"""),
azure.CreateNodePool(
const.DEFAULT_SERVICE_CONNECTION,
"$(CLUSTER)",
"$(RESOURCE_GROUP)",
SUBSCRIPTION_ID,
azure.NodePool {
name = "runner"
sku = "Standard_D4s_v5"
count = 1
}),
azure.GetCredentials(
const.DEFAULT_SERVICE_CONNECTION,
"$(CLUSTER)",
"$(RESOURCE_GROUP)",
SUBSCRIPTION_ID),
kperf.InstallRunkperf(RUNNER_IMAGE),
common.RecordCurrentTime("BENCHMARK_START_TIME"),
*[step for rate in RATES for step in RunBenchmark(rate)],
asi_dashboard.PrintAsiDashboardUrl(
const.DEFAULT_SERVICE_CONNECTION,
"$(CLUSTER)",
"$(RESOURCE_GROUP)",
SUBSCRIPTION_ID,
startTime="$(BENCHMARK_START_TIME)"),
azure.DeleteResourceGroup(
const.DEFAULT_SERVICE_CONNECTION,
"$(RESOURCE_GROUP)",
SUBSCRIPTION_ID,
condition="and(always(), not(\${{ parameters.keep_cluster }}))"),
]
},
]
}
Loading
Loading