使用阿里巴巴開源映象站映象——Kubernetes 映象

哈哈哈hh發表於2022-01-11

映象下載、域名解析、時間同步請點選  阿里雲開源映象站

Kubernetes 映象簡介

Kubernetes 是一個開源系統,用於容器化應用的自動部署、擴縮和管理。它將構成應用的容器按邏輯單位進行分組以便於管理和發現。

下載地址:

Kubernetes 映象配置方法

基於CentOS / RHEL / Fedora系統配置方法

(1)檢視系統版本資訊

[root@centos ~]# hostnamectl
   Static hostname: centos
         Icon name: computer-vm
           Chassis: vm
        Machine ID: f6fc8fb7991c4c518238af7c75f16046
           Boot ID: baa5dae1c7614a0790ac9c3b5c0a9b7b
    Virtualization: vmware
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-1160.el7.x86_64
      Architecture: x86-64

(2)新增並檢視  Kubernetes.repo YUM源

[root@centos ~]# cat <<EOF > /etc/yum.repos.d/kubernetes.repo
> [kubernetes]
> name=Kubernetes
> baseurl=
> enabled=1
> gpgcheck=1
> repo_gpgcheck=1
> gpgkey=
> EOF
[root@centos ~]# cat /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=
[root@centos ~]#

PS:由於官網未開放同步方式, 可能會有索引gpg檢查失敗的情況, 這時請用  yum install -y --nogpgcheck kubelet kubeadm kubectl 安裝

(3)關閉或允許SELINUX安全模式

①  執行 setenforce 0命令,暫時允許SELINUX安全模式放行通過。重啟失效。

[root@centos ~]# setenforce 0
[root@centos ~]# getenforce
permissive

②  編輯 /etc/selinux/config配置檔案,儲存退出,重啟生效。

[root@centos ~]# vim /etc/selinux/config
[root@centos ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@centos ~]# getenforce
Disabled

(4)安裝kubernetes

[root@centos ~]# yum install -y kubelet kubeadm kubectl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Package kubelet-1.22.4-0.x86_64 already installed and latest version
Package kubeadm-1.22.4-0.x86_64 already installed and latest version
Package kubectl-1.22.4-0.x86_64 already installed and latest version
Nothing to do
[root@centos ~]#

file

(5)啟動kubernetes

[root@centos ~]# systemctl start kubelet
[root@centos ~]# systemctl enable kubelet
Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.

本文轉自: xuyebao


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2851636/,如需轉載,請註明出處,否則將追究法律責任。

相關文章