Skip to content

Instantly share code, notes, and snippets.

View Huang-Wei's full-sized avatar

Wei Huang Huang-Wei

View GitHub Profile
@Huang-Wei
Huang-Wei / pod-topology-spread-deploy.yaml
Created January 11, 2024 21:57
pod-topology-spread-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: pause
spec:
replicas: 8
selector:
matchLabels:
app: pause
template:
@Huang-Wei
Huang-Wei / replay.log
Created September 22, 2023 06:12
reproduce YuniKorn issue
- T0: add queue `root.weihuang` to yunikorn-configs:
```yaml
apiVersion: v1
data:
queues.yaml: |
partitions:
- name: default
queues:
- name: root
submitacl: '*'
@Huang-Wei
Huang-Wei / scheduler-config.yaml
Last active August 10, 2023 16:29
optimized v1beta2 scheduler yunikorn config
apiVersion: kubescheduler.config.k8s.io/v1beta1
kind: KubeSchedulerConfiguration
leaderElection:
leaderElect: false
profiles:
- schedulerName: default-scheduler
- schedulerName: yunikorn
plugins:
preFilter:
enabled:
@Huang-Wei
Huang-Wei / sched-plugin-559.diff
Created July 11, 2023 20:00
sched-plugin-559.diff
diff --git a/apis/config/scheme/scheme_test.go b/apis/config/scheme/scheme_test.go
index 74ce7410..76838531 100644
--- a/apis/config/scheme/scheme_test.go
+++ b/apis/config/scheme/scheme_test.go
@@ -472,6 +472,7 @@ kind: KubeSchedulerConfiguration
profiles:
- schedulerName: scheduler-plugins
pluginConfig:
+ - name: Coscheduling # Test argument defaulting logic
- name: TopologicalSort
@Huang-Wei
Huang-Wei / 116395-perf-test.out
Created March 9, 2023 00:05
116395-perf-test.out
weih@m1max:~/go/src/k8s.io/kubernetes|pr/116395 ⇒ go test -v -timeout=0 -bench=".*/PreemptionBasic" -race -short=true -benchtime=1ns ./test/integration/scheduler_perf
goos: darwin
goarch: arm64
pkg: k8s.io/kubernetes/test/integration/scheduler_perf
BenchmarkPerfScheduling
BenchmarkPerfScheduling/PreemptionBasic
BenchmarkPerfScheduling/PreemptionBasic/500Nodes
scheduler_perf_test.go:1064: creating 2000 pods in namespace "namespace-1"
scheduler_perf_test.go:1089: namespace: namespace-1, pods: want 2000, got 221
scheduler_perf_test.go:1089: namespace: namespace-1, pods: want 2000, got 381
@Huang-Wei
Huang-Wei / k8s-api-with-map.out
Created December 16, 2022 00:03
Search definition of `map` in Kubernetes API
staging/src/k8s.io/api/admission/v1/types.go
142: AuditAnnotations map[string]string `json:"auditAnnotations,omitempty" protobuf:"bytes,6,opt,name=auditAnnotations"`
staging/src/k8s.io/api/core/v1/types.go
1113: Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"`
1139: Options map[string]string `json:"options,omitempty" protobuf:"bytes,5,rep,name=options"`
1800: VolumeAttributes map[string]string `json:"volumeAttributes,omitempty" protobuf:"bytes,5,rep,name=volumeAttributes"`
1864: VolumeAttributes map[string]string `json:"volumeAttributes,omitempty" protobuf:"bytes,4,rep,name=volumeAttributes"`
3191: NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"`
4200: Selector map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
@Huang-Wei
Huang-Wei / 432-review.diff
Created December 6, 2022 17:57
432-review.diff
diff --git a/manifests/appgroup/crd.yaml b/manifests/appgroup/crd.yaml
index 955c93b..87af78a 100644
--- a/manifests/appgroup/crd.yaml
+++ b/manifests/appgroup/crd.yaml
@@ -22,7 +22,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
- description: AppGroup is a collection of Pods belonging to the same application
+ description: AppGroup is a collection of Pods belonging to the same application.
@Huang-Wei
Huang-Wei / tryout-pod-readiness-gates.md
Created September 29, 2022 19:30
tryout-pod-readiness-gates.md

Create a KindD cluster

kind create cluster --image kindest/node:v1.25.2

Prepare a Pod yaml with a custom readiness gate

apiVersion: v1
kind: Pod
metadata:
@Huang-Wei
Huang-Wei / review-111775.diff
Created August 16, 2022 01:01
review-111775.diff
diff --git a/pkg/scheduler/schedule_one.go b/pkg/scheduler/schedule_one.go
index 7ff7fa6d08b..3336f8a9584 100644
--- a/pkg/scheduler/schedule_one.go
+++ b/pkg/scheduler/schedule_one.go
@@ -95,9 +95,8 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
schedulingCycleCtx, cancel := context.WithCancel(ctx)
defer cancel()
- scheduleResult, podInfo, reason, nominatingInfo, err := sched.schedulingCycle(schedulingCycleCtx, state, fwk, podInfo, podsToActivate, start)
+ scheduleResult, err := sched.schedulingCycle(schedulingCycleCtx, state, fwk, podInfo, podsToActivate, start)