In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what to prepare before Kubernetes installation". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what to prepare before Kubernetes installation".
Centos7 reference: https://www.cnblogs.com/fb010001/p/11516959.html
This installation uses Ubuntu Server X64 18.04 LTS version to install kubernetes cluster environment, and the cluster node is in 1 master and 2 slave mode. There are some basic requirements for virtual opportunities this time, as follows:
OS:Ubuntu Server X64 18.04 LTS (same steps for version 16.04, but different before)
CPU: minimum requirement, 1 CPU 2 core
Memory: minimum requirement, 2 GB
Disk: minimum requirement, 20 GB
Kubernetes node configuration host IP role system CPU/ memory disk k8s-master192.168.100.120masterUbuntu Server 18.042 core 2GB20GBk8s-node-01192.168.100.121nodeUbuntu Server 18.042 core 4GB20GBk8s-node-02192.168.100.122nodeUbuntu Server 18.042 4GB20GB unified environment configuration turn off swap space close swap space swapoff-an avoid booting swap space # Note Line at the beginning of swap vi / etc/fstab close Firewall configuration DNS# cancel DNS line comment And add DNS configuration such as 114.114.114.114 After modification, restart the computer vi / etc/systemd/resolved.conf install Docker# update software source sudo apt-get update# installation depends on sudo apt-get-y install apt-transport-https ca-certificates curl software-properties-common# to install GPG certificate curl-fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add- # add software source information sudo add-apt-repository "deb [arch=amd64] http: / / mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release-cs) stable "# Update the software source sudo apt-get-y update# again to view the stable version of dockerapt-cache madison docker-ce that can be installed. If you want to install kebernetes 1.15, please do not install docker above version 19.0 # install Docker CE version of sudo apt-get-y install docker-ce=18.03.1~ce~3-0~ubuntu configure Docker acceleration
Note: domestic image acceleration may be very slow. Please replace it with your own Ali Cloud Image acceleration, such as https://yourself.mirror.aliyuncs.com, which can be found in the Container Image Service-> Image acceleration menu on the Ali Cloud console.
Write the following in / etc/docker/daemon.json (the following configuration modifies the cgroup driver to systemd to meet the K8S recommendation)
{"exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": {"max-size": "100m"}, "registry-mirrors": ["https://k7da99jp.mirror.aliyuncs.com/"," https://dockerhub.azk8s.cn", "https://registry.docker-cn.com"]," storage-driver ":" overlay2 "} install Kubernetes prerequisite tools
Install three prerequisites for Kubernetes, namely kubeadm,kubelet,kubectl
# install system tool apt-get update & & apt-get install-y apt-transport-https# install GPG certificate curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add-# write to software source Note: we use the system code bionic, but Aliyun does not support it at present, so use xenialcat / etc/apt/sources.list.d/kubernetes.listdeb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial mainEOF## to view the installable version of apt-cache madison kubelet# install apt-get update & & apt-get update & & apt-get install-y kubelet=1.15.5-00 kubeadm=1.15.5-00 kubectl=1.15.5-00 synchronization time
Set time zone
Dpkg-reconfigure tzdata
Just choose Asia and Shanghai.
Time synchronization
# install ntpdateapt-get install ntpdate# to set system time to synchronize with network time (cn.pool.ntp.org 's public NTP server in China) ntpdate cn.pool.ntp.org# writes system time to hardware time hwclock-systohc
Confirmation time
The date# output is as follows (self-comparison is consistent with the system time) Sun Jun 2 22:02:35 CST 2019 modify cloud.cfg
The main function is to prevent hostname restore after reboot.
Vi / etc/cloud/cloud.cfg# this configuration defaults to false and can be modified to true for preserve_hostname: true individual node configuration
Edit the vi / etc/netplan/50-cloud-init.yaml configuration file and modify it as follows
Network: ethernets: ens33: addresses: [192.168.100.110/24] gateway4: 192.168.100.2 nameservers: addresses: [192.168.100.2] version: 2
Use the netplan apply command to make the configuration effective
Configure hostname # modify hostname hostnamectl set-hostname k8s-master# configuration hostscat > > / etc/hosts
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.