kubernetes install for centos
官方的文档写的很清楚
https://kubernetes.io/docs/getting-started-guides/centos/centos_manual_config/
如果已经安装过docker需要卸载
yum remove docker-engine
安装还是有冲突
[root@here ~]# rpm -aq | grep docker
docker-common-1.10.3-59.el7.centos.x86_64
[root@here ~]# yum remove docker…………
[root@here ~]# rpm -qa | grep container-selinux
增加yum repo
container-selinux-1.10.3-59.el7.centos.x86_64
修改/etc/yum.repos.d/virt7-docker-common-release.repo
[virt7-docker-common-release]
name=virt7-docker-common-release
baseurl=http://cbs.centos.org/repos/virt7-docker-common-release/x86_64/os/
gpgcheck=0
安装组件
yum -y install --enablerepo=virt7-docker-common-release kubernetes etcd flannel
假设机器地址为
echo "192.168.121.9 centos-master
192.168.121.65 centos-minion-1
192.168.121.66 centos-minion-2
192.168.121.67 centos-minion-3" >> /etc/hosts
配置 /etc/kubernetes/config 同步到所有服务器
# logging to stderr means we get it in the systemd journal
KUBE_LOGTOSTDERR="--logtostderr=true"
# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"
# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false"
# How the replication controller and scheduler find the kube-apiserver
KUBE_MASTER="--master=http://centos-master:8080"
关闭防火墙
setenforce 0
配置主节点etcd
systemctl disable iptables-services firewalld
systemctl stop iptables-services firewalld
/etc/etcd/etcd.conf
# [member]
ETCD_NAME=default
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
#[cluster]
ETCD_ADVERTISE_CLIENT_URLS="http://0.0.0.0:2379"
配置主节点 /etc/kubernetes/apiserver
# The address on the local server to listen to.
KUBE_API_ADDRESS="--address=0.0.0.0"
# The port on the local server to listen on.
KUBE_API_PORT="--port=8080"
# Port kubelets listen on
KUBELET_PORT="--kubelet-port=10250"
# Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd-servers=http://centos-master:2379"
# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# Add your own!
KUBE_API_ARGS=""
启动etcd
systemctl start etcd
etcdctl mkdir /kube-centos/network
etcdctl mk /kube-centos/network/config "{ \"Network\": \"172.30.0.0/16\", \"SubnetLen\": 24, \"Backend\": { \"Type\": \"vxlan\" } }"
配置所有机器的 /etc/sysconfig/flanneld
# Flanneld configuration options
# etcd url location. Point this to the server where etcd runs
FLANNEL_ETCD_ENDPOINTS="http://centos-master:2379"
# etcd config key. This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_PREFIX="/kube-centos/network"
# Any additional options that you want to pass
#FLANNEL_OPTIONS=""
主节点启动服务
for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler flanneld; do
启动api-server的时候报错
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl status $SERVICES
done
unable to load server certificate: open /var/run/kubernetes/apiserver.key: permission denied
修改了文件的全险为755可以通过 查看浏览器 https://master-ip:6443/swagger-ui 在胚胎机器上配置 /etc/kubernetes/kubelet
# The address for the info server to serve on
KUBELET_ADDRESS="--address=0.0.0.0"
# The port for the info server to serve on
KUBELET_PORT="--port=10250"
# You may leave this blank to use the actual hostname
# Check the node number!
KUBELET_HOSTNAME="--hostname-override=centos-minion-n"
# Location of the api-server
KUBELET_API_SERVER="--api-servers=http://centos-master:8080"
# Add your own!
KUBELET_ARGS=""
在节点上启动服务
for SERVICES in kube-proxy kubelet flanneld docker; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl status $SERVICES
done
配置 kubectl (配置一次即可 其他机器共享)
kubectl config set-cluster default-cluster --server=http://centos-master:8080
kubectl config set-context default-context --cluster=default-cluster --user=default-admin
kubectl config use-context default-context
运行检查
$ kubectl get nodes
NAME LABELS STATUS
centos-minion-1 <none> Ready
centos-minion-2 <none> Ready
centos-minion-3 <none> Ready
kubernetes install for centos的更多相关文章
- How to: cgminer (Bitcoin, Litecoin etc.) + AMD Radeon driver install on CentOS
UPDATE 7/7/13: If you want to use Catalyst drivers version 12.8 you will find that X won’t start (er ...
- kubernetes里面有时候centos源用不了
kubernetes里面有时候centos源用不了,快速配一个阿里云的源. mkdir /etc/yum.repos.d/yangback;mv /etc/yum.repos.d/* /etc/yum ...
- centos7 install k8s centos 安装 kubernetes 详细
参考: http://blog.opskumu.com/k8s-cluster-centos7.html https://ylinux.org/note/article/1207 http://mub ...
- glibc2.14 install from centos
安装glibc2.14 Tar xf glibc-2.14.tar.gz Cd glibc-2.14 Mkdir build Cd build ../configure –prefix=/opt/gl ...
- nginx install in centos
1.在nginx下载rpm包,如nginx-release-centos-6-0.el6.ngx.noarch.rpm ,并安装(可用yum直接安装): 注:rpm包只是提供一个nginx源. 2.使 ...
- RabbitMq install on Centos
安装服务(root) erlang官方安装说明:https://www.erlang-solutions.com/resources/download.html step 1: 安装erlang的yu ...
- How To install FFMPEG, FLVTOOL2, MP4Box on CentOS server 2015 easy method
for i386:wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpmrpm ...
- Install Google Chrome on Fedora 28/27, CentOS/RHEL 7.5 (在 fedora 28 等 上 安装 chrome)
今天在使用 fedora 安装 chrome 的时候遇到了问题,今天进行将安装过程进行记录下来.需要安装第三方软件仓库. 我们需要进行安装 fedora-workstation-repositorie ...
- Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11
MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user ...
随机推荐
- 遇到Visual Studio "当前不会命中断点.还没有为该文档加载任何符号"的情况
一.问题及原因 有这样一种调用逻辑:A.exe调用B.dll.现在想要在B的源代码中打断点,从A发起进行调试,却给出了"当前不会命中断点.还没有为该文档加载任何符号"的提示.感觉十 ...
- python-类属性和对象属性(转)
class People(object): # 类属性是指定义在类的内部而且在方法的外部的属性 money = 10000 def __init__(self,name,age,gender=1): ...
- sqlserver把数据导入mysql
sqlserver库 navicat逆向表到模型 转换模型为... 选择mysql 建模转换后导出sql 导出sql后,再mysql库中执行该sql(该sql为表结构)执行sql后,使用navicat ...
- 阿里云香港主机自动换IP
为什么要写这个脚本原因你懂的,现在都是直接封IP pip3 install aliyun-python-sdk-alidns aliyun-python-sdk-domain aliyun-pytho ...
- python接口测试-充值
import requests import json import unittest import HTMLTestRunner telphone =18200717087 #参数化手机号码 ur1 ...
- [Java in NetBeans] Lesson 08. If: conditional statement
这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. If-else statement if (x > 5) { System.out.println("Inpu ...
- shell实现SSH自动登陆【转】
前言 公司开发使用docker,每次登陆自己开发机总要输入 ssh user_name@ip_string,然后再确认输入password,手快了还经常会输错.作为一个懒人,肯定要找一个取巧的方式,查 ...
- CentOS6.5 安装Storm集群
1.首先安装依赖包 [root@Hadoop-NN-01 ~]# yum install uuid* [root@Hadoop-NN-01 ~]# yum install libuuid [root@ ...
- eclipse签名使用的key文件(android生成keystore)
命令行(或终端)生成keystore文件 在命令行(或终端)输入命令: keytool -genkey -alias Gallery.keystore -keyalg RSA -validit ...
- Nodejs中原生遍历文件夹
最近在听老师讲的node课程,有个关于把异步变为同步读取文件夹的知识点做一些笔记, 让迭代器逐个自执行.