Skip to content

Commit

Permalink
Merge pull request #722 from gary-lgy/kcc-canary
Browse files Browse the repository at this point in the history
feat(kcc): support kcc canary update
  • Loading branch information
xu282934741 authored Dec 3, 2024
2 parents e092a7c + 584d3d0 commit 5e4c267
Show file tree
Hide file tree
Showing 17 changed files with 2,363 additions and 1,355 deletions.
17 changes: 1 addition & 16 deletions cmd/katalyst-controller/app/controller/kcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,17 @@ func StartKCCController(ctx context.Context, controlCtx *katalystbase.GenericCon
conf.ControllersConfiguration.KCCConfig,
controlCtx.Client,
controlCtx.InternalInformerFactory.Config().V1alpha1().KatalystCustomConfigs(),
controlCtx.EmitterPool.GetDefaultMetricsEmitter(),
targetHandler,
)
if err != nil {
klog.Errorf("failed to new kcc target controller")
return false, err
}

cncController, err := kcc.NewCustomNodeConfigController(
ctx,
conf.GenericConfiguration,
conf.GenericControllerConfiguration,
conf.ControllersConfiguration.KCCConfig,
controlCtx.Client,
controlCtx.InternalInformerFactory.Config().V1alpha1().CustomNodeConfigs(),
controlCtx.EmitterPool.GetDefaultMetricsEmitter(),
targetHandler,
)
if err != nil {
klog.Errorf("failed to new cnc controller")
klog.Errorf("failed to new kcc target controller")
return false, err
}

go targetHandler.Run()
go kccController.Run()
go kccTargetController.Run()
go cncController.Run()
return true, nil
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/google/uuid v1.3.0
github.com/h2non/gock v1.2.0
github.com/klauspost/cpuid/v2 v2.2.6
github.com/kubewharf/katalyst-api v0.5.1-0.20240929080014-ae613a8935d8
github.com/kubewharf/katalyst-api v0.5.1-0.20241203040457-0e6060397f49
github.com/montanaflynn/stats v0.7.1
github.com/opencontainers/runc v1.1.6
github.com/opencontainers/selinux v1.10.0
Expand All @@ -33,7 +33,7 @@ require (
github.com/smartystreets/goconvey v1.6.4
github.com/spf13/cobra v1.6.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.3
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae
go.opentelemetry.io/otel v0.20.0
go.opentelemetry.io/otel/exporters/metric/prometheus v0.20.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubewharf/katalyst-api v0.5.1-0.20240929080014-ae613a8935d8 h1:rIwZVD4iia7pTiB6h1xR8muc4jx4GgHWzhVCPKlEhXw=
github.com/kubewharf/katalyst-api v0.5.1-0.20240929080014-ae613a8935d8/go.mod h1:Y2IeIorxQamF2a3oa0+URztl5QCSty6Jj3zD83R8J9k=
github.com/kubewharf/katalyst-api v0.5.1-0.20241203040457-0e6060397f49 h1:PLnLeykxt0ejuYZqjLlrbutZ/GYv6Q3ZUcFQsUH/my4=
github.com/kubewharf/katalyst-api v0.5.1-0.20241203040457-0e6060397f49/go.mod h1:Y2IeIorxQamF2a3oa0+URztl5QCSty6Jj3zD83R8J9k=
github.com/kubewharf/kubelet v1.24.6-kubewharf.9 h1:jOTYZt7h/J7I8xQMKMUcJjKf5UFBv37jHWvNp5VRFGc=
github.com/kubewharf/kubelet v1.24.6-kubewharf.9/go.mod h1:MxbSZUx3wXztFneeelwWWlX7NAAStJ6expqq7gY2J3c=
github.com/kyoh86/exportloopref v0.1.7/go.mod h1:h1rDl2Kdj97+Kwh4gdz3ujE7XHmH51Q0lUiZ1z4NLj8=
Expand Down Expand Up @@ -879,8 +879,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
Expand Down
10 changes: 5 additions & 5 deletions pkg/consts/kcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ limitations under the License.

package consts

// KatalystCustomConfigAnnotationKeyConfigHash defines const variables for kcc annotations about config hash.
const (
KatalystCustomConfigAnnotationKeyConfigHash = "kcc.katalyst.kubewharf.io/config.hash"
)

// KatalystCustomConfigFinalizerKCC defines const variables for kcc finalizer
const (
KatalystCustomConfigFinalizerKCC = "kcc.katalyst.kubewharf.io/kcc-controller"
Expand All @@ -40,6 +35,11 @@ const (
KCCTargetConfFieldEphemeralSelector = "ephemeralSelector"
KCCTargetConfFieldNameRevisionHistoryLimit = "revisionHistoryLimit"
KCCTargetConfFieldNameConfig = "config"
KCCTargetConfFieldNamePaused = "paused"

KCCTargetConfFieldNameUpdateStrategy = "updateStrategy"
KCCTargetConfFieldNameRollingUpdate = "rollingUpdate"
KCCTargetConfFieldNameCanary = "canary"

KCCTargetConfFieldNameNodeNames = "nodeNames"
KCCTargetConfFieldNameLastDuration = "lastDuration"
Expand Down
Loading

0 comments on commit 5e4c267

Please sign in to comment.