有什么方法可以通过终端在Mac的Docker上启用Kubernetes吗? [英] Is there any way to enable Kubernetes on Docker for Mac via terminal?

查看:114
本文介绍了有什么方法可以通过终端在Mac的Docker上启用Kubernetes吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Electron应用程序,并希望通过Docker和Kubernetes(使用Helm图表)分发Web应用程序(PHP)的后端部分.我计划打包扩展的dmg Docker,但是还没有找到从终端配置Docker的方法.是否可以-启用Kubernetes并通过终端增加CPU大小和RAM?

I'm developing an Electron app and want to distribute the back-end portion of the web application (PHP) via Docker and Kubernetes (using Helm charts). I plan to package the expanded dmg of Docker, but haven't found a way to configure Docker from terminal. Is this possible - enable Kubernetes and increase CPU size and RAM via terminal?

我不想只是从命令行启动Docker.我想配置第一个安装以及指定Docker守护程序可以访问并启用Kubernetes的资源数量.

I don't want to just start Docker from the command line. I want to configure the first installation as well specifying the amount of resources the Docker daemon has access to and enabling Kubernetes.

推荐答案

在继续研究之后,我确实找到了答案.在Mac上的Docker上,Docker守护进程实际上是在Hyperkit VM内运行的,而Docker CLI仅与在Hyperkit中运行的Docker引擎进行通信.其配置位于〜/Library/Group Containers/group.com.docker/settings.json.

After continued research, I did find an answer to this. On Docker for Mac, the Docker daemon is actually run inside of Hyperkit VM and the Docker CLI just communicates with the Docker engine running in Hyperkit. The configuration for this is at ~/Library/Group Containers/group.com.docker/settings.json.

{
  "proxyHttpMode" : "system",
  "diskPath" : "~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2",
  "diskSizeMiB" : 65536,
  "cpus" : 5,
  "defaultMachineMigrationStatus" : 4,
  "memoryMiB" : 9216,
  "displayedWelcomeWhale" : true,
  "buildNumber" : "26764",
  "autoStart" : true,
  "kubernetesInitialInstallPerformed" : true,
  "channelID" : "stable",
  "checkForUpdates" : true,
  "settingsVersion" : 1,
  "kubernetesEnabled" : true,
  "version" : "18.06.1-ce-mac73",
  "displayedWelcomeMessage" : true,
  "analyticsEnabled" : true,
  "linuxDaemonConfigCreationDate" : "2017-10-24 15:59:40 +0000",
  "dockerAppLaunchPath" : "/Applications/Docker.app"
}

Docker启动时,会将以下设置分配给hyperkit作为命令行参数:com.docker.hyperkit -A -u -F vms/0/hyperkit.pid -c 5 -m 9216M.

When Docker starts up, it will allocate these settings to hyperkit as command line arguments: com.docker.hyperkit -A -u -F vms/0/hyperkit.pid -c 5 -m 9216M.

默认情况下,运行docker容器时,docker会分配hyperkit的所有内存和CPU供其使用,但可以由docker run参数覆盖.

By default, when running docker containers, docker will allocate all memory and CPU of hyperkit for them to consume but can be overridden by docker run arguments.

这篇关于有什么方法可以通过终端在Mac的Docker上启用Kubernetes吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