Giter VIP home page Giter VIP logo

k8s-docker-desktop-for-mac's Introduction

Docker Desktop for Mac 开启并使用 Kubernetes

github workflow

Docker Desktop 可以方便的启用 Kubernetes 集群, 为学习 Kubernetes 提供了极大的便利, 但是由于众所周知的原因, 国内的网络下不能很方便的下载 Kubernetes 集群所需要的镜像, 导致集群启用失败. 这里提供了一个简单的方法, 利用 GitHub Actions 实现 k8s.gcr.iokubernetes 依赖镜像自动同步到 Docker Hub 上指定的仓库中。 通过 load_images.sh 将所需镜像从 Docker Hub 的同步仓库中取回,并重新打上原始的tag. 镜像对应关系文件可以查看: images.

说明:

  • 当前在 Docker Desktop (Mac) Version 4.14.1 (Kubernetes: v1.25.2)上经过测试可用
  • 使用 KubeadmUbuntu上安装 Kubernetes 请查看 gotok8s

安装并启动

  1. 下载安装 Docker Desktop (Mac)

  2. Docker Hub 的同步仓库中取回,并重新打上原始的tag.

./load_images.sh
  1. Docker for Mac 设置中启用 Kubernetes 选项, 并等待一会儿,直到 Kubernetes 开始运行。

k8s

  1. 可选的步骤: 切换Kubernetes运行上下文至 docker-desktop
# 一般只有在之前用其他方式运行过Kubernetes才需要
$ kubectl config use-context docker-desktop
  1. 验证 Kubernetes 集群状态
$ kubectl cluster-info
$ kubectl get nodes
$ kubectl describe node

参考

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.