更多ceph-csi其他源码分析,请查看下面这篇博文:kubernetes ceph-csi分析目录导航

ceph-csi源码分析(2)-组件启动参数分析

ceph-csi组件的源码分析分为五部分:

(1)组件介绍与部署yaml分析;

(2)组件启动参数分析;

(3)rbd driver分析;

(4)cephfs driver分析;

(5)liveness driver分析。

本文将对ceph-csi组件的启动参数进行分析。

基于tag v3.0.0

https://github.com/ceph/ceph-csi/releases/tag/v3.0.0

ceph-csi组件启动参数列表

rbd驱动参数列表参考:https://github.com/ceph/ceph-csi/blob/devel/docs/deploy-rbd.md

cephfs驱动参数列表参考:https://github.com/ceph/ceph-csi/blob/devel/docs/deploy-cephfs.md

下面结合ceph-csi源码对组件启动参数进行分析。

const (
rbdType = "rbd"
cephfsType = "cephfs"
livenessType = "liveness" rbdDefaultName = "rbd.csi.ceph.com"
cephfsDefaultName = "cephfs.csi.ceph.com"
livenessDefaultName = "liveness.csi.ceph.com" pollTime = 60 // seconds
probeTimeout = 3 // seconds
) var (
conf util.Config
) func init() {
// common flags
flag.StringVar(&conf.Vtype, "type", "", "driver type [rbd|cephfs|liveness]")
flag.StringVar(&conf.Endpoint, "endpoint", "unix://tmp/csi.sock", "CSI endpoint")
flag.StringVar(&conf.DriverName, "drivername", "", "name of the driver")
flag.StringVar(&conf.NodeID, "nodeid", "", "node id")
flag.StringVar(&conf.InstanceID, "instanceid", "", "Unique ID distinguishing this instance of Ceph CSI among other"+
" instances, when sharing Ceph clusters across CSI instances for provisioning")
flag.IntVar(&conf.PidLimit, "pidlimit", 0, "the PID limit to configure through cgroups")
flag.BoolVar(&conf.IsControllerServer, "controllerserver", false, "start cephcsi controller server")
flag.BoolVar(&conf.IsNodeServer, "nodeserver", false, "start cephcsi node server")
flag.StringVar(&conf.DomainLabels, "domainlabels", "", "list of kubernetes node labels, that determines the topology"+
" domain the node belongs to, separated by ','") // cephfs related flags
flag.BoolVar(&conf.ForceKernelCephFS, "forcecephkernelclient", false, "enable Ceph Kernel clients on kernel < 4.17 which support quotas") // liveness/grpc metrics related flags
flag.IntVar(&conf.MetricsPort, "metricsport", 8080, "TCP port for liveness/grpc metrics requests")
flag.StringVar(&conf.MetricsPath, "metricspath", "/metrics", "path of prometheus endpoint where metrics will be available")
flag.DurationVar(&conf.PollTime, "polltime", time.Second*pollTime, "time interval in seconds between each poll")
flag.DurationVar(&conf.PoolTimeout, "timeout", time.Second*probeTimeout, "probe timeout in seconds") flag.BoolVar(&conf.EnableGRPCMetrics, "enablegrpcmetrics", false, "[DEPRECATED] enable grpc metrics")
flag.StringVar(&conf.HistogramOption, "histogramoption", "0.5,2,6",
"[DEPRECATED] Histogram option for grpc metrics, should be comma separated value, ex:= 0.5,2,6 where start=0.5 factor=2, count=6") flag.UintVar(&conf.RbdHardMaxCloneDepth, "rbdhardmaxclonedepth", 8, "Hard limit for maximum number of nested volume clones that are taken before a flatten occurs")
flag.UintVar(&conf.RbdSoftMaxCloneDepth, "rbdsoftmaxclonedepth", 4, "Soft limit for maximum number of nested volume clones that are taken before a flatten occurs")
flag.UintVar(&conf.MaxSnapshotsOnImage, "maxsnapshotsonimage", 450, "Maximum number of snapshots allowed on rbd image without flattening")
flag.BoolVar(&conf.SkipForceFlatten, "skipforceflatten", false,
"skip image flattening if kernel support mapping of rbd images which has the deep-flatten feature") flag.BoolVar(&conf.Version, "version", false, "Print cephcsi version information") klog.InitFlags(nil)
if err := flag.Set("logtostderr", "true"); err != nil {
klog.Exitf("failed to set logtostderr flag: %v", err)
}
flag.Parse()
}

