搜狐首页 科技 心里的声音

手机搜狐

SOHU.COM

Kubernetes学习笔记---安装

Kubernetes安装环境

Centos7.1系统的机器3台

Master:192.168.0.120

Nodes:192.168.0.106,192.168.0.107

=====

Master

=====

1在Master上安装kubernetesetcdflannel

yuminstallkubernetes etcd flannel -y

2 修改配置文件/etc/kubernetes/controller-manager

#指定key文件,key文件可以通过命令生成:openssl genrsa -out /etc/kubernetes/service.key 2048

KUBE_CONTROLLER_MANAGER_ARGS="--service_account_private_key_file=/etc/kubernetes/service.key"

3 修改配置文件/etc/kubernetes/apiserver

# The address on the local server to listen to. 设为全部监听

KUBE_API_ADDRESS="--address=0.0.0.0"

# Comma separated list of nodes in the etcd cluster . 指定etcd节点的地址

KUBE_ETCD_SERVERS="--etcd-servers=http://192.168.0.120:2379"

# Address range to use for services. 这个是设置今后运行Service所在的ip网段

KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=192.168.1.0/24"

# Add your own! 指定key文件

KUBE_API_ARGS="--service_account_key_file=/etc/kubernetes/service.key"

4 修改配置文件/etc/kubernetes/config

# How the controller-manager, scheduler, and proxy find the apiserver

KUBE_MASTER="--master=http://192.168.0.120:8080"

精选