本文整理汇总了Python中cattle.Config.cadvisor_ip方法的典型用法代码示例。如果您正苦于以下问题:Python Config.cadvisor_ip方法的具体用法?Python Config.cadvisor_ip怎么用?Python Config.cadvisor_ip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cattle.Config
的用法示例。
在下文中一共展示了Config.cadvisor_ip方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_startup
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def on_startup(self):
cmd = ['cadvisor',
'-logtostderr=true',
'-listen_ip', Config.cadvisor_ip(),
'-port', str(Config.cadvisor_port()),
'-housekeeping_interval', Config.cadvisor_interval()]
docker_root = Config.cadvisor_docker_root()
if docker_root:
cmd += ["-docker_root", docker_root]
cadvisor_opts = Config.cadvisor_opts()
if cadvisor_opts:
try:
cmd += shlex.split(cadvisor_opts)
except ValueError:
log.exception(
"Error missing closing `'` in: {0}".format(cadvisor_opts))
pass
wrapper = Config.cadvisor_wrapper()
if len(wrapper):
cmd.insert(0, wrapper)
else:
if os.path.exists('/host/proc/1/ns/mnt'):
cmd = ['nsenter', '--mount=/host/proc/1/ns/mnt', '--'] + cmd
background(cmd)
示例2: on_startup
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def on_startup(self):
cmd = [cadvisor_bin(),
'-logtostderr=true',
'-ip', Config.cadvisor_ip(),
'-port', str(Config.cadvisor_port())]
if os.path.exists('/host/proc/1/ns/mnt'):
cmd = ['nsenter', '--mount=/host/proc/1/ns/mnt', '--'] + cmd
background(cmd)
示例3: __init__
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def __init__(self, docker_client=None):
self.unit = 1048576
self.cadvisor = CadvisorAPIClient(Config.cadvisor_ip(),
Config.cadvisor_port())
self.docker_client = docker_client
self.docker_storage_driver = None
if self.docker_client:
self.docker_storage_driver = \
self.docker_client.info().get("Driver", None)
示例4: on_startup
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def on_startup(self):
env = dict(os.environ)
env['HOST_API_CONFIG_FILE'] = host_api_config()
url = 'http://{0}:{1}'.format(Config.cadvisor_ip(),
Config.cadvisor_port())
background(['host-api',
'-cadvisor-url', url,
'-logtostderr=true',
'-ip', Config.host_api_ip(),
'-port', str(Config.host_api_port())],
env=env)
示例5: on_startup
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def on_startup(self):
cmd = ['cadvisor',
'-logtostderr=true',
'-listen_ip', Config.cadvisor_ip(),
'-port', str(Config.cadvisor_port())]
wrapper = Config.cadvisor_wrapper()
if len(wrapper):
cmd.insert(0, wrapper)
else:
if os.path.exists('/host/proc/1/ns/mnt'):
cmd = ['nsenter', '--mount=/host/proc/1/ns/mnt', '--'] + cmd
background(cmd)
示例6: on_startup
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def on_startup(self):
env = dict(os.environ)
env['HOST_API_CATTLE_ACCESS_KEY'] = Config.access_key()
env['HOST_API_CATTLE_SECRET_KEY'] = Config.secret_key()
url = 'http://{0}:{1}'.format(Config.cadvisor_ip(),
Config.cadvisor_port())
background(['host-api',
'-cadvisor-url', url,
'-logtostderr=true',
'-ip', Config.host_api_ip(),
'-port', str(Config.host_api_port()),
'-auth=true',
'-host-uuid', DockerConfig.docker_uuid(),
'-public-key', Config.jwt_public_key_file(),
'-cattle-url', Config.api_url(),
'-cattle-state-dir', Config.container_state_dir()],
env=env)
示例7: __init__
# 需要导入模块: from cattle import Config [as 别名]
# 或者: from cattle.Config import cadvisor_ip [as 别名]
def __init__(self):
self.unit = 1048576
self.cadvisor = CadvisorAPIClient(Config.cadvisor_ip(),
Config.cadvisor_port())