kubernetes v1.18.2二进制部署 ipv4 controller-manager 部署

2021-03-11 10:28

阅读:501

标签:moni   log   ystemd   itme   sch   fail   new   ati   monit   

签发 kube-controller-manager 证书
# 设置连接KUBE_APISERVER ip
export KUBE_APISERVER=https://127.0.0.1:5443
# 环境变量沿用kube-apiserver
# 创建 Kubernetes Controller Manager 配置文件
cat 

kube-controller-manager 二进制文件准备

# 进入二进制所在文件夹
cd ${HOST_PATH}/kubernetes/server/bin
scp -r kube-controller-manager 192.168.2.175:/apps/k8s/bin
scp -r kube-controller-manager 192.168.2.176:/apps/k8s/bin
scp -r kube-controller-manager 192.168.2.177:/apps/k8s/bin

kube-controller-manager 配置文件

cd ${HOST_PATH}
# 创建 kube-controller-manager
cat 

创建 kube-controller-manager systemd文件

cat 

kube-controller-manager 启动准备

# 给/apps/k8s k8s 用户权限
ssh  192.168.2.175 chown -R k8s:root /apps/k8s
ssh  192.168.2.176 chown -R k8s:root /apps/k8s
ssh  192.168.2.177 chown -R k8s:root /apps/k8s

kube-controller-manager

# 刷新service
ssh  192.168.2.175 systemctl daemon-reload
ssh  192.168.2.176 systemctl daemon-reload
ssh  192.168.2.177 systemctl daemon-reload
# 设置开机启动
ssh  192.168.2.175 systemctl enable kube-controller-manager.service
ssh  192.168.2.176 systemctl enable kube-controller-manager.service
ssh  192.168.2.177 systemctl enable kube-controller-manager.service
# 启动 kube-apiserver
ssh  192.168.2.175 systemctl  start kube-controller-manager.service
ssh  192.168.2.176 systemctl  start kube-controller-manager.service
ssh  192.168.2.177 systemctl  start kube-controller-manager.service
# 查看启动状态
ssh  192.168.2.175 systemctl  status kube-controller-manager.service
ssh  192.168.2.176 systemctl  status kube-controller-manager.service
ssh  192.168.2.177 systemctl  status kube-controller-manager.service

验证 kube-controller-manager 是否启动成功

root@Qist:/tmp/sss# kubectl get cs
NAME                 STATUS      MESSAGE                                                                                     ERROR
scheduler            Unhealthy   Get http://127.0.0.1:10251/healthz: dial tcp 127.0.0.1:10251: connect: connection refused
controller-manager   Healthy     ok
etcd-1               Healthy     {"health":"true"}
etcd-0               Healthy     {"health":"true"}
etcd-2               Healthy     {"health":"true"}
# 查看kube-controller-manager master 节点 
root@Qist:/tmp/sss# kubectl -n kube-system get endpoints kube-controller-manager -o yaml
apiVersion: v1
kind: Endpoints
metadata:
  annotations:
    control-plane.alpha.kubernetes.io/leader: ‘{"holderIdentity":"k8s-master-2_85edb989-d5fa-4be3-aaf2-7cb34aee72eb","leaseDurationSeconds":15,"acquireTime":"2020-05-06T10:03:30Z","renewTime":"2020-05-06T10:03:30Z","leaderTransitions":15}‘
  creationTimestamp: "2020-05-06T09:59:07Z"
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:control-plane.alpha.kubernetes.io/leader: {}
    manager: kube-controller-manager
    operation: Update
    time: "2020-05-06T10:03:30Z"
  name: kube-controller-manager
  namespace: kube-system
  resourceVersion: "1969"
  selfLink: /api/v1/namespaces/kube-system/endpoints/kube-controller-manager
  uid: c4102892-c95c-487f-9bff-266f6898a4d2
    # k8s-master-2 为master 节点。

kubernetes v1.18.2二进制部署 ipv4 controller-manager 部署

标签:moni   log   ystemd   itme   sch   fail   new   ati   monit   

原文地址:https://blog.51cto.com/juestnow/2492856


评论


亲,登录后才可以留言!