deployment:csi-rbdplugin容器部署的启动参数配置

deployment:csi-rbdplugin容器实际上是rbdType-ControllerServer服务,主要负责创建、删除rbd存储等操作。

          args:
- "--nodeid=$(NODE_ID)"
- "--type=rbd"
- "--controllerserver=true"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=rbd.csi.ceph.com"
- "--pidlimit=-1"
- "--rbdhardmaxclonedepth=8"
- "--rbdsoftmaxclonedepth=4"
env:
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: unix:///csi/csi-provisioner.sock

daemonset:csi-rbdplugin容器部署的启动参数配置

daemonset:csi-rbdplugin容器实际上是rbdType-NodeServer服务,主要负责rbd存储的挂载、解除挂载等操作。

          args:
- "--nodeid=$(NODE_ID)"
- "--type=rbd"
- "--nodeserver=true"
- "--endpoint=$(CSI_ENDPOINT)"
- "--v=5"
- "--drivername=rbd.csi.ceph.com"
env:
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock

deployment:liveness-prometheus容器部署的启动参数配置

          args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
- "--metricsport=8680"
- "--metricspath=/metrics"
- "--polltime=60s"
- "--timeout=3s"
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi-provisioner.sock

daemonset:liveness-prometheus容器部署的启动参数配置

          args:
- "--type=liveness"
- "--endpoint=$(CSI_ENDPOINT)"
- "--metricsport=8680"
- "--metricspath=/metrics"
- "--polltime=60s"
- "--timeout=3s"
env:
- name: CSI_ENDPOINT
value: unix:///csi/csi.sock

下面是部分参数解析,详细参数解析请参考:

rbd:https://github.com/ceph/ceph-csi/blob/devel/docs/deploy-rbd.md

cephfs:https://github.com/ceph/ceph-csi/blob/devel/docs/deploy-cephfs.md

nodeid

node的唯一标识,一般填node ip或node name。

type

driver类型,可选项有rbd/cephfs/liveness,对应rbdType/cephfsType/livenessType三个类型的服务。

controllerserver

为true时,启动ControllerServer与IdentityServer。

nodeserver

为true时,启动NodeServer与IdentityServer。

endpoint

ceph-csi组件暴露的grpc服务socket地址,external-provisioner组件将与该socket地址通信,发出创建、删除存储的请求。默认值为unix://tmp/csi.sock

v

日志输出等级。

drivername

driver名称,与storageclass对象里的provisioner属性值保持一致,默认值为rbd.csi.ceph.com。根据指定driver名称来决定由哪个driver来负责存储的相关操作。

pidlimit

在cgroups中配置PID限制,限制在大量创建、删除存储操作时导致产生大量的PID。-1代表配置限制为最大值,0代表不限制,默认值为0

enablegrpcmetrics

[DEPRECATED]设置为true时,开启grpc metrics。默认值为false

metricsport

liveness/grpc metrics暴露端口。默认值8080

metricspath

liveness/grpc metrics暴露url。默认值/metrics

polltime

存活探测(probe请求)的时间间隔。

timeout

存活探测(probe请求)超时时间。

