Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy kubernetes under mac

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to deploy kubernetes under mac. The content of the article is of high quality, so Xiaobian shares it with you for reference. I hope you have a certain understanding of relevant knowledge after reading this article.

preface

Docker-compose has always been used to manage containers, but because it is suitable for single-node host management, and recently in the study of distributed containerization solutions, so it is necessary to integrate a kubernetes environment in the local environment for testing (docker has been installed), due to the existence of the so-called "people's wall", so that you can not directly check the installation of docker through the operation interface provided by docker (directly check the pull will always kubernetes is starting…)

After consulting the information and blog posts, I decided to install it manually by pulling the mirror. Now the deployment is successful. Here is a record of the deployment process.

Version Mac: 10.15.4Docker: 2.3.0.3 (45519)Kubernetes: 1.16.5Kubernetes native version

Click the docker icon in the status bar at the top of mac to enter About Docker Desktop.

Here we can see the corresponding version of kubernetes:

pull code

Pull the code on GIT and the command line executes the following:

git clone https://github.com/maguowei/k8s-docker-for-mac

After pulling, there will be one more ==k8s-docker-for-mac locally

== Directory, execute:

cd k8s-docker-for-macvim images

In the images, some image names and their versions are described. Here, you need to change the version to be consistent with the version of the local pre-required kubernetes (change 1.18.3 to 1.16.5, and adjust several other archived versions):

k8s.gcr.io/kube-proxy:v1.16.5=gotok8s/kube-proxy:v1.16.5k8s.gcr.io/kube-controller-manager:v1.16.5=gotok8s/kube-controller-manager:v1.16.5k8s.gcr.io/kube-scheduler:v1.16.5=gotok8s/kube-scheduler:v1.16.5k8s.gcr.io/kube-apiserver:v1.16.5=gotok8s/kube-apiserver:v1.16.5k8s.gcr.io/coredns:1.6.2=gotok8s/coredns:1.6.2k8s.gcr.io/pause:3.1=gotok8s/pause:3.1k8s.gcr.io/etcd:3.3.15-0=gotok8s/etcd:3.3.15-0

After saving and exiting, it is best to modify the docker image source to a domestic source to improve the pulling speed.

Modify Mirror Source

Click the docker icon in the status bar at the top of mac to enter Preferences

Enter Engine and fill in the domestic mirror:

{ "debug": true, "experimental": false, "registry-mirrors": ["https://registry.docker-cn.com","https://hub-mirror.c.163.com" ]}

Then click Save Restart:

pull images from the nearest region

Go back to the k8s-docker-for-mac directory and execute:

sh load_images.sh

After waiting for the pull to succeed, enter Preferences again

Check kubernetes, save restart

While waiting, you can see the status of kubernetes:

After completion, you can see that kubernetes status changes to running:

The deployment was judged successful.

PostScript

Dashboards can also be configured as needed.

About how to deploy Kubernetes under mac to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report