Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: add yurtappset validation webhook and default nodepool label #1987

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift click to select a range
c719d41
refactor: avoid calling functions under k8s.io/kubernetes
vie-serendipity Mar 6, 2024
8cf34ec
feat: add yurtappset's support for statefulset
vie-serendipity Mar 7, 2024
ae08d24
feat: add support for replacement of {{nodepool}}
vie-serendipity Mar 7, 2024
25f998e
feat: add type label to nodepool
vie-serendipity Mar 7, 2024
6a1a364
feat: add validation webhook for yurtappset
vie-serendipity Mar 8, 2024
a229454
perf: improve the implementation of slowstartbatch
vie-serendipity Mar 8, 2024
62cc2d0
fix: only validate yurtappset spec
vie-serendipity Mar 11, 2024
20970cf
fix: deployment render should only manage workloads created by v1alph…
vie-serendipity Mar 11, 2024
8b7db71
feat: optimize SlowStartBatch
vie-serendipity Mar 12, 2024
4bf243c
feat: add validation for workload
vie-serendipity Mar 8, 2024
96996bc
chore: move apis validation
vie-serendipity Mar 13, 2024
598351c
feat: add yurtappset validation webhook
vie-serendipity Mar 20, 2024
cb8343f
chore: test
vie-serendipity Mar 20, 2024
245cbe0
chore: no tweaks
vie-serendipity Mar 20, 2024
de259bb
feat: revert slowstartbatch
vie-serendipity Mar 20, 2024
ffc5efa
Merge branch 'master' of github.com:vie-serendipity/openyurt into fea…
vie-serendipity Mar 20, 2024
37159d2
fix: deployment render should only mutate workloads created by yurtap…
vie-serendipity Mar 13, 2024
44d9807
feat: improve hostNetwork mode of NodePool by adding NodeAffinity to …
huangchenzhao Mar 13, 2024
f0a7445
feat: improve configuration of concurrent yurtappdaemon workers (#191…
huangchenzhao Mar 19, 2024
a0b35b9
feat: improve configuration of concurrent yurtappoverrider workers (#…
huangchenzhao Mar 19, 2024
b26990e
fix: go:gopkg.in/square/go-jose.v2:v2.6.0 is vulnerable Cxb6dee8d5-b8…
fengshunli Mar 19, 2024
324d789
improve filter manager in yurthub component
rambohe-ch Mar 18, 2024
fcbb22e
build(deps): bump github.com/go-resty/resty/v2 from 2.7.0 to 2.12.0
dependabot[bot] Mar 19, 2024
96b8888
feat: modify to {{nodepool-name}}
vie-serendipity Mar 20, 2024
991c689
chore: resolve conflicts
vie-serendipity Mar 20, 2024
8bd8c18
Merge branch 'feat/yurtappset-webhook' of github.com:vie-serendipity/…
vie-serendipity Mar 20, 2024
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
Prev Previous commit
Next Next commit
feat: improve configuration of concurrent yurtappdaemon workers (#1912)…
… (#1981)

Signed-off-by: Chenzhao Huang <[email protected]>
  • Loading branch information
huangchenzhao authored and vie-serendipity committed Mar 20, 2024
commit f0a74455e0e12f8f9540e697c9e4c582b8ed9cb8
7 changes: 5 additions & 2 deletions cmd/yurt-manager/app/options/yurtappdaemoncontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 28,9 @@ type YurtAppDaemonControllerOptions struct {

func NewYurtAppDaemonControllerOptions() *YurtAppDaemonControllerOptions {
return &YurtAppDaemonControllerOptions{
&config.YurtAppDaemonControllerConfiguration{},
&config.YurtAppDaemonControllerConfiguration{
ConcurrentYurtAppDaemonWorkers: 3,
},
}
}

Expand All @@ -39,14 41,15 @@ func (o *YurtAppDaemonControllerOptions) AddFlags(fs *pflag.FlagSet) {
}

//fs.BoolVar(&n.CreateDefaultPool, "create-default-pool", n.CreateDefaultPool, "Create default cloud/edge pools if indicated.")
fs.Int32Var(&o.ConcurrentYurtAppDaemonWorkers, "concurrent-yurtappdaemon-workers", o.ConcurrentYurtAppDaemonWorkers, "The number of yurtappdaemon objects that are allowed to reconcile concurrently. Larger number = more responsive yurtappdaemons, but more CPU (and network) load")
}

// ApplyTo fills up YurtAppDaemon config with options.
func (o *YurtAppDaemonControllerOptions) ApplyTo(cfg *config.YurtAppDaemonControllerConfiguration) error {
if o == nil {
return nil
}

cfg.ConcurrentYurtAppDaemonWorkers = o.ConcurrentYurtAppDaemonWorkers
return nil
}

Expand Down
1 change: 1 addition & 0 deletions pkg/yurtmanager/controller/yurtappdaemon/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 18,5 @@ package config

// YurtAppDaemonControllerConfiguration contains elements describing YurtAppDaemonController.
type YurtAppDaemonControllerConfiguration struct {
ConcurrentYurtAppDaemonWorkers int32
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 18,6 @@ package yurtappdaemon

import (
"context"
"flag"
"fmt"
"reflect"

Expand All @@ -45,8 44,7 @@ import (
)

var (
concurrentReconciles = 3
controllerResource = unitv1alpha1.SchemeGroupVersion.WithResource("yurtappdaemons")
controllerResource = unitv1alpha1.SchemeGroupVersion.WithResource("yurtappdaemons")
)

const (
Expand All @@ -60,10 58,6 @@ const (
eventTypeWorkloadsDeleted = "DeleteWorkload"
)

func init() {
flag.IntVar(&concurrentReconciles, "yurtappdaemon-workers", concurrentReconciles, "Max concurrent workers for YurtAppDaemon controller.")
}

func Format(format string, args ...interface{}) string {
s := fmt.Sprintf(format, args...)
return fmt.Sprintf("%s: %s", names.YurtAppDaemonController, s)
Expand All @@ -79,13 73,13 @@ func Add(ctx context.Context, c *config.CompletedConfig, mgr manager.Manager) er
}

klog.Infof("yurtappdaemon-controller add controller %s", controllerResource.String())
return add(mgr, newReconciler(mgr))
return add(mgr, c, newReconciler(mgr))
}

// add adds a new Controller to mgr with r as the reconcile.Reconciler
func add(mgr manager.Manager, r reconcile.Reconciler) error {
func add(mgr manager.Manager, cfg *config.CompletedConfig, r reconcile.Reconciler) error {
// Create a new controller
c, err := controller.New(names.YurtAppDaemonController, mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: concurrentReconciles})
c, err := controller.New(names.YurtAppDaemonController, mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: int(cfg.Config.ComponentConfig.YurtAppDaemonController.ConcurrentYurtAppDaemonWorkers)})
if err != nil {
return err
}
Expand Down