CentOS 7.5单机安装Kubernetes(2)

Installed:
  etcd.x86_64 0:3.3.11-2.el7.centos                                              kubernetes.x86_64 0:1.5.2-0.7.git269f928.el7                                             

Complete!

修改配置
/etc/sysconfig/docker 修改OPTIONS='--selinux-enabled=false --insecure-registry gcr.io'并重启docker
/etc/kubernetes/apiserver KUBE_ADMISSION_CONTROL项删除ServiceAccount

[root@localhost yum.repos.d]# vi /etc/sysconfig/docker

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
##OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'
OPTIONS='--selinux-enabled=false --insecure-registry gcr.io'
if [ -z "${DOCKER_CERT_PATH}" ]; then
    DOCKER_CERT_PATH=/etc/docker
fi

# Do not add registries in this file anymore. Use /etc/containers/registries.conf
# instead. For more information reference the registries.conf(5) man page.

# Location used for temporary files, such as those created by
# docker load and build operations. Default is /var/lib/docker/tmp
# Can be overriden by setting the following environment variable.
# DOCKER_TMPDIR=/var/tmp

# Controls the /etc/cron.daily/docker-logrotate cron job status.
# To disable, uncomment the line below.
# LOGROTATE=false

# docker-latest daemon can be used by starting the docker-latest unitfile.
# To use docker-latest client, uncomment below lines
Entering Ex mode.  Type "visual" to go to Normal mode.
:wq
"/etc/sysconfig/docker" 27L, 1157C written
[root@localhost yum.repos.d]# service docker restart
Redirecting to /bin/systemctl restart docker.service
[root@localhost yum.repos.d]# vi /etc/kubernetes/apiserver

###
# kubernetes system config
#
# The following values are used to configure the kube-apiserver
#

# The address on the local server to listen to.
KUBE_API_ADDRESS="--insecure-bind-address=127.0.0.1"

# The port on the local server to listen on.
# KUBE_API_PORT="--port=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"
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ResourceQuota"

Entering Ex mode.  Type "visual" to go to Normal mode.
:wq
"/etc/kubernetes/apiserver" 27L, 894C written

4.启动服务
启动服务:systemctl start serviceName 或者 service serviceName start
查看状态:systemctl status serviceName 或者 service serviceName status

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/1fc3446ea974cdb3376483cc5ffa8e1d.html