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 Master02 in K8S Multi-master

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces how to deploy Master02 in K8S multi-master, which is very detailed and has certain reference value. Friends who are interested must finish reading it!

Server role assignment role address installation component master192.168.142.220kube-apiserver kube-controller-manager kube-scheduler etcdmaster02192.168.142.120kube-apiserver kube-controller-manager kube-schedulernode1192.168.142.136kubelet kube-proxy docker flannel etcdnode2192.168.142.132kubelet kube-proxy docker flannel etcdnginx1192.168.142.130nginx keepalivednginx2192.168.142.140nginx keepalived 1, Master02 configuration

All operations before the delimiter are performed on master01

Copy directory to master02

Copy the kubernetes directory to master02

[root@master K8s] # scp-r / opt/kubernetes/ root@192.168.142.120:/opt

Copy the etcd directory to master02

Master02 must have an etcd certificate, otherwise the apiserver service cannot be started

[root@master K8s] # scp-r / opt/etcd/ root@192.168.142.120:/opt replication service startup script

Kube-apiserver.service kube-controller-manager.service kube-scheduler.service

[root@master K8s] # scp / usr/lib/systemd/system/ {kube-apiserver,kube-controller-manager,kube-scheduler} .service root@192.168.142.120:/usr/lib/systemd/system/ modify service script

In fact, you only need to modify the apiserver.

[root@master02 K8s] # cd / opt/kubernetes/cfg/ [root@master02 cfg] # vim kube-apiserverKUBE_APISERVER_OPTS= "--logtostderr=true\-- etcd-servers= https://192.168.142.220:2379,https://192.168.142.136:2379, Https://192.168.142.132:2379\ # Note address change-- bind-address=192.168.142.120\-- secure-port=6443\ # Note address change-- advertise-address=192.168.142.120\-- allow-privileged=true\-- service-cluster-ip-range=10.0.0.0/24\-- enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota,NodeRestriction\-- authorization-mode=RBAC Node\-kubelet-https=true\-- enable-bootstrap-token-auth\-- token-auth-file=/opt/kubernetes/cfg/token.csv\-- service-node-port-range=30000-50000\-- tls-cert-file=/opt/kubernetes/ssl/server.pem\-- tls-private-key-file=/opt/kubernetes/ssl/server-key.pem\-- client-ca-file=/opt/kubernetes/ssl/ca.pem\-- service-account-key-file=/opt/kubernetes / ssl/ca-key.pem\-- etcd-cafile=/opt/etcd/ssl/ca.pem\-- etcd-certfile=/opt/etcd/ssl/server.pem\-- etcd-keyfile=/opt/etcd/ssl/server-key.pem "start the service [root@master02 cfg] # systemctl start kube-apiserver.service [root@master02 cfg] # systemctl start kube-controller-manager.service [root@master02 cfg] # systemctl start kube-scheduler.service result verification / / add environment variable [ Root@master02 cfg] # vim / etc/profile// add export PATH=$PATH:/opt/kubernetes/bin/ [root@master02 cfg] # source / etc/profile// to see the following picture is successful [root@master02 cfg] # kubectl get nodeNAME STATUS ROLES AGE VERSION192.168.142.132 Ready 2d12h v1.12.3192.168.142.136 Ready 38h v1.12.3 is "K8S Multi-master" All the contents of the article how to deploy Master02 Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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