✗ kwokctl --help
kwokctl is a tool to streamline the creation and management of clusters, with nodes simulated by kwok
Usage:
kwokctl [command] [flags]
kwokctl [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
config Manage [reset, tidy, view] default config
create Creates one of [cluster]
delete Deletes one of [cluster]
etcdctl etcdctl in cluster
export Exports one of [logs]
get Gets one of [artifacts, clusters, components, kubeconfig]
hack [experimental] Hack [get, put, delete] resources in etcd without apiserver
help Help about any command
kubectl kubectl in cluster
logs Logs one of [audit, etcd, kube-apiserver, kube-controller-manager, kube-scheduler, kwok-controller, dashboard, metrics-server, prometheus, jaeger]
scale Scale a resource in cluster
snapshot Snapshot [save, restore, record, replay, export] one of cluster
start Start one of [cluster]
stop Stop one of [cluster]
Flags:
-c, --config strings config path (default [~/.kwok/kwok.yaml])
--dry-run Print the command that would be executed, but do not execute it
-h, --help help for kwokctl
--name string cluster name (default "kwok")
-v, --v log-level number for the log level verbosity (DEBUG, INFO, WARN, ERROR) or (-4, 0, 4, 8) (default INFO)
--version version for kwokctl
Use "kwokctl [command] --help" for more information about a command.
✗ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ec9ca844177f registry.k8s.io/kube-scheduler:v1.27.3 "kube-scheduler --co…" 5 days ago Up 4 minutes kwok-kwok-kube-scheduler
47064aa667ae registry.k8s.io/kwok/kwok:v0.6.0 "kwok --manage-all-n…" 5 days ago Up 4 minutes kwok-kwok-kwok-controller
a58c84571d22 registry.k8s.io/kube-controller-manager:v1.27.3 "kube-controller-man…" 5 days ago Up 4 minutes kwok-kwok-kube-controller-manager
dbbe08789990 registry.k8s.io/kube-apiserver:v1.27.3 "kube-apiserver --et…" 5 days ago Up 4 minutes 0.0.0.0:32766->6443/tcp kwok-kwok-kube-apiserver
86e17212af9a registry.k8s.io/etcd:3.5.11-0 "etcd --name=node0 -…" 5 days ago Up 4 minutes 2380/tcp, 4001/tcp, 7001/tcp, 0.0.0.0:32765->2379/tcp kwok-kwok-etcd
# scheduler/cmd/scheduler/config.go
// getWasmPluginsFromConfig parses the scheduler configuration specified with --config option,
// and return the wasm plugins enabled by the user.
func getWasmPluginsFromConfig() ([]string, error) {
// // In the scheduler, the path to the scheduler configuration is specified with --config option.
configFile := flag.String("config", "", "")
flag.Parse()
if *configFile == "" {
// Users don't have the own configuration. do nothing.
return nil, nil
}
cfg, err := loadConfigFromFile(*configFile)
if err != nil {
return nil, err
}
return getWasmPluginNames(cfg), nil
}
# scheduler/cmd/scheduler/config.go
import (
...
"k8s.io/kubernetes/cmd/kube-scheduler/app/options"
...
)
// getWasmPluginsFromConfig parses the scheduler configuration specified with --config option,
// and return the wasm plugins enabled by the user.
func getWasmPluginsFromConfig() ([]string, error) {
options := options.NewOptions()
configFile := options.ConfigFile
if configFile == "" {
// Users don't have the own configuration. do nothing.
return nil, nil
}
cfg, err := loadConfigFromFile(configFile)
if err != nil {
return nil, err
}
return getWasmPluginNames(cfg), nil
}
本来想着这次总该可以了吧,谁知道构建完镜像以后重新部署集群调度器还是起不来,又被打脸了。
问题二:kube-scheduler 容器启动还是会一直重启?
容器日志如下:
✗ docker logs cbc31a9ea658
I1018 08:15:58.370421 1 serving.go:348] Generated self-signed cert in-memory
W1018 08:15:59.374438 1 authentication.go:339] No authentication-kubeconfig provided in order to lookup client-ca-file in configmap/extension-apiserver-authentication in kube-system, so client certificate authentication won't work.
W1018 08:15:59.374545 1 authentication.go:363] No authentication-kubeconfig provided in order to lookup requestheader-client-ca-file in configmap/extension-apiserver-authentication in kube-system, so request-header client certificate authentication won't work.
W1018 08:15:59.374917 1 authorization.go:193] No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.
E1018 08:15:59.474846 1 run.go:74] "command failed" err="initializing profiles: creating profile for scheduler name default-scheduler: PreFilterPlugin \"NodeNumber\" does not exist"
✗ ./bin/kube-scheduler --help
...
Usage:
kube-scheduler [flags]
Misc flags:
--config string
The path to the configuration file.
--master string
The address of the Kubernetes API server (overrides any value in kubeconfig)
--write-config-to string
If set, write the configuration values to this file and exit.
Secure serving flags:
--bind-address ip
The IP addres
.....