博客列表 >【阿里云镜像】使用阿里巴巴开源镜像站镜像——Kubernetes 镜像

【阿里云镜像】使用阿里巴巴开源镜像站镜像——Kubernetes 镜像

大宝
大宝原创
2021年12月07日 13:53:45860浏览

一、参考链接

阿里巴巴开源镜像站:阿里巴巴开源镜像站
阿里镜像站—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=Kubernetesbaseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/enabled=1gpgcheck=1repo_gpgcheck=1gpgkey=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 ~]# getenforcepermissive

编辑/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 ~]# getenforceDisabled

(4)安装kubernetes

[root@centos ~]# yum install -y kubelet kubeadm kubectlLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comPackage kubelet-1.22.4-0.x86_64 already installed and latest versionPackage kubeadm-1.22.4-0.x86_64 already installed and latest versionPackage kubectl-1.22.4-0.x86_64 already installed and latest versionNothing to do[root@centos ~]#

在这里插入图片描述

(5)启动kubernetes

[root@centos ~]# systemctl start kubelet[root@centos ~]# systemctl enable kubeletCreated symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议