Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure Master02 in kubernetes

Shulou Source: shulou.com Published: 2022-06-03 05:08:21 10月10日 Update

This article shares with you how to configure Master02 in kubernetes. The article covers the configuration and use of Master02. I hope you can get something through this article.

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// at the end of [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

After reading this article, have you learned how to configure Master02 in kubernetes? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Services configurations addresses methods directories articles more scripts roles success usage content delimiters variables actual actually skills articles servers end Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno vpn Linux Apple Microsoft