溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

如何進行external-provisioner組件的啟動參數(shù)進行分析

發(fā)布時間:2022-01-12 16:05:22 來源:億速云 閱讀:203 作者:柒染 欄目:云計算

這篇文章跟大家分析一下“如何進行external-provisioner組件的啟動參數(shù)進行分析”。內(nèi)容詳細易懂,對“如何進行external-provisioner組件的啟動參數(shù)進行分析”感興趣的朋友可以跟著小編的思路慢慢深入來閱讀一下,希望閱讀后能夠?qū)Υ蠹矣兴鶐椭O旅娓【幰黄鹕钊雽W習“如何進行external-provisioner組件的啟動參數(shù)進行分析”的知識吧。

external-provisioner組件啟動參數(shù)列表

具體參考https://github.com/kubernetes-csi/external-provisioner#command-line-options

var (
	master               = flag.String("master", "", "Master URL to build a client config from. Either this or kubeconfig needs to be set if the provisioner is being run out of cluster.")
	kubeconfig           = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Either this or master needs to be set if the provisioner is being run out of cluster.")
	csiEndpoint          = flag.String("csi-address", "/run/csi/socket", "The gRPC endpoint for Target CSI Volume.")
	_                    = deprecatedflags.Add("connection-timeout")
	volumeNamePrefix     = flag.String("volume-name-prefix", "pvc", "Prefix to apply to the name of a created volume.")
	volumeNameUUIDLength = flag.Int("volume-name-uuid-length", -1, "Truncates generated UUID of a created volume to this length. Defaults behavior is to NOT truncate.")
	showVersion          = flag.Bool("version", false, "Show version.")
	retryIntervalStart   = flag.Duration("retry-interval-start", time.Second, "Initial retry interval of failed provisioning or deletion. It doubles with each failure, up to retry-interval-max.")
	retryIntervalMax     = flag.Duration("retry-interval-max", 5*time.Minute, "Maximum retry interval of failed provisioning or deletion.")
	workerThreads        = flag.Uint("worker-threads", 100, "Number of provisioner worker threads, in other words nr. of simultaneous CSI calls.")
	finalizerThreads     = flag.Uint("cloning-protection-threads", 1, "Number of simultaniously running threads, handling cloning finalizer removal")
	operationTimeout     = flag.Duration("timeout", 10*time.Second, "Timeout for waiting for creation or deletion of a volume")
	_                    = deprecatedflags.Add("provisioner")

	enableLeaderElection    = flag.Bool("enable-leader-election", false, "Enables leader election. If leader election is enabled, additional RBAC rules are required. Please refer to the Kubernetes CSI documentation for instructions on setting up these RBAC rules.")
	leaderElectionType      = flag.String("leader-election-type", "endpoints", "the type of leader election, options are 'endpoints' (default) or 'leases' (strongly recommended). The 'endpoints' option is deprecated in favor of 'leases'.")
	leaderElectionNamespace = flag.String("leader-election-namespace", "", "Namespace where the leader election resource lives. Defaults to the pod namespace if not set.")
	strictTopology          = flag.Bool("strict-topology", false, "Passes only selected node topology to CreateVolume Request, unlike default behavior of passing aggregated cluster topologies that match with topology keys of the selected node.")
	extraCreateMetadata     = flag.Bool("extra-create-metadata", false, "If set, add pv/pvc metadata to plugin create requests as parameters.")

	metricsAddress = flag.String("metrics-address", "", "The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled.")
	metricsPath    = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
	
	featureGates        map[string]bool
	provisionController *controller.ProvisionController
	version             = "unknown"

)

func main() {
	var config *rest.Config
	var err error

	flag.Var(utilflag.NewMapStringBool(&featureGates), "feature-gates", "A set of key=value pairs that describe feature gates for alpha/experimental features. "+
		"Options are:\n"+strings.Join(utilfeature.DefaultFeatureGate.KnownFeatures(), "\n"))

	klog.InitFlags(nil)
	flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
	flag.Set("logtostderr", "true")
	flag.Parse()
	
......
external-provisioner容器部署的啟動參數(shù)配置
    ...
    args:
        - "--csi-address=$(ADDRESS)"
        - "--v=5"
        - "--timeout=150s"
        - "--retry-interval-start=500ms"
        - "--enable-leader-election=true"
        - "--leader-election-type=leases"
        - "--feature-gates=Topology=true"
    env:
        - name: ADDRESS
            value: unix:///csi/csi-provisioner.sock
    imagePullPolicy: "Always"
    volumeMounts:
    - name: socket-dir
      mountPath: /csi
  volumes:
  - name: socket-dir
    emptyDir: {
      medium: "Memory"
    }
  ...

下面是部分參數(shù)解析。其他參數(shù)請參考:https://github.com/kubernetes-csi/external-provisioner#command-line-options

csi-address

ceph-csi組件暴露的grpc服務(wù)socket地址,external-provisioner組件將與該socket地址通信,發(fā)出創(chuàng)建、刪除存儲的請求。默認值為/run/csi/socket。

timeout

創(chuàng)建存儲與刪除存儲請求的超時時間,默認10秒。

enable-leader-election

是否開啟leader選舉,配置值為true時開啟,默認值為false。

leader-election-type

leader選舉時使用的鎖類型,包括兩種,默認的endpoint與官方推薦的lease

leader-election-namespace

leader選舉所使用的鎖對象存儲在哪個命令空間,默認存儲在external-provisioner pod所在的命名空間。

extra-create-metadata

設(shè)置為true后,創(chuàng)建存儲時,將額外增加請求參數(shù):pvc的名稱、命名空間、pv的名稱,默認值為false。

worker-threads

同時執(zhí)行CreateVolume/DeleteVolume操作的worker數(shù)量,默認值為100。

retry-interval-start

創(chuàng)建、刪除存儲失敗后的初始重試時間間隔,默認值為1秒。每一次失敗,重試時間間隔會加倍,直到達到--retry-interval-max配置的上限值。

retry-interval-max

創(chuàng)建、刪除存儲失敗后的最大重試時間間隔,默認值為5分鐘。

volume-name-prefix

創(chuàng)建pv時給pv名稱加的前綴,默認值為pvc。

feature-gates

特性配置。

配置示例:--feature-gates=Topology=true,存儲拓撲相關(guān),具體使用請參考:
https://kubernetes.io/zh/blog/2018/10/11/kubernetes-%E4%B8%AD%E7%9A%84%E6%8B%93%E6%89%91%E6%84%9F%E7%9F%A5%E6%95%B0%E6%8D%AE%E5%8D%B7%E4%BE%9B%E5%BA%94/
https://kubernetes-csi.github.io/docs/topology.html

kube-api-qps與kube-api-burst

用于kube-client與kube-apiserver通信時客戶端kube-client的限流。
限流實現(xiàn)上是令牌桶算法,kube-api-qps可以看作是每秒產(chǎn)生令牌的速度,而kube-api-burst可以看作是令牌桶的大小,kube-client發(fā)送給kube-apiserver的請求需要拿到令牌桶里的令牌后才能發(fā)送。
其中kube-api-qps默認值為5,kube-api-burst默認值為10。

關(guān)于如何進行external-provisioner組件的啟動參數(shù)進行分析就分享到這里啦,希望上述內(nèi)容能夠讓大家有所提升。如果想要學習更多知識,請大家多多留意小編的更新。謝謝大家關(guān)注一下億速云網(wǎng)站!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI