mirror of
https://github.com/ceph/ceph
synced 2025-04-11 04:02:04 +00:00
qa/tasks/kubeadm: modify (do not clobber) daemon.json
Otherwise we blow away the mirror config. Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
13238ade13
commit
2a6ad93a76
@ -4,6 +4,7 @@ Kubernetes cluster task, deployed via kubeadm
|
||||
import argparse
|
||||
import contextlib
|
||||
import ipaddress
|
||||
import json
|
||||
import logging
|
||||
import random
|
||||
import yaml
|
||||
@ -58,18 +59,18 @@ def preflight(ctx, config):
|
||||
# set docker cgroup driver = systemd
|
||||
# see https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker
|
||||
# see https://github.com/kubernetes/kubeadm/issues/2066
|
||||
daemon_json = """
|
||||
{
|
||||
"exec-opts": ["native.cgroupdriver=systemd"],
|
||||
"log-driver": "json-file",
|
||||
"log-opts": {
|
||||
"max-size": "100m"
|
||||
},
|
||||
"storage-driver": "overlay2"
|
||||
}
|
||||
"""
|
||||
for remote in ctx.cluster.remotes.keys():
|
||||
remote.write_file('/etc/docker/daemon.json', daemon_json, sudo=True)
|
||||
try:
|
||||
orig = remote.read_file('/etc/docker/daemon.json', sudo=True)
|
||||
j = json.loads(orig)
|
||||
except Exception as e:
|
||||
log.info(f'Failed to pull old daemon.json: {e}')
|
||||
j = {}
|
||||
j["exec-opts"] = ["native.cgroupdriver=systemd"]
|
||||
j["log-driver"] = "json-file"
|
||||
j["log-opts"] = {"max-size": "100m"}
|
||||
j["storage-driver"] = "overlay2"
|
||||
remote.write_file('/etc/docker/daemon.json', json.dumps(j), sudo=True)
|
||||
run.wait(
|
||||
ctx.cluster.run(
|
||||
args=[
|
||||
|
Loading…
Reference in New Issue
Block a user