• 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

  • 相关阅读:
    "pom.xml" could not be activated because it does not exist.
    spring boot启动STS 运行报错 java.lang.NoClassDefFoundError: ch/qos/logback/classic/LoggerContext
    @SpringBootApplication cannot be resolved to a type In STS
    Maven搭建之后的设置
    自动化部署工具
    康威定律
    Thrift简介
    JVM分代通俗解释
    过滤器和监听器之间的区别
    Configuring WS-Security UsernameToken and WS-SecureConversation (Symmetric Connection Creation)
  • 原文地址:https://www.cnblogs.com/Heroge/p/12898652.html
Copyright © 2020-2023  润新知