markdown如何在windows10上运行kubernetes(代码片段)

author author     2022-12-14     450

关键词:

# Kubernetes On Windows

Early in August 2016 Microsoft released the Windows 10 Anniversary Update. There were a number of changes, but the one that got me to actually take the time to install the update was "Bash on Ubuntu on Windows".
This feature would install Ubuntu Linux without the kernel. It would run linux in user-mode. Linux would run the commands while Windows does all the work/processing. 

For an upcoming project I needed to get Kubernetes running. Being as Kubernetes is not able to be run in Windows the normally accepted way to procees is to create a virtual Linux box and run it from there. I wanted to see if Kubernetes would run in Bash on Ubuntu on Windows. 

This is how I got it to work:

## Install the Windows 10 Anniversary Update
This was pretty straight forward. [Download the Windows 10 Upgrade tool][2]. I found the tool initially [here][1]. 
The upgrade will take about 45ish minutes depending on your internet connection and computer. 

## Install Bash on Ubuntu on Windows
I followed [these instructions][3] but will also outline them here.

1. Turn on Developer Mode
   1. Open Settings -> Update and Security -> For developers
   2. Select the Developer Mode radio button
2. Add the Linux Subsystem
   1. From Start, search for "Turn Windows features on or off" (type 'turn')
   2. Select Windows Subsystem for Linux (beta)
   3. Click OK
   4. Wait for the install to finish
3. Enable the Linux subsystem feature
   1. Open a PowerShell prompt as administrator and run:
    ```
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    ```
    2. Restart if needed
4. Run Bash on Windows. This will install all the Ubuntu files
   1. Open a command prompt
   2. Run `bash`
   3. Type `y` to accept the license and install
   4. You will be asked about a username and password. You can use any username and password. They have no relationship to Windows users. 

## Install Google SDK
Now that we have Bash running installing the Google SDK is really easy. [Documented here][4].

Run the following commands from Bash:

1. Run this to install the SDK: `curl https://sdk.cloud.google.com | bash`
2. Restart your shell: `exec -l $SHELL`
3. Initialize the gcloud environment: `gcloud init`

## Install Kubernetes
Once the SDK is installed we can finally install Kubernetes.
```
gcloud components install kubectl
```
[Example Hello World Walkthrough][5]

# Done
You can now to run `kubectl`, `gcloud` from Bash! *Woot!* 

My setup is that I will run `kubectl` from Bash, and then any `gcloud` and `docker` commands from Windows PowerShell. Which will allow me to control my GCP projects without needing another virtual machine. 

[1]: https://support.microsoft.com/en-us/help/12387/windows-10-update-history
[2]: http://go.microsoft.com/fwlink/p/?LinkId=821403
[3]: https://msdn.microsoft.com/commandline/wsl/install_guide
[4]: https://cloud.google.com/sdk/downloads#linux
[5]: http://kubernetes.io/docs/hellonode/

如何在window10上安装docker

如何在Window10上安装DockerDocker最近推出了可以运行在Win10和Mac上的稳定版本,那么在本篇博文中,我将给大家介绍如何在Windows10上安装Docker并运行Linux和WindowsContainers。DockerforWindows10使用MicrosoftHyper-V来同时驱动Linux和Windows容器。要... 查看详情

如何让代码在 Windows 10 上的 GPU 上运行?

】如何让代码在Windows10上的GPU上运行?【英文标题】:HowtomakecoderunonGPUonWindows10?【发布时间】:2021-08-0320:23:57【问题描述】:我想在Windows10的gpu上运行我的代码,就像googlecolab一样,我们可以更改运行时选项,这很容易转移到gpu... 查看详情

如何在 Windows 10 上同时运行多个 python 代码?

