k8s:配置启动参数时,一个小小的技巧提示:参数是可以多次指定的,以最后指定的为准

参数是可以多次指定的,以【最后】指定的为准!

参数是可以多次指定的,以【最后】指定的为准!

参数是可以多次指定的,以【最后】指定的为准!

 

 

例子:多次指定同一个参数,最后的配置项是正确的

kube-scheduler \
  --kubeconfig=/root/tls/kubeconfig.yaml \
  --master=https://192.168.208.200:6443 \
  --master=https://192.168.208.201:6443 \
  --master=https://192.168.208.202:6443 \
  --master=https://192.168.208.203:6443 \
A203:~# kube-scheduler \
>   --kubeconfig=/root/tls/kubeconfig.yaml \
>   --master=https://192.168.208.200:6443 \
>   --master=https://192.168.208.201:6443 \
>   --master=https://192.168.208.202:6443 \
>   --master=https://192.168.208.203:6443 \
> 
I1121 01:27:15.031043   57473 serving.go:348] Generated self-signed cert in-memory
W1121 01:27:15.456518   57473 authentication.go:317] 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.
W1121 01:27:15.456570   57473 authentication.go:341] 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.
W1121 01:27:15.456877   57473 authorization.go:194] No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.
I1121 01:27:15.469809   57473 server.go:148] "Starting Kubernetes Scheduler" version="v1.25.3"
I1121 01:27:15.469853   57473 server.go:150] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK=""
I1121 01:27:15.471114   57473 secure_serving.go:210] Serving securely on [::]:10259
I1121 01:27:15.472360   57473 tlsconfig.go:240] "Starting DynamicServingCertificateController"
I1121 01:27:15.571629   57473 leaderelection.go:248] attempting to acquire leader lease kube-system/kube-scheduler...
I1121 01:27:15.575434   57473 leaderelection.go:258] successfully acquired lease kube-system/kube-scheduler
... ...

 

 

例子:多次指定同一个参数,最后的配置项是错误的

kube-scheduler \
  --kubeconfig=/root/tls/kubeconfig.yaml \
  --master=https://192.168.208.200:6443 \
  --master=https://192.168.208.202:6443 \
  --master=https://192.168.208.203:6443 \
  --master=https://192.168.208.201:6443 \
A203:~# kube-scheduler \
>   --kubeconfig=/root/tls/kubeconfig.yaml \
>   --master=https://192.168.208.200:6443 \
>   --master=https://192.168.208.202:6443 \
>   --master=https://192.168.208.203:6443 \
>   --master=https://192.168.208.201:6443 \
> 
I1121 01:22:47.276411   57410 serving.go:348] Generated self-signed cert in-memory
W1121 01:22:47.668727   57410 authentication.go:317] 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.
W1121 01:22:47.668767   57410 authentication.go:341] 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.
W1121 01:22:47.668810   57410 authorization.go:194] No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.
I1121 01:22:47.674452   57410 server.go:148] "Starting Kubernetes Scheduler" version="v1.25.3"
I1121 01:22:47.674491   57410 server.go:150] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK=""
I1121 01:22:47.675703   57410 secure_serving.go:210] Serving securely on [::]:10259
I1121 01:22:47.675802   57410 tlsconfig.go:240] "Starting DynamicServingCertificateController"
W1121 01:22:47.676669   57410 reflector.go:424] vendor/k8s.io/client-go/informers/factory.go:134: failed to list *v1.CSINode: Get "https://192.168.208.201:6443/apis/storage.k8s.io/v1/csinodes?limit=500&resourceVersion=0": dial tcp 192.168.208.201:6443: connect: connection refused
E1121 01:22:47.676836   57410 reflector.go:140] vendor/k8s.io/client-go/informers/factory.go:134: Failed to watch *v1.CSINode: failed to list *v1.CSINode: Get "https://192.168.208.201:6443/apis/storage.k8s.io/v1/csinodes?limit=500&resourceVersion=0": dial tcp 192.168.208.201:6443: connect: connection refused
... ...

 

posted on 2022-11-21 09:20  jinzhenshui  阅读(573)  评论(0)    收藏  举报