zoukankan      html  css  js  c++  java
  • Kubernets二进制安装(18)之安装部署Heapster

    1.下载heapster镜像

    在运维主机(mfyxw50.mfyxw.com)执行

    [root@mfyxw50 ~]# docker pull quay.io/bitnami/heapster:1.5.4
    

    image-20200516074458428

    2.对heapster打标签并上传至私有仓库

    在运维主机(mfyxw50.mfyxw.com)执行

    [root@mfyxw50 ~]# docker images | grep heapster
    [root@mfyxw50 ~]# docker tag quay.io/bitnami/heapster:1.5.4 harbor.od.com/public/heapster:v1.5.4
    [root@mfyxw50 ~]# docker login harbor.od.com
    [root@mfyxw50 ~]# docker push harbor.od.com/public/heapster:v1.5.4
    

    image-20200516074829483

    3.准备heapster资源配置清单

    在运维主机(mfyxw50.mfyxw.com)上执行

    [root@mfyxw50 ~]# mkdir -p /data/k8s-yaml/heapster
    [root@mfyxw50 ~]# cd /data/k8s-yaml/heapster
    

    heapster的rbac.ymal资源配置清单如下:

    [root@mfyxw50 heapster]# cat > /data/k8s-yaml/heapster/rbac.yaml << EOF
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: heapster
      namespace: kube-system
    ---
    kind: ClusterRoleBinding
    apiVersion: rbac.authorization.k8s.io/v1beta1
    metadata:
      name: heapster
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: system:heapster
    subjects:
    - kind: ServiceAccount
      name: heapster
      namespace: kube-system
    EOF
    

    heapster的deployment.yaml资源配置清单如下:

    [root@mfyxw50 heapster]# cat > /data/k8s-yaml/heapster/deployment.yaml << EOF
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: heapster
      namespace: kube-system
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            task: monitoring
            k8s-app: heapster
        spec:
          serviceAccountName: heapster
          containers:
          - name: heapster
            image: harbor.od.com/public/heapster:v1.5.4
            imagePullPolicy: IfNotPresent
            command:
            - /opt/bitnami/heapster/bin/heapster
            - --source=kubernetes:https://kubernetes.default
    EOF
    

    heapster的svc.yaml资源配置清单如下:

    [root@mfyxw50 heapster]# cat > /data/k8s-yaml/heapster/svc.yaml << EOF
    apiVersion: v1
    kind: Service
    metadata:
      labels:
        task: monitoring
        # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
        # If you are NOT using this as an addon, you should comment out this line.
        kubernetes.io/cluster-service: 'true'
        kubernetes.io/name: Heapster
      name: heapster
      namespace: kube-system
    spec:
      ports:
      - port: 80
        targetPort: 8082
      selector:
        k8s-app: heapster
    EOF
    

    4.应用heapster资源配置清单

    在master节点(mfyxw30.mfyxw.com或mfyxw40.mfyxw.com)任意一台上执行命令即可

    [root@mfyxw30 ~]# kubectl apply -f http://k8s-yaml.od.com/heapster/rbac.yaml
    [root@mfyxw30 ~]# kubectl apply -f http://k8s-yaml.od.com/heapster/deployment.yaml
    [root@mfyxw30 ~]# kubectl apply -f http://k8s-yaml.od.com/heapster/svc.yaml
    

    image-20200516075649041

    5.重新登录dashboard查看

    image-20200516080015337

  • 相关阅读:
    责任链模式小试
    C++学习笔记(3)
    C++学习笔记(2)
    C++学习笔记(1)
    基本排序(二)插入排序(直接插入、Shell、折半)
    基本排序(一)交换排序(冒泡、快速)
    Spring Initializr生成的demo测试404错误
    Java生成二进制文件与Postman以二进制流的形式发送请求
    SSH工具脚本录入
    Spring Bean自动注册的实现方案
  • 原文地址:https://www.cnblogs.com/Heroge/p/12898652.html
Copyright © 2011-2022 走看看