】如何在Windows10上同时运行多个python代码?【英文标题】:HowcanIrunmultiplepythoncodeonawindows10simultaniously?【发布时间】:2019-11-1112:45:24【问题描述】:我试图在我的Windows10上的python3中同时运行2个脚本,但是脚本连续运行(第一个完... 查看详情

markdown在highsierra上安装windows10(macos10.13.2)(代码片段)

查看详情

如何在 Windows 10 上运行 Spark Streaming 应用程序?

】如何在Windows10上运行SparkStreaming应用程序?【英文标题】:HowtorunSparkStreamingapplicationonWindows10?【发布时间】:2016-12-2618:06:11【问题描述】:我在MSWindows1064位上运行一个SparkStreaming应用程序,它使用spark-mongo-connector在MongoDB中存储... 查看详情

如何从 Windows 任务调度程序在(ubuntu bash windows 10)上运行程序

】如何从Windows任务调度程序在(ubuntubashwindows10)上运行程序【英文标题】:Howtorunprogramon(ubuntubashwindows10)fromwindowstaskscheduler【发布时间】:2017-10-0417:55:57【问题描述】:我需要在ubuntubash中每5分钟执行一次任务,我喜欢使用window... 查看详情

VB 6 应用程序如何确定它是不是在 Windows 10 上运行?

】VB6应用程序如何确定它是不是在Windows10上运行?【英文标题】:HowcanaVB6appdetermineifitisrunningonWindows10?VB6应用程序如何确定它是否在Windows10上运行?【发布时间】:2016-11-0108:04:49【问题描述】:我希望我的VB6应用程序检测并显示... 查看详情

markdown在windows8和10用户中启动时运行批处理文件(代码片段)

查看详情

登录后如何在Windows-Start-Up上自动运行第三方Windows 10 Store App

】登录后如何在Windows-Start-Up上自动运行第三方Windows10StoreApp【英文标题】:HowtoautomaticallyrunathirdpartyWindows10StoreApponWindows-Start-Upafterlogin【发布时间】:2016-07-2322:00:52【问题描述】:我想要实现的是:在用户登录到他的Windows10后运... 查看详情

如何在 Windows 10 家庭版上安装 Docker? [关闭]

】如何在Windows10家庭版上安装Docker?[关闭]【英文标题】:HowcanIinstallDockeronWindows10Home?[closed]【发布时间】:2022-01-0406:34:25【问题描述】:我知道docker不能在Windows10家庭版上运行。它将在Windows10专业版或企业版中运行,因为它需... 查看详情

如何分析在 Windows 上运行的 C++ 代码?

】如何分析在Windows上运行的C++代码?【英文标题】:HowcanIprofileC++coderunningonWindows?【发布时间】:2020-06-1013:14:04【问题描述】:我有一个C++应用程序,在windows10(AMDRyzon处理器)上运行,我正在进行基准测试和优化。谁能推荐一... 查看详情

markdown如何在osx上安装dia(并让它运行)(代码片段)

查看详情

在 Windows 10 上使用 Intellij IDEA 在 WSL 2 中运行和调试 Java

...带有JNI)并在Ubuntu上运行。在Windows上使用maven和git很好。如何让 查看详情

如何在 Windows 上运行多个 Tor 浏览器实例?

】如何在Windows上运行多个Tor浏览器实例?【英文标题】:HowtorunMultipleTorBrowserinstancesonwindows?【发布时间】:2020-12-2313:03:52【问题描述】:我正在尝试在Windows上使用不同的torrc配置和不同的IP地址运行多个Tor浏览器实例。Tor浏览器... 查看详情

在 Windows 10 上运行 IBackgroundTask

】在Windows10上运行IBackgroundTask【英文标题】:RunningIBackgroundTaskonWindows10【发布时间】:2016-04-1806:54:16【问题描述】:我有一个UAP应用程序,当我在Windows10手机上调试时,会自动触发IBackgroundTask。当我在本地机器(Windows10x86)上调... 查看详情

如何使用 Laravel 在 Windows 10 中运行任务调度程序

】如何使用Laravel在Windows10中运行任务调度程序【英文标题】:Howtoruntaskschedulerinwindows10withLaravel【发布时间】:2016-07-1805:44:12【问题描述】:我只是想问一下如何在windows机器(我的本地机器)上使用它的任务调度功能。我已经阅... 查看详情

如何在 Windows 10 上控制蓝牙 LE 连接?

】如何在Windows10上控制蓝牙LE连接?【英文标题】:HowtocontrolaBluetoothLEconnectiononWindows10?【发布时间】:2017-01-2101:19:51【问题描述】:我需要开发一个通过低功耗蓝牙与设备通信的应用程序。一旦应用程序通过蓝牙连接到设备,它... 查看详情

如何在 Windows 上运行多个 WSL2 实例?

】如何在Windows上运行多个WSL2实例?【英文标题】:HowtorunmultipleWSL2instancesonWindows?【发布时间】:2021-05-0922:07:25【问题描述】:我已经安装了WSL2并在上面部署了两台机器:CentOSUbuntu-20.04是否可以在我的win10机器上运行多个Ubuntu-20.... 查看详情