• heapset水平自动扩容


    influxdb.yaml安装文件内容

    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: monitoring-influxdb
      namespace: kube-system
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            task: monitoring
            k8s-app: influxdb
        spec:
          containers:
          - name: influxdb
            image: lanny/k8s.gcr.io_heapster-influxdb-amd64:v1.3.3
            volumeMounts:
            - mountPath: /data
              name: influxdb-storage
          volumes:
          - name: influxdb-storage
            emptyDir: {}
    ---
    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: monitoring-influxdb
      name: monitoring-influxdb
      namespace: kube-system
    spec:
      type: NodePort
      ports:
      - port: 8086
        targetPort: 8086
        nodePort: 30001
      selector:
        k8s-app: influxdb

    grafana.yaml安装文件内容

    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: monitoring-grafana
      namespace: kube-system
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            task: monitoring
            k8s-app: grafana
        spec:
          containers:
          - name: grafana
            image: lanny/k8s.gcr.io_heapster-grafana-amd64:v4.4.3
            ports:
            - containerPort: 3000
              protocol: TCP
            volumeMounts:
            - mountPath: /etc/ssl/certs
              name: ca-certificates
              readOnly: true
            - mountPath: /var
              name: grafana-storage
            env:
            - name: INFLUXDB_HOST
              value: monitoring-influxdb
            - name: GF_SERVER_HTTP_PORT
              value: "3000"
              # The following env variables are required to make Grafana accessible via
              # the kubernetes api-server proxy. On production clusters, we recommend
              # removing these env variables, setup auth for grafana, and expose the grafana
              # service using a LoadBalancer or a public IP.
            - name: GF_AUTH_BASIC_ENABLED
              value: "false"
            - name: GF_AUTH_ANONYMOUS_ENABLED
              value: "true"
            - name: GF_AUTH_ANONYMOUS_ORG_ROLE
              value: Admin
            - name: GF_SERVER_ROOT_URL
              # If you're only using the API Server proxy, set this value instead:
              # value: /api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
              value: /
          volumes:
          - name: ca-certificates
            hostPath:
              path: /etc/ssl/certs
          - name: grafana-storage
            emptyDir: {}
    ---
    apiVersion: v1
    kind: Service
    metadata:
      labels:
        # 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: monitoring-grafana
      name: monitoring-grafana
      namespace: kube-system
    spec:
      # In a production setup, we recommend accessing Grafana through an external Loadbalancer
      # or through a public IP.
      # type: LoadBalancer
      # You could also use NodePort to expose the service at a randomly-generated port
      #type: NodePort
      ports:
      - port: 80
        targetPort: 3000
        #nodePort: 40000
      selector:
        k8s-app: grafana

    heapster.yaml安装文件内容

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: heapster
      namespace: kube-system
    ---
    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: lanny/gcr.io_google_containers_heapster-amd64:v1.5.0
            #gcr.io/google_containers/heapster-amd64:v1.5.2
            imagePullPolicy: IfNotPresent
            command:
            - /heapster
            #- --source=kubernetes:https://kubernetes.default
            - --source=kubernetes:http://192.168.1.40:8080?inClusterConfig=false
            - --sink=influxdb:http://192.168.1.25:30001
    ---
    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:
      type: NodePort
      ports:
      - port: 80
        targetPort: 8082
        nodePort: 30002
      selector:
        k8s-app: heapster

    安装三个镜像

    kubectl create -f grafana.yaml
    kubectl create -f influxdb.yaml
    kubectl create -f heapster.yaml
  • 相关阅读:
    c# 获取计算机信息
    中文转换为完整拼音算法原理分析
    C#汉字转拼音(npinyin)将中文转换成拼音全文或首字母
    指定账户访问共享文件
    解决table边框在打印中不显示的问题
    SQL SERVER数据库备份时出现“操作系统错误5(拒绝访问)
    关于sql server 代理(已禁用代理xp)解决办法
    【架构】架构漫谈
    【Javascript】js图形编辑器库介绍
    【Web】前台传送JSON格式数据到后台Shell处理
  • 原文地址:https://www.cnblogs.com/wdzhz/p/11583491.html
Copyright © 2020-2023  润新知