网络运营 > 服务器 > Linux

CentOS二进制安装Kubernetes

102人参与2020-12-31

前言

最近在私有云部署一套自动化运维平台;

其中k8s是重头戏,这篇文章为大家分享一下二进制安装方式

k8s架构图

在这里插入图片描述

安装过程

cd /soft
wget https://dl.k8s.io/v1.20.0/kubernetes-server-linux-amd64.tar.gz
tar -zxvf kubernetes-server-linux-amd64.tar.gz
cd kubernetes
mkdir /soft/kubernetes/server/conf/
vim /soft/kubernetes/server/conf/apiserver
  
KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"
KUBE_API_PORT="--port=8886"
KUBE_ETCD_SERVERS="--etcd-servers=http://10.9.0.46:2379"
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=169.169.0.0/16"
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ResourceQuota"
KUBE_API_LOG="--logtostderr=false --log-dir=/home/k8s-t/log/kubernets --v=2"
KUBE_API_ARGS=" "
vim /etc/systemd/system/kube-apiserver.service
  
[Unit]
Description=Kubernetes API Server
After=etcd.service
Wants=etcd.service
  
[Service]
EnvironmentFile=/soft/kubernetes/server/conf/apiserver
ExecStart=/soft/kubernetes/server/bin/kube-apiserver  \
          $KUBE_ETCD_SERVERS \
          $KUBE_API_ADDRESS \
          $KUBE_API_PORT \
          $KUBE_SERVICE_ADDRESSES \
          $KUBE_ADMISSION_CONTROL \
        $KUBE_API_LOG \
          $KUBE_API_ARGS 
Restart=on-failure
  Type=notify
  LimitNOFILE=65536
  
[Install]
WantedBy=multi-user.target
vim /soft/kubernetes/server/conf/controller-manager

KUBE_MASTER="--master=http://10.9.0.46:8886"
KUBE_CONTROLLER_MANAGER_ARGS=" "
vim /etc/systemd/system/kube-controller-manager.service
  
[Unit]
Description=Kubernetes Scheduler
After=kube-apiserver.service 
Requires=kube-apiserver.service

[Service]
EnvironmentFile=-/soft/kubernetes/server/conf/controller-manager
ExecStart=/soft/kubernetes/server/bin/kube-controller-manager \
        $KUBE_MASTER \
        $KUBE_CONTROLLER_MANAGER_ARGS
Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
vim /soft/kubernetes/server/conf/scheduler

KUBE_MASTER="--master=http://10.9.0.46:8886"
KUBE_SCHEDULER_ARGS="--logtostderr=true --log-dir=/home/k8s-t/log/kubernetes --v=2"
vim /etc/systemd/system/kube-scheduler.service

[Unit]
Description=Kubernetes Scheduler
After=kube-apiserver.service 
Requires=kube-apiserver.service

[Service]
User=root
EnvironmentFile=-/soft/kubernetes/server/conf/scheduler
ExecStart=/soft/kubernetes/server/bin/kube-scheduler \
        $KUBE_MASTER \
        $KUBE_SCHEDULER_ARGS
Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target 
systemctl daemon-reload
systemctl enable kube-apiserver.service
systemctl start kube-apiserver.service

systemctl enable kube-controller-manager.service
systemctl start kube-controller-manager.service

systemctl enable kube-scheduler.service
systemctl start kube-scheduler.service

总结

本文地址:https://blog.csdn.net/u012829124/article/details/112056142

您对本文有任何疑问!!点此进行留言回复

推荐阅读

猜你喜欢

CentOS二进制安装Kubernetes

12-31

总结2020:5个月出版两本书,日更公众号是一种怎样的体验?

12-31

Linux下为主机创建虚拟端口并选择特定端口发送数据---以mininet下的SDN网络架构模拟为例

12-31

编程这工作究竟是在干什么?

12-30

从头开始学Docker(一)Docker入门

12-31

Linux大型网站高并发架构及自动化运维项目

12-31

拓展阅读

大家都在看

windows10 更新Ubuntu20.04 LTS的方法步骤

06-14

Ubuntu 安装cuda10.1驱动的实现步骤

07-31

详解shell中脚本参数传递的两种方式

11-21

详解shell中脚本参数传递的两种方式

11-21

CentOS7运行.sh脚本提示syntax error: unexpected end of file的解决方法

05-12

shell命令实现当前目录下多个文件合并为一个文件的方法

03-19

Linux查找处理文件名后包含空格的文件(两种方法)

11-25

Apache FlinkCEP 实现超时状态监控的步骤详解

03-09

热门评论