码迷,mamicode.com
首页 > Web开发 > 详细

六、Kubernetes_V1.10集群部署-node-部署节点组件

时间:2018-07-05 19:43:24      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:div   start   override   -o   lse   部署   ber   work   file   

一、配置kubelet

1.配置启动文件

# cat > /usr/lib/systemd/system/kubelet.service <<EOF
[Unit]
Description=Kubernetes Kubelet
After=docker.service
Requires=docker.service

[Service]
EnvironmentFile=-/etc/kubernetes/kubelet
ExecStart=/usr/bin/kubelet \$KUBELET_OPTS
Restart=on-failure
KillMode=process

[Install]
WantedBy=multi-user.target
EOF

 

2.配置kubelet参数文件

# cat > /etc/kubernetes/kubelet <<EOF
KUBELET_OPTS="--logtostderr=true \
--v=4 --address=172.18.6.40 --hostname-override=172.18.6.40 --kubeconfig=/etc/kubernetes/kubeconfig.yaml --experimental-bootstrap-kubeconfig=/etc/kubernetes/bootstrap.kubeconfig --cert-dir=/etc/kubernetes/ssl --allow-privileged=true --cluster-dns=172.30.0.2 --cluster-domain=cluster.local --fail-swap-on=false --pod-infra-container-image=reg.baicm.com.cn/kubernetes/pause-amd64:3.1"
EOF

3.生成kubelet配置文件

# cat > /etc/kubernetes/kubeconfig.yaml <<EOF
apiVersion: v1
kind: Config
users:
- name: kubelet
  user:
    client-certificate: /etc/kubernetes/ssl/admin.pem
    client-key: /etc/kubernetes/ssl/admin-key.pem
clusters:
- name: local
  cluster: 
    certificate-authority: /etc/kubernetes/ssl/ca.pem
    server: https://172.18.6.39:6443  #master
contexts:
- context:
    cluster: local
    user: kubelet
  name: my-context
current-context: my-context
EOF

4.启动服务

# systemctl start kubelet
# systemctl enable kubelet

二、配置kube-proxy

1.生成启动文件

cat <<EOF >/usr/lib/systemd/system/kube-proxy.service
[Unit]
Description=Kubernetes Proxy
After=network.target

[Service]
EnvironmentFile=-/etc/kubernetes/kube-proxy
ExecStart=/usr/bin/kube-proxy \$KUBE_PROXY_OPTS
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

2.生成参数配置文件

# cat <<EOF >/etc/kubernetes/kube-proxy
KUBE_PROXY_OPTS="--logtostderr=true \\
--v=4 \--hostname-override=172.18.6.40 \--kubeconfig=/etc/kubernetes/kube-proxy.kubeconfig"
EOF

3.启动kube-proxy

# systemctl start kube-proxy
# systemctl enable kube-proxy

 

六、Kubernetes_V1.10集群部署-node-部署节点组件

标签:div   start   override   -o   lse   部署   ber   work   file   

原文地址:https://www.cnblogs.com/dingkailinux/p/9269736.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!