4)Kubernetes配置(仅Master主机)
master运行三个组件,包括apiserver、scheduler、controller-manager,相关配置项也只涉及这三块。
4.1、【/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 controller-manager, scheduler, and proxy find the apiserver
KUBE_MASTER="--master=http://127.0.0.1:8080"
# Comma seperated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd_servers=http://192.168.1.20:4001"
4.2、【/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"
# How the replication controller and scheduler find the kube-apiserver
KUBE_MASTER="--master=192.168.1.20:8080"
# Port minions listen on
KUBELET_PORT="--kubelet-port=10250"
# Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd-servers=http://127.0.0.1:2379"
# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.254.0.0/16"
# default admission control policies
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
# Add your own!
KUBE_API_ARGS=""
4.3、【/etc/kubernetes/controller-manager】
# Comma seperated list of minions
KUBELET_ADDRESSES="--machines= 192.168.1.21,192.168.1.100"
# Add your own!
KUBE_CONTROLLER_MANAGER_ARGS=""
4.4、【/etc/kubernetes/scheduler】
# Add your own!
KUBE_SCHEDULER_ARGS=""