Docker Service Inspect 解析
[
{
"ID": "q3o2za0hm43jvqaj8ia2ftx5m",
"Version": {
"Index": 52663
},
"CreatedAt": "2020-12-11T08:08:53.428411794Z",
"UpdatedAt": "2020-12-13T07:40:39.985386928Z",
"Spec": {
"Name": "monitoring_node-exporter",
"Labels": {
"com.docker.stack.image": "swarmprom-node-exporter:v0.16.0",
"com.docker.stack.namespace": "monitoring"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "swarmprom-node-exporter:v0.16.0@sha256:1d2518ec0501dd848e718bf008df37852b1448c862d6f256f2d39244975758d6",
"Labels": {
"com.docker.stack.namespace": "monitoring"
},
"Args": [
"--path.sysfs=/host/sys",
"--path.procfs=/host/proc",
"--collector.textfile.directory=/etc/node-exporter/",
"--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)(143295|/)",
"--no-collector.ipvs"
],
"Env": [
"NODE_ID={{.Node.ID}}"
],
"Privileges": {
"CredentialSpec": null,
"SELinuxContext": null
},
"Mounts": [
{
"Type": "bind",
"Source": "/proc",
"Target": "/host/proc",
"ReadOnly": true
},
{
"Type": "bind",
"Source": "/sys",
"Target": "/host/sys",
"ReadOnly": true
},
{
"Type": "bind",
"Source": "/",
"Target": "/rootfs",
"ReadOnly": true
},
{
"Type": "bind",
"Source": "/etc/hostname",
"Target": "/etc/nodename"
}
],
"StopGracePeriod": 10000000000,
"DNSConfig": {},
"Isolation": "default"
},
"Resources": { # 资源限制
"Limits": {
"NanoCPUs": 2000000000,
"MemoryBytes": 1073741824
},
"Reservations": {
"NanoCPUs": 1000000000,
"MemoryBytes": 536870912
}
},
"RestartPolicy": { # 重启策略
"Condition": "any",
"Delay": 5000000000,
"MaxAttempts": 0
},
"Placement": {
"Platforms": [
{
"Architecture": "amd64",
"OS": "linux"
}
]
},
"Networks": [
{
"Target": "xggrrldk6x13r07rsemazqz3x",
"Aliases": [
"node-exporter"
]
}
],
"ForceUpdate": 0, # 强制更新策略
"Runtime": "container"
},
"Mode": {
"Global": {}
},
"UpdateConfig": { # 更新配置
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"RollbackConfig": { # 回滚配置
"Parallelism": 1,
"FailureAction": "pause",
"Monitor": 5000000000,
"MaxFailureRatio": 0,
"Order": "stop-first"
},
"EndpointSpec": {
"Mode": "vip"
}
},
"PreviousSpec": {
"Name": "monitoring_node-exporter",
"Labels": {
"com.docker.stack.image": "swarmprom-node-exporter:v0.16.0",
"com.docker.stack.namespace": "monitoring"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "swarmprom-node-exporter:v0.16.0@sha256:1d2518ec0501dd848e718bf008df37852b1448c862d6f256f2d39244975758d6",
"Labels": {
"com.docker.stack.namespace": "monitoring"
},
"Args": [
"--path.sysfs=/host/sys",
"--path.procfs=/host/proc",
"--collector.textfile.directory=/etc/node-exporter/",
"--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)(116299|/)",
"--no-collector.ipvs"
],
"Env": [
"NODE_ID={{.Node.ID}}"
],
"Privileges": {
"CredentialSpec": null,
"SELinuxContext": null
},
"Mounts": [
{
"Type": "bind",
"Source": "/proc",
"Target": "/host/proc",
"ReadOnly": true
},
{
"Type": "bind",
"Source": "/sys",
"Target": "/host/sys",
"ReadOnly": true
},
{
"Type": "bind",
"Source": "/",
"Target": "/rootfs",
"ReadOnly": true
},
{
"Type": "bind",
"Source": "/etc/hostname",
"Target": "/etc/nodename"
}
],
"Isolation": "default"
},
"Resources": { # 资源限制
"Limits": {
"NanoCPUs": 2000000000,
"MemoryBytes": 1073741824
},
"Reservations": {
"NanoCPUs": 1000000000,
"MemoryBytes": 536870912
}
},
"Placement": {
"Platforms": [
{
"Architecture": "amd64",
"OS": "linux"
}
]
},
"Networks": [
{
"Target": "xggrrldk6x13r07rsemazqz3x",
"Aliases": [
"node-exporter"
]
}
],
"ForceUpdate": 0, # 强制更新策略
"Runtime": "container"
},
"Mode": {
"Global": {}
},
"EndpointSpec": {
"Mode": "vip"
}
},
"Endpoint": {
"Spec": {
"Mode": "vip"
},
"VirtualIPs": [
{
"NetworkID": "xggrrldk6x13r07rsemazqz3x",
"Addr": "10.0.11.27/24"
}
]
},
"UpdateStatus": {
"State": "completed",
"StartedAt": "2020-12-13T07:40:08.559805346Z",
"CompletedAt": "2020-12-13T07:40:39.985355314Z",
"Message": "update completed"
}
}
]