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 ...
随机推荐
- 如何卸载docker
1.卸载 (1)yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ d ...
- 下载ez_setup
1.下载ez_setup链接:https://pypi.org/project/ez_setup/#files
- NYOJ 会场安排问题
#include<iostream> #include<stdio.h> #include<string.h> #include<queue> #inc ...
- Redis入门到高可用(九)——有序集合zset
一.数据结构 集合与有序集合,列表与有序集合的对比 二.主要API zadd 将一个或多个 member 元素及其 score 值加入到有序集 key 当中. zrem 移除有序集 key 中的一个或 ...
- java取得汉字拼音(pinyin4j)
jar包:pinyin4j.jar 基本用法: String[] pinyin = PinyinHelper.toHanyuPinyinStringArray('重'); 例如“重”字,该方法返回一个 ...
- [django]django配合前端vue前后端联调,django服务端解决跨域(django-cors-headers)
django内部csrf post提交数据解决 https://www.cnblogs.com/iiiiiher/articles/9164940.html 前端写了个页面,里面$.post发现403 ...
- Nginx配置虚拟主机
就是在一台服务器启动多个网站. 如何区分不同的网站: 1.域名不同 2.端口不同 在Nginx的安装目录的conf目录下有个配置文件nginx.conf 1.端口区分: 复制server节点,更改端口 ...
- python 根据字符串动态的生成变量名并且赋值
Python 动态的创建变量 一.子符串的形式 这是在今天的一个项目中,发现需要动态的创建很多变量.每个变量对应的值的来源都相同.在网上看了些资料,研究出了这个动态创建变量的牛逼方法. 所用的方法就是 ...
- zabbix 监控 ElasticSearch
ElasticSearch 可以直接使用zabbix官方的模板 模板地址: https://github.com/mkhpalm/elastizabbix 通过zabbix server 直接监控 ...
- [LeetCode] 98. Validate Binary Search Tree_Medium
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as ...