码迷,mamicode.com
首页 > 其他好文 > 详细

K8S 1.9.0二进制包部署(三)

时间:2018-02-05 15:11:36      阅读:405      评论:0      收藏:0      [点我收藏+]

标签:pull   nod   分发   host   tar   https   rri   无法   network   

4、k8s node
#############kubelet

cp kubelet /usr/bin/
chmod 755 /usr/bin/kubelet
mkdir -p /app/kubernetes/data
mkdir -p /app/kubernetes/conf
mkdir -p /app/kubernetes/log

vi /usr/lib/systemd/system/kubelet.service
[Unit]
Description=Kubernetes Kubelet Server
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
After=docker.service
Requires=docker.service
[Service]
WorkingDirectory=/app/kubernetes/data
EnvironmentFile=/app/kubernetes/conf/kubelet
ExecStart=/usr/bin/kubelet $KUBELET_ARGS
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

vi /app/kubernetes/conf/kubelet
KUBELET_ARGS="--kubeconfig=/app/kubernetes/conf/kubelet.kubeconfig --fail-swap-on=false --hostname-override=192.168.254.54 --pod-infra-container-image=mirrorgooglecontainers/pause-amd64:3.0 --logtostderr=false --log-dir=/app/kubernetes/log --v=2"
hostname-override=参数是指定名字,如果不写此参数默认是主机hostname名。
--pod-infra-container-image= 改写一个可下载镜像的地址,此image如果pull不了会导致分发无法创建pod
kubeconfig配置文件参考http://www.jianshu.com/p/41e55f4d0cb8

vi /app/kubernetes/conf/kubelet.kubeconfig
apiVersion: v1
kind: Config
clusters:

  • cluster:
    server: http://192.168.254.53:8080 #此处输入集群master地址
    name: local
    contexts:
  • context:
    cluster: local
    name: local
    current-context: local

systemctl daemon-reload
systemctl enable kubelet.service
systemctl start kubelet.service
systemctl status kubelet.service

#############kube-proxy

cp kube-proxy /usr/bin/
chmod 755 /usr/bin/kube-proxy

vi /usr/lib/systemd/system/kube-proxy.service
[Unit]
Description=Kubernetes Kube-Proxy Server
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
After=network.target
Requires=network.service
[Service]
EnvironmentFile=/app/kubernetes/conf/proxy
ExecStart=/usr/bin/kube-proxy $KUBE_PROXY_ARGS
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target

vi /app/kubernetes/conf/proxy
KUBE_PROXY_ARGS="--master=http://192.168.254.53:8080 --logtostderr=false --log-dir=/app/kubernetes/log --v=2"#此处输入集群master地址

systemctl daemon-reload
systemctl enable kube-proxy.service
systemctl start kube-proxy.service
systemctl status kube-proxy.service

K8S 1.9.0二进制包部署(三)

标签:pull   nod   分发   host   tar   https   rri   无法   network   

原文地址:http://blog.51cto.com/285534/2068962

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