部署方式
轻量级容器引擎(iSulad)服务端daemon为isulad,isulad可以通过配置文件进行配置,也可以通过命令行的方式进行配置,例如:isulad —xxx,优先级从高到低是:命令行方式>配置文件>代码中默认配置。
说明:
如果采用systemd管理iSulad进程,修改/etc/sysconfig/iSulad文件中的OPTIONS字段,等同于命令行方式进行配置。
命令行方式
在启动服务的时候,直接通过命令行进行配置。其配置选项可通过以下命令查阅:
$ isulad --help
lightweight container runtime daemon
Usage: isulad [global options]
GLOBAL OPTIONS:
--authorization-plugin Use authorization plugin
--cgroup-parent Set parent cgroup for all containers
--cni-bin-dir The full path of the directory in which to search for CNI plugin binaries. Default: /opt/cni/bin
--cni-conf-dir The full path of the directory in which to search for CNI config files. Default: /etc/cni/net.d
--default-ulimit Default ulimits for containers (default [])
-e, --engine Select backend engine
-g, --graph Root directory of the iSulad runtime
-G, --group Group for the unix socket(default is isulad)
--help Show help
--hook-spec Default hook spec file applied to all containers
-H, --host The socket name used to create gRPC server
--image-layer-check Check layer intergrity when needed
--image-opt-timeout Max timeout(default 5m) for image operation
--insecure-registry Disable TLS verification for the given registry
--insecure-skip-verify-enforce Force to skip the insecure verify(default false)
--log-driver Set daemon log driver, such as: file
-l, --log-level Set log level, the levels can be: FATAL ALERT CRIT ERROR WARN NOTICE INFO DEBUG TRACE
--log-opt Set daemon log driver options, such as: log-path=/tmp/logs/ to set directory where to store daemon logs
--native.umask Default file mode creation mask (umask) for containers
--network-plugin Set network plugin, default is null, suppport null and cni
-p, --pidfile Save pid into this file
--pod-sandbox-image The image whose network/ipc namespaces containers in each pod will use. (default "rnd-dockerhub.huawei.com/library/pause-${machine}:3.0")
--registry-mirrors Registry to be prepended when pulling unqualified images, can be specified multiple times
--start-timeout timeout duration for waiting on a container to start before it is killed
-S, --state Root directory for execution state files
--storage-driver Storage driver to use(default overlay2)
-s, --storage-opt Storage driver options
--tls Use TLS; implied by --tlsverify
--tlscacert Trust certs signed only by this CA (default "/root/.iSulad/ca.pem")
--tlscert Path to TLS certificate file (default "/root/.iSulad/cert.pem")
--tlskey Path to TLS key file (default "/root/.iSulad/key.pem")
--tlsverify Use TLS and verify the remote
--use-decrypted-key Use decrypted private key by default(default true)
-V, --version Print the version
--websocket-server-listening-port CRI websocket streaming service listening port (default 10350)
示例: 启动isulad,并将日志级别调整成DEBUG
$ isulad -l DEBUG
配置文件方式
isulad配置文件为/etc/isulad/daemon.json,各配置字段说明如下:
示例:
$ cat /etc/isulad/daemon.json
{
"group": "isulad",
"graph": "/var/lib/isulad",
"state": "/var/run/isulad",
"engine": "lcr",
"log-level": "ERROR",
"pidfile": "/var/run/isulad.pid",
"log-opts": {
"log-file-mode": "0600",
"log-path": "/var/lib/isulad",
"max-file": "1",
"max-size": "30KB"
},
"log-driver": "stdout",
"hook-spec": "/etc/default/isulad/hooks/default.json",
"start-timeout": "2m",
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
],
"registry-mirrors": [
"docker.io"
],
"insecure-registries": [
"rnd-dockerhub.huawei.com"
],
"pod-sandbox-image": "",
"image-opt-timeout": "5m",
"native.umask": "secure",
"network-plugin": "",
"cni-bin-dir": "",
"cni-conf-dir": "",
"image-layer-check": false,
"use-decrypted-key": true,
"insecure-skip-verify-enforce": false
}
须知:
默认配置文件/etc/isulad/daemon.json仅供参考,请根据实际需要进行配置