ceph-csi源码分析(2)-组件启动参数分析的更多相关文章

  1. external-provisioner源码分析(3)-组件启动参数分析

    更多ceph-csi其他源码分析,请查看下面这篇博文:kubernetes ceph-csi分析目录导航 external-provisioner源码分析(3)-组件启动参数分析 本文将对extern ...

  2. Tomcat8源码笔记(七)组件启动Server Service Engine Host启动

    一.Tomcat启动的入口 Tomcat初始化简单流程前面博客介绍了一遍,组件除了StandardHost都有博客,欢迎大家指文中错误.Tomcat启动类是Bootstrap,而启动容器启动入口位于 ...

  3. Tomcat源码分析之—组件启动实现分析

    Tomcat由多个组件组成,那么Tomcat是怎么对他们的生命周期进行管理的么,这里将从Tomcat源码去分析其生命周期的实现: Bootstrape类为Tomcat的入口,所有的组件够通过实现Lif ...

  4. Tomcat源码分析之—具体启动流程分析

    从Tomcat启动调用栈可知,Bootstrap类的main方法为整个Tomcat的入口,在init初始化Bootstrap类的时候为设置Catalina的工作路径也就是Catalina_HOME信息 ...

  5. external-attacher源码分析(1)-main方法与启动参数分析

    更多 ceph-csi 其他源码分析,请查看下面这篇博文:kubernetes ceph-csi分析目录导航 摘要 ceph-csi分析-external-attacher源码分析.external- ...

  6. Django-restframework 源码之认证组件源码分析

    Django-restframework 源码之认证组件源码分析 一 前言 之前在 Django-restframework 的流程分析博客中,把最重要的关于认证.权限和频率的方法找到了.该方法是 A ...

  7. Netty源码—一、server启动(1)

    Netty作为一个Java生态中的网络组件有着举足轻重的位置,各种开源中间件都使用Netty进行网络通信,比如Dubbo.RocketMQ.可以说Netty是对Java NIO的封装,比如ByteBu ...

  8. SpringBoot源码学习系列之启动原理简介

    本博客通过debug方式简单跟一下Springboot application启动的源码,Springboot的启动源码是比较复杂的,本博客只是简单梳理一下源码,浅析其原理 为了方便跟源码,先找个Ap ...

  9. 老李推荐:第8章5节《MonkeyRunner源码剖析》MonkeyRunner启动运行过程-运行测试脚本

    老李推荐:第8章5节<MonkeyRunner源码剖析>MonkeyRunner启动运行过程-运行测试脚本   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化 ...

随机推荐

  1. 『动善时』JMeter基础 — 15、使用JMeter实现上传文件

    目录 1.用于演示的项目说明 2.测试计划内包含的元件 3.HTTP请求界面内容 4.查看结果 5.总结 6.补充:MIME类型简介 (1)MIME说明 (2)常见类型 在上一篇文章[使用JMeter ...

  2. ZOHO的下一个25年:用心为企业服务

    来源:中国软件网 作者:海策 在25周年会上,ZOHO大中华区总裁侯康宁先生豪情壮志,"25岁的ZOHO,已经成长为非典型一线大厂." 1996年,ZOHO成立.截止2021年,Z ...

  3. (原创)高DPI适配经验系列:(四)高DPI适配示例

    一.前言 光说不练假把式. 原理说再多,也不如一个例子直观明了.所以本篇文章就来通过一个例子演示一下高DPI适配的流程. 相信看完的你,一定会有所收获! 本文地址:https://www.cnblog ...

  4. goland mod模式下不从vendor文件夹查找依赖

    goland使用vendor作为获取依赖源 软件版本: system:windows10 1709 terminal: wsl ubuntu1804 goland:201903 goland 打开项目 ...

  5. [bug] java.sql.SQLException: Unknown initial character set index '255' received from server. Initial cl...

    参考 https://www.jianshu.com/p/d86de6463cbd

  6. [转载]centos 7(1611)安装笔记

    centos 7(1611)安装笔记   麻烦 前天我把双系统笔记本里的 deepin 的磁盘分区直接从 Windows 7 磁盘管理里格式化了,结果悲催了,开不了机了,显示: 我以为是 Window ...

  7. 3.23 vi/vim:纯文本编辑器

    vi/vim 是Linux命令行界面下的文字编辑器,几乎所有的Linux系统都安装了vi,只要学会了vi这个编辑工具,就可以在任何Linux系统上使用它.而vim是vi命令的增强版(Vi IMprov ...

  8. centos7 启动docker失败

    现象:Centos7.3通过yum安装完docker后,启动docker失败 机器的系统版本:CentOS Linux release 7.3.1611 (Core) centos7,执行完安装命令: ...

  9. 安装oracle 时“[INS-30014]无法检查指定的位置是否位于 CFS上”问题

    错误截图: 错误信息: [INS-30014]无法检查指定的位置是否位于 CFS上 解决方案: 通过修改hosts文件,向C:\Windows\System32\drivers\etc\hosts文件 ...

  10. nginx反向代理网站镜像

    某些公司会墙特定网站,如果你有一个可访问的域名和服务器,就可以通过nginx反向代理来来解决这些问题.比如现在我们用mirror.example.com镜像www.baidu.com,以下是详细操作. ...