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 k8s in Docker

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

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to deploy k8s in Docker. It is very detailed and has a certain reference value. Friends who are interested must finish it!

Topological structure

1master + 2minion

K8s-master 192.168.0.201 master

K8s-node1 192.168.0.202 minion

K8s-node2 192.168.0.203 minion

Preparatory work system

Install Ubuntu 14.04 LTS 64bit server version of the system, configure hostname and ip.

When updating domestic software sources, md5 verification errors often occur due to GFW reasons. It is recommended to use Aliyun's source.

Docker

To install Docker on the minion node, version 1.2 is required, and 1.7.1 is installed here. For installation methods, see Docker installation (Ubuntu 64bit).

After installing Docker, we'd better configure a domestic registry mirror to speed up the image pull speed. Refer to the configuration of domestic free registry mirror.

Google pause

Download the Google pause image for each minion. Gcr.io/google_containers/pause image will be used for later work. Domestic users always make errors due to GFW problems, so we first download pause image from docker.io and set tag.

Then use kubectl get rc and kubectl get pods to see if it was successful.

If the status of each pod is Running, the deployment is successful.

You may encounter the problem that the pod status has been in Penning all the time. You can view the pod information through kubectl describe pods/pod-name. If there is no error message, Minion has been in the download image. After the download, pod will start successfully.

Dynamic management Cluster

If the cluster is already deployed, we want to be able to add and remove Minion nodes dynamically.

One way is to use kube-down.sh to stop all nodes, modify the config-default.sh file to add the newly added node information, or delete the unused node information, and then restart using the kube-up.sh script.

Of course we want to be able to dynamically add new Minion nodes without shutting down existing nodes, but I haven't found a way yet. It will be updated later when it is studied.

These are all the contents of the article "how to deploy K8s in Docker". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Original link: https://blog.csdn.net/wangtaoking1/article/details/49122977

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