关于阿里云:阿里云镜像使用阿里巴巴开源镜像站镜像Kubernetes-镜像

7次阅读

共计 2631 个字符,预计需要花费 7 分钟才能阅读完成。

一、参考链接

阿里巴巴开源镜像站:阿里巴巴开源镜像站

阿里镜像站—Kubernetes 镜像:Kubernetes 镜像

二、Kubernetes 镜像简介

Kubernetes 是一个开源零碎,用于容器化利用的主动部署、扩缩和治理。它将形成利用的容器按逻辑单位进行分组以便于管理和发现。

下载地址:https://mirrors.aliyun.com/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=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
> enabled=1
> gpgcheck=1
> repo_gpgcheck=1
> gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
> EOF
[root@centos ~]# cat /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
[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 ~]#

(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.
正文完
 0