kubernetes-handbook/practice/heapster-addon-installation...

1614 lines
72 KiB
HTML
Raw Normal View History

2017-08-21 17:44:43 +08:00
<!DOCTYPE HTML>
<html lang="zh-cn" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>4.1.9 安装heapster插件 · Kubernetes Handbook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<meta name="author" content="Jimmy Song">
<link rel="stylesheet" href="../gitbook/style.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-page-toc-button/plugin.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-image-captions/image-captions.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-page-footer-ex/style/plugin.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="efk-addon-installation.html" />
<link rel="prev" href="dashboard-addon-installation.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="輸入並搜尋" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="1.1" data-path="../">
<a href="../">
1. 前言
</a>
</li>
<li class="chapter " data-level="1.2" data-path="../concepts/">
<a href="../concepts/">
2. 概念原理
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="../concepts/concepts.html">
<a href="../concepts/concepts.html">
2.1 设计理念
</a>
</li>
<li class="chapter " data-level="1.2.2" data-path="../concepts/objects.html">
<a href="../concepts/objects.html">
2.2 主要概念
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.2.1" data-path="../concepts/pod-overview.html">
<a href="../concepts/pod-overview.html">
2.2.1 Pod
</a>
<ul class="articles">
<li class="chapter " data-level="1.2.2.1.1" data-path="../concepts/pod.html">
<a href="../concepts/pod.html">
2.2.1.1 Pod解析
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2.2.2" data-path="../concepts/node.html">
<a href="../concepts/node.html">
2.2.2 Node
</a>
</li>
<li class="chapter " data-level="1.2.2.3" data-path="../concepts/namespace.html">
<a href="../concepts/namespace.html">
2.2.3 Namespace
</a>
</li>
<li class="chapter " data-level="1.2.2.4" data-path="../concepts/service.html">
<a href="../concepts/service.html">
2.2.4 Service
</a>
</li>
<li class="chapter " data-level="1.2.2.5" data-path="../concepts/volume.html">
<a href="../concepts/volume.html">
2.2.5 Volume和Persistent Volume
</a>
</li>
<li class="chapter " data-level="1.2.2.6" data-path="../concepts/deployment.html">
<a href="../concepts/deployment.html">
2.2.6 Deployment
</a>
</li>
<li class="chapter " data-level="1.2.2.7" data-path="../concepts/secret.html">
<a href="../concepts/secret.html">
2.2.7 Secret
</a>
</li>
<li class="chapter " data-level="1.2.2.8" data-path="../concepts/statefulset.html">
<a href="../concepts/statefulset.html">
2.2.8 StatefulSet
</a>
</li>
<li class="chapter " data-level="1.2.2.9" data-path="../concepts/daemonset.html">
<a href="../concepts/daemonset.html">
2.2.9 DaemonSet
</a>
</li>
<li class="chapter " data-level="1.2.2.10" data-path="../concepts/serviceaccount.html">
<a href="../concepts/serviceaccount.html">
2.2.10 ServiceAccount
</a>
</li>
<li class="chapter " data-level="1.2.2.11" data-path="../concepts/replicaset.html">
<a href="../concepts/replicaset.html">
2.2.11 ReplicationController和ReplicaSet
</a>
</li>
<li class="chapter " data-level="1.2.2.12" data-path="../concepts/job.html">
<a href="../concepts/job.html">
2.2.12 Job
</a>
</li>
<li class="chapter " data-level="1.2.2.13" data-path="../concepts/cronjob.html">
<a href="../concepts/cronjob.html">
2.2.13 CronJob
</a>
</li>
<li class="chapter " data-level="1.2.2.14" data-path="../concepts/ingress.html">
<a href="../concepts/ingress.html">
2.2.14 Ingress
</a>
</li>
<li class="chapter " data-level="1.2.2.15" data-path="../concepts/configmap.html">
<a href="../concepts/configmap.html">
2.2.15 ConfigMap
</a>
</li>
<li class="chapter " data-level="1.2.2.16" data-path="../concepts/horizontal-pod-autoscaling.html">
<a href="../concepts/horizontal-pod-autoscaling.html">
2.2.16 Horizontal Pod Autoscaling
</a>
</li>
<li class="chapter " data-level="1.2.2.17" data-path="../concepts/label.html">
<a href="../concepts/label.html">
2.2.17 Label
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" data-path="../guide/">
<a href="../guide/">
3. 用户指南
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="../guide/resource-configuration.html">
<a href="../guide/resource-configuration.html">
3.1 资源配置
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.1.1" data-path="../guide/configure-liveness-readiness-probes.html">
<a href="../guide/configure-liveness-readiness-probes.html">
3.1.1 配置Pod的liveness和readiness探针
</a>
</li>
<li class="chapter " data-level="1.3.1.2" data-path="../guide/configure-pod-service-account.html">
<a href="../guide/configure-pod-service-account.html">
3.1.2 配置Pod的Service Account
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3.2" data-path="../guide/command-usage.html">
<a href="../guide/command-usage.html">
3.2 命令使用
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.2.1" data-path="../guide/using-kubectl.html">
<a href="../guide/using-kubectl.html">
3.2.1 使用kubectl
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3.3" data-path="../guide/cluster-management.html">
<a href="../guide/cluster-management.html">
3.3 集群管理
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.3.1" data-path="../guide/managing-tls-in-a-cluster.html">
<a href="../guide/managing-tls-in-a-cluster.html">
3.3.1 管理集群中的TLS
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3.4" data-path="../guide/access-kubernetes-cluster.html">
<a href="../guide/access-kubernetes-cluster.html">
3.4 访问 Kubernetes 集群
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.4.1" data-path="../guide/access-cluster.html">
<a href="../guide/access-cluster.html">
3.4.1 访问集群
</a>
</li>
<li class="chapter " data-level="1.3.4.2" data-path="../guide/authenticate-across-clusters-kubeconfig.html">
<a href="../guide/authenticate-across-clusters-kubeconfig.html">
3.4.2 使用 kubeconfig 文件配置跨集群认证
</a>
</li>
<li class="chapter " data-level="1.3.4.3" data-path="../guide/connecting-to-applications-port-forward.html">
<a href="../guide/connecting-to-applications-port-forward.html">
3.4.3 通过端口转发访问集群中的应用程序
</a>
</li>
<li class="chapter " data-level="1.3.4.4" data-path="../guide/service-access-application-cluster.html">
<a href="../guide/service-access-application-cluster.html">
3.4.4 使用 service 访问群集中的应用程序
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3.5" data-path="../guide/application-development-deployment-flow.html">
<a href="../guide/application-development-deployment-flow.html">
3.5 在kubernetes中开发部署应用
</a>
<ul class="articles">
<li class="chapter " data-level="1.3.5.1" data-path="../guide/deploy-applications-in-kubernetes.html">
<a href="../guide/deploy-applications-in-kubernetes.html">
3.5.1 适用于kubernetes的应用开发部署流程
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" data-path="./">
<a href="./">
4. 最佳实践
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="install-kbernetes1.6-on-centos.html">
<a href="install-kbernetes1.6-on-centos.html">
4.1 在CentOS上部署kubernetes1.6集群
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.1.1" data-path="create-tls-and-secret-key.html">
<a href="create-tls-and-secret-key.html">
4.1.1 创建TLS证书和秘钥
</a>
</li>
<li class="chapter " data-level="1.4.1.2" data-path="create-kubeconfig.html">
<a href="create-kubeconfig.html">
4.1.2 创建kubeconfig文件
</a>
</li>
<li class="chapter " data-level="1.4.1.3" data-path="etcd-cluster-installation.html">
<a href="etcd-cluster-installation.html">
4.1.3 创建高可用etcd集群
</a>
</li>
<li class="chapter " data-level="1.4.1.4" data-path="kubectl-installation.html">
<a href="kubectl-installation.html">
4.1.4 安装kubectl命令行工具
</a>
</li>
<li class="chapter " data-level="1.4.1.5" data-path="master-installation.html">
<a href="master-installation.html">
4.1.5 部署master节点
</a>
</li>
<li class="chapter " data-level="1.4.1.6" data-path="node-installation.html">
<a href="node-installation.html">
4.1.6 部署node节点
</a>
</li>
<li class="chapter " data-level="1.4.1.7" data-path="kubedns-addon-installation.html">
<a href="kubedns-addon-installation.html">
4.1.7 安装kubedns插件
</a>
</li>
<li class="chapter " data-level="1.4.1.8" data-path="dashboard-addon-installation.html">
<a href="dashboard-addon-installation.html">
4.1.8 安装dashboard插件
</a>
</li>
<li class="chapter active" data-level="1.4.1.9" data-path="heapster-addon-installation.html">
<a href="heapster-addon-installation.html">
4.1.9 安装heapster插件
</a>
</li>
<li class="chapter " data-level="1.4.1.10" data-path="efk-addon-installation.html">
<a href="efk-addon-installation.html">
4.1.10 安装EFK插件
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4.2" data-path="service-discovery-and-loadbalancing.html">
<a href="service-discovery-and-loadbalancing.html">
4.2 服务发现与负载均衡
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.2.1" data-path="traefik-ingress-installation.html">
<a href="traefik-ingress-installation.html">
4.2.1 安装Traefik ingress
</a>
</li>
<li class="chapter " data-level="1.4.2.2" data-path="distributed-load-test.html">
<a href="distributed-load-test.html">
4.2.2 分布式负载测试
</a>
</li>
<li class="chapter " data-level="1.4.2.3" data-path="network-and-cluster-perfermance-test.html">
<a href="network-and-cluster-perfermance-test.html">
4.2.3 网络和集群性能测试
</a>
</li>
<li class="chapter " data-level="1.4.2.4" data-path="edge-node-configuration.html">
<a href="edge-node-configuration.html">
4.2.4 边缘节点配置
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4.3" data-path="operation.html">
<a href="operation.html">
4.3 运维管理
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.3.1" data-path="service-rolling-update.html">
<a href="service-rolling-update.html">
4.3.1 服务滚动升级
</a>
</li>
<li class="chapter " data-level="1.4.3.2" data-path="app-log-collection.html">
<a href="app-log-collection.html">
4.3.2 应用日志收集
</a>
</li>
<li class="chapter " data-level="1.4.3.3" data-path="configuration-best-practice.html">
<a href="configuration-best-practice.html">
4.3.3 配置最佳实践
</a>
</li>
<li class="chapter " data-level="1.4.3.4" data-path="monitor.html">
<a href="monitor.html">
4.3.4 集群及应用监控
</a>
</li>
<li class="chapter " data-level="1.4.3.5" data-path="jenkins-ci-cd.html">
<a href="jenkins-ci-cd.html">
4.3.5 使用Jenkins进行持续构建与发布
</a>
</li>
<li class="chapter " data-level="1.4.3.6" data-path="data-persistence-problem.html">
<a href="data-persistence-problem.html">
4.3.6 数据持久化问题
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4.4" data-path="storage.html">
<a href="storage.html">
4.4 存储管理
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.4.1" data-path="glusterfs.html">
<a href="glusterfs.html">
4.4.1 GlusterFS
</a>
<ul class="articles">
<li class="chapter " data-level="1.4.4.1.1" data-path="using-glusterfs-for-persistent-storage.html">
<a href="using-glusterfs-for-persistent-storage.html">
4.4.1.1 使用GlusterFS做持久化存储
</a>
</li>
<li class="chapter " data-level="1.4.4.1.2" data-path="storage-for-containers-using-glusterfs-with-openshift.html">
<a href="storage-for-containers-using-glusterfs-with-openshift.html">
4.4.1.2 在OpenShift中使用GlusterFS做持久化存储
</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" data-path="../usecases/">
<a href="../usecases/">
5. 领域应用
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="../usecases/microservices.html">
<a href="../usecases/microservices.html">
5.1 微服务架构
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1.1" data-path="../usecases/istio.html">
<a href="../usecases/istio.html">
5.1.1 Istio
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1.1.1" data-path="../usecases/istio-installation.html">
<a href="../usecases/istio-installation.html">
5.1.1.1 安装istio
</a>
</li>
<li class="chapter " data-level="1.5.1.1.2" data-path="../usecases/configuring-request-routing.html">
<a href="../usecases/configuring-request-routing.html">
5.1.1.2 配置请求的路由规则
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5.1.2" data-path="../usecases/linkerd.html">
<a href="../usecases/linkerd.html">
5.1.2 Linkerd
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.1.2.1" data-path="../usecases/linkerd-user-guide.html">
<a href="../usecases/linkerd-user-guide.html">
5.1.2.1 Linkerd 使用指南
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5.1.3" data-path="../usecases/service-discovery-in-microservices.html">
<a href="../usecases/service-discovery-in-microservices.html">
5.1.3 微服务中的服务发现
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5.2" data-path="../usecases/big-data.html">
<a href="../usecases/big-data.html">
5.2 大数据
</a>
<ul class="articles">
<li class="chapter " data-level="1.5.2.1" data-path="../usecases/spark-on-kubernetes.html">
<a href="../usecases/spark-on-kubernetes.html">
5.2.1 Spark on Kubernetes
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" data-path="../develop/">
<a href="../develop/">
6. 开发指南
</a>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="../develop/developing-environment.html">
<a href="../develop/developing-environment.html">
6.1 开发环境搭建
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="../develop/testing.html">
<a href="../develop/testing.html">
6.2 单元测试和集成测试
</a>
</li>
<li class="chapter " data-level="1.6.3" data-path="../develop/client-go-sample.html">
<a href="../develop/client-go-sample.html">
6.3 client-go示例
</a>
</li>
<li class="chapter " data-level="1.6.4" data-path="../develop/contribute.html">
<a href="../develop/contribute.html">
6.4 社区贡献
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.7" data-path="../appendix/">
<a href="../appendix/">
7. 附录
</a>
<ul class="articles">
<li class="chapter " data-level="1.7.1" data-path="../appendix/docker-best-practice.html">
<a href="../appendix/docker-best-practice.html">
7.1 Docker最佳实践
</a>
</li>
<li class="chapter " data-level="1.7.2" data-path="../appendix/issues.html">
<a href="../appendix/issues.html">
7.2 问题记录
</a>
</li>
<li class="chapter " data-level="1.7.3" data-path="../appendix/tricks.html">
<a href="../appendix/tricks.html">
7.3 使用技巧
</a>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
本書使用 GitBook 釋出
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href=".." >4.1.9 安装heapster插件</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div class="search-plus" id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="&#x5B89;&#x88C5;heapster&#x63D2;&#x4EF6;">&#x5B89;&#x88C5;heapster&#x63D2;&#x4EF6;</h1>
<p>&#x5230; <a href="https://github.com/kubernetes/heapster/releases" target="_blank">heapster release &#x9875;&#x9762;</a> &#x4E0B;&#x8F7D;&#x6700;&#x65B0;&#x7248;&#x672C;&#x7684; heapster&#x3002;</p>
<pre><code class="lang-bash">$ wget https://github.com/kubernetes/heapster/archive/v1.3.0.zip
$ unzip v1.3.0.zip
$ mv v1.3.0.zip heapster-1.3.0
</code></pre>
<p>&#x6587;&#x4EF6;&#x76EE;&#x5F55;&#xFF1A; <code>heapster-1.3.0/deploy/kube-config/influxdb</code></p>
<pre><code class="lang-bash">$ <span class="hljs-built_in">cd</span> heapster-1.3.0/deploy/kube-config/influxdb
$ ls *.yaml
grafana-deployment.yaml grafana-service.yaml heapster-deployment.yaml heapster-service.yaml influxdb-deployment.yaml influxdb-service.yaml heapster-rbac.yaml
</code></pre>
<p>&#x6211;&#x4EEC;&#x81EA;&#x5DF1;&#x521B;&#x5EFA;&#x4E86;heapster&#x7684;rbac&#x914D;&#x7F6E;<code>heapster-rbac.yaml</code>&#x3002;</p>
<p>&#x5DF2;&#x7ECF;&#x4FEE;&#x6539;&#x597D;&#x7684; yaml &#x6587;&#x4EF6;&#x89C1;&#xFF1A;<a href="../manifests/heapster">heapster</a></p>
<h2 id="&#x914D;&#x7F6E;-grafana-deployment">&#x914D;&#x7F6E; grafana-deployment</h2>
<pre><code class="lang-bash">$ diff grafana-deployment.yaml.orig grafana-deployment.yaml
16c16
&lt; image: gcr.io/google_containers/heapster-grafana-amd64:v4.0.2
---
&gt; image: sz-pg-oam-docker-hub-001.tendcloud.com/library/heapster-grafana-amd64:v4.0.2
40,41c40,41
&lt; <span class="hljs-comment"># value: /api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/</span>
&lt; value: /
---
&gt; value: /api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/
&gt; <span class="hljs-comment">#value: /</span>
</code></pre>
<ul>
<li>&#x5982;&#x679C;&#x540E;&#x7EED;&#x4F7F;&#x7528; kube-apiserver &#x6216;&#x8005; kubectl proxy &#x8BBF;&#x95EE; grafana dashboard&#xFF0C;&#x5219;&#x5FC5;&#x987B;&#x5C06; <code>GF_SERVER_ROOT_URL</code> &#x8BBE;&#x7F6E;&#x4E3A; <code>/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/</code>&#xFF0C;&#x5426;&#x5219;&#x540E;&#x7EED;&#x8BBF;&#x95EE;grafana&#x65F6;&#x8BBF;&#x95EE;&#x65F6;&#x63D0;&#x793A;&#x627E;&#x4E0D;&#x5230;<code>http://172.20.0.113:8086/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/api/dashboards/home</code> &#x9875;&#x9762;&#xFF1B;</li>
</ul>
<h2 id="&#x914D;&#x7F6E;-heapster-deployment">&#x914D;&#x7F6E; heapster-deployment</h2>
<pre><code class="lang-bash">$ diff heapster-deployment.yaml.orig heapster-deployment.yaml
16c16
&lt; image: gcr.io/google_containers/heapster-amd64:v1.3.0-beta.1
---
&gt; image: sz-pg-oam-docker-hub-001.tendcloud.com/library/heapster-amd64:v1.3.0-beta.1
</code></pre>
<h2 id="&#x914D;&#x7F6E;-influxdb-deployment">&#x914D;&#x7F6E; influxdb-deployment</h2>
<p>influxdb &#x5B98;&#x65B9;&#x5EFA;&#x8BAE;&#x4F7F;&#x7528;&#x547D;&#x4EE4;&#x884C;&#x6216; HTTP API &#x63A5;&#x53E3;&#x6765;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x4ECE; v1.1.0 &#x7248;&#x672C;&#x5F00;&#x59CB;&#x9ED8;&#x8BA4;&#x5173;&#x95ED; admin UI&#xFF0C;&#x5C06;&#x5728;&#x540E;&#x7EED;&#x7248;&#x672C;&#x4E2D;&#x79FB;&#x9664; admin UI &#x63D2;&#x4EF6;&#x3002;</p>
<p>&#x5F00;&#x542F;&#x955C;&#x50CF;&#x4E2D; admin UI&#x7684;&#x529E;&#x6CD5;&#x5982;&#x4E0B;&#xFF1A;&#x5148;&#x5BFC;&#x51FA;&#x955C;&#x50CF;&#x4E2D;&#x7684; influxdb &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#xFF0C;&#x5F00;&#x542F; admin &#x63D2;&#x4EF6;&#x540E;&#xFF0C;&#x518D;&#x5C06;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5185;&#x5BB9;&#x5199;&#x5165; ConfigMap&#xFF0C;&#x6700;&#x540E;&#x6302;&#x8F7D;&#x5230;&#x955C;&#x50CF;&#x4E2D;&#xFF0C;&#x8FBE;&#x5230;&#x8986;&#x76D6;&#x539F;&#x59CB;&#x914D;&#x7F6E;&#x7684;&#x76EE;&#x7684;&#xFF1A;</p>
<p>&#x6CE8;&#x610F;&#xFF1A;manifests &#x76EE;&#x5F55;&#x5DF2;&#x7ECF;&#x63D0;&#x4F9B;&#x4E86; <a href="https://github.com/opsnull/follow-me-install-kubernetes-cluster/blob/master/manifests/heapster/influxdb-cm.yaml" target="_blank">&#x4FEE;&#x6539;&#x540E;&#x7684; ConfigMap &#x5B9A;&#x4E49;&#x6587;&#x4EF6;</a></p>
<pre><code class="lang-bash">$ <span class="hljs-comment"># &#x5BFC;&#x51FA;&#x955C;&#x50CF;&#x4E2D;&#x7684; influxdb &#x914D;&#x7F6E;&#x6587;&#x4EF6;</span>
$ docker run --rm --entrypoint <span class="hljs-string">&apos;cat&apos;</span> -ti lvanneo/heapster-influxdb-amd64:v1.1.1 /etc/config.toml &gt;config.toml.orig
$ cp config.toml.orig config.toml
$ <span class="hljs-comment"># &#x4FEE;&#x6539;&#xFF1A;&#x542F;&#x7528; admin &#x63A5;&#x53E3;</span>
$ vim config.toml
$ diff config.toml.orig config.toml
35c35
&lt; enabled = <span class="hljs-literal">false</span>
---
&gt; enabled = <span class="hljs-literal">true</span>
$ <span class="hljs-comment"># &#x5C06;&#x4FEE;&#x6539;&#x540E;&#x7684;&#x914D;&#x7F6E;&#x5199;&#x5165;&#x5230; ConfigMap &#x5BF9;&#x8C61;&#x4E2D;</span>
$ kubectl create configmap influxdb-config --from-file=config.toml -n kube-system
configmap <span class="hljs-string">&quot;influxdb-config&quot;</span> created
$ <span class="hljs-comment"># &#x5C06; ConfigMap &#x4E2D;&#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x6302;&#x8F7D;&#x5230; Pod &#x4E2D;&#xFF0C;&#x8FBE;&#x5230;&#x8986;&#x76D6;&#x539F;&#x59CB;&#x914D;&#x7F6E;&#x7684;&#x76EE;&#x7684;</span>
$ diff influxdb-deployment.yaml.orig influxdb-deployment.yaml
16c16
&lt; image: gcr.io/google_containers/heapster-influxdb-amd64:v1.1.1
---
&gt; image: sz-pg-oam-docker-hub-001.tendcloud.com/library/heapster-influxdb-amd64:v1.1.1
19a20,21
&gt; - mountPath: /etc/
&gt; name: influxdb-config
22a25,27
&gt; - name: influxdb-config
&gt; configMap:
&gt; name: influxdb-config
</code></pre>
<h2 id="&#x914D;&#x7F6E;-monitoring-influxdb-service">&#x914D;&#x7F6E; monitoring-influxdb Service</h2>
<pre><code>$ diff influxdb-service.yaml.orig influxdb-service.yaml
12a13
&gt; type: NodePort
15a17,20
&gt; name: http
&gt; - port: 8083
&gt; targetPort: 8083
&gt; name: admin
</code></pre><ul>
<li>&#x5B9A;&#x4E49;&#x7AEF;&#x53E3;&#x7C7B;&#x578B;&#x4E3A; NodePort&#xFF0C;&#x989D;&#x5916;&#x589E;&#x52A0;&#x4E86; admin &#x7AEF;&#x53E3;&#x6620;&#x5C04;&#xFF0C;&#x7528;&#x4E8E;&#x540E;&#x7EED;&#x6D4F;&#x89C8;&#x5668;&#x8BBF;&#x95EE; influxdb &#x7684; admin UI &#x754C;&#x9762;&#xFF1B;</li>
</ul>
<h2 id="&#x6267;&#x884C;&#x6240;&#x6709;&#x5B9A;&#x4E49;&#x6587;&#x4EF6;">&#x6267;&#x884C;&#x6240;&#x6709;&#x5B9A;&#x4E49;&#x6587;&#x4EF6;</h2>
<pre><code class="lang-bash">$ <span class="hljs-built_in">pwd</span>
/root/heapster-1.3.0/deploy/kube-config/influxdb
$ ls *.yaml
grafana-service.yaml heapster-rbac.yaml influxdb-cm.yaml influxdb-service.yaml
grafana-deployment.yaml heapster-deployment.yaml heapster-service.yaml influxdb-deployment.yaml
$ kubectl create <span class="hljs-_">-f</span> .
deployment <span class="hljs-string">&quot;monitoring-grafana&quot;</span> created
service <span class="hljs-string">&quot;monitoring-grafana&quot;</span> created
deployment <span class="hljs-string">&quot;heapster&quot;</span> created
serviceaccount <span class="hljs-string">&quot;heapster&quot;</span> created
clusterrolebinding <span class="hljs-string">&quot;heapster&quot;</span> created
service <span class="hljs-string">&quot;heapster&quot;</span> created
configmap <span class="hljs-string">&quot;influxdb-config&quot;</span> created
deployment <span class="hljs-string">&quot;monitoring-influxdb&quot;</span> created
service <span class="hljs-string">&quot;monitoring-influxdb&quot;</span> created
</code></pre>
<h2 id="&#x68C0;&#x67E5;&#x6267;&#x884C;&#x7ED3;&#x679C;">&#x68C0;&#x67E5;&#x6267;&#x884C;&#x7ED3;&#x679C;</h2>
<p>&#x68C0;&#x67E5; Deployment</p>
<pre><code class="lang-bash">$ kubectl get deployments -n kube-system | grep -E <span class="hljs-string">&apos;heapster|monitoring&apos;</span>
heapster 1 1 1 1 2m
monitoring-grafana 1 1 1 1 2m
monitoring-influxdb 1 1 1 1 2m
</code></pre>
<p>&#x68C0;&#x67E5; Pods</p>
<pre><code class="lang-bash">$ kubectl get pods -n kube-system | grep -E <span class="hljs-string">&apos;heapster|monitoring&apos;</span>
heapster-110704576-gpg8v 1/1 Running 0 2m
monitoring-grafana-2861879979-9z89f 1/1 Running 0 2m
monitoring-influxdb-1411048194-lzrpc 1/1 Running 0 2m
</code></pre>
<p>&#x68C0;&#x67E5; kubernets dashboard &#x754C;&#x9762;&#xFF0C;&#x770B;&#x662F;&#x663E;&#x793A;&#x5404; Nodes&#x3001;Pods &#x7684; CPU&#x3001;&#x5185;&#x5B58;&#x3001;&#x8D1F;&#x8F7D;&#x7B49;&#x5229;&#x7528;&#x7387;&#x66F2;&#x7EBF;&#x56FE;&#xFF1B;</p>
<figure id="fig1.4.1.9.1"><img src="../images/kubernetes-dashboard-with-heapster.jpg" alt="dashboard-heapster"><figcaption>Figure: dashboard-heapster</figcaption></figure>
<h2 id="&#x8BBF;&#x95EE;-grafana">&#x8BBF;&#x95EE; grafana</h2>
<ol>
<li><p>&#x901A;&#x8FC7; kube-apiserver &#x8BBF;&#x95EE;&#xFF1A;</p>
<p> &#x83B7;&#x53D6; monitoring-grafana &#x670D;&#x52A1; URL</p>
<pre><code class="lang-bash"> $ kubectl cluster-info
Kubernetes master is running at https://172.20.0.113:6443
Heapster is running at https://172.20.0.113:6443/api/v1/proxy/namespaces/kube-system/services/heapster
KubeDNS is running at https://172.20.0.113:6443/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at https://172.20.0.113:6443/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
monitoring-grafana is running at https://172.20.0.113:6443/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana
monitoring-influxdb is running at https://172.20.0.113:6443/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb
To further debug and diagnose cluster problems, use <span class="hljs-string">&apos;kubectl cluster-info dump&apos;</span>.
</code></pre>
<p> &#x6D4F;&#x89C8;&#x5668;&#x8BBF;&#x95EE; URL&#xFF1A; <code>http://172.20.0.113:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana</code></p>
</li>
<li><p>&#x901A;&#x8FC7; kubectl proxy &#x8BBF;&#x95EE;&#xFF1A;</p>
<p> &#x521B;&#x5EFA;&#x4EE3;&#x7406;</p>
<pre><code class="lang-bash"> $ kubectl proxy --address=<span class="hljs-string">&apos;172.20.0.113&apos;</span> --port=8086 --accept-hosts=<span class="hljs-string">&apos;^*$&apos;</span>
Starting to serve on 172.20.0.113:8086
</code></pre>
<p> &#x6D4F;&#x89C8;&#x5668;&#x8BBF;&#x95EE; URL&#xFF1A;<code>http://172.20.0.113:8086/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana</code></p>
</li>
</ol>
<figure id="fig1.4.1.9.2"><img src="../images/kubernetes-heapster-grafana.jpg" alt="grafana"><figcaption>Figure: grafana</figcaption></figure>
<h2 id="&#x8BBF;&#x95EE;-influxdb-admin-ui">&#x8BBF;&#x95EE; influxdb admin UI</h2>
<p>&#x83B7;&#x53D6; influxdb http 8086 &#x6620;&#x5C04;&#x7684; NodePort</p>
<pre><code>$ kubectl get svc -n kube-system|grep influxdb
monitoring-influxdb 10.254.22.46 &lt;nodes&gt; 8086:32299/TCP,8083:30269/TCP 9m
</code></pre><p>&#x901A;&#x8FC7; kube-apiserver &#x7684;<strong>&#x975E;&#x5B89;&#x5168;&#x7AEF;&#x53E3;</strong>&#x8BBF;&#x95EE; influxdb &#x7684; admin UI &#x754C;&#x9762;&#xFF1A; <code>http://172.20.0.113:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb:8083/</code></p>
<p>&#x5728;&#x9875;&#x9762;&#x7684; &#x201C;Connection Settings&#x201D; &#x7684; Host &#x4E2D;&#x8F93;&#x5165; node IP&#xFF0C; Port &#x4E2D;&#x8F93;&#x5165; 8086 &#x6620;&#x5C04;&#x7684; nodePort &#x5982;&#x4E0A;&#x9762;&#x7684; 32299&#xFF0C;&#x70B9;&#x51FB; &#x201C;Save&#x201D; &#x5373;&#x53EF;&#xFF08;&#x6211;&#x7684;&#x96C6;&#x7FA4;&#x4E2D;&#x7684;&#x5730;&#x5740;&#x662F;172.20.0.113:32299&#xFF09;&#xFF1A;</p>
<figure id="fig1.4.1.9.3"><img src="../images/kubernetes-influxdb-heapster.jpg" alt="kubernetes-influxdb-heapster"><figcaption>Figure: kubernetes-influxdb-heapster</figcaption></figure>
<footer class="page-footer-ex"> <span class="page-footer-ex-copyright">for GitBook</span>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;<span class="page-footer-ex-footer-update">update
2017-07-24 18:08:50
</span></footer>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="dashboard-addon-installation.html" class="navigation navigation-prev " aria-label="Previous page: 4.1.8 安装dashboard插件">
<i class="fa fa-angle-left"></i>
</a>
<a href="efk-addon-installation.html" class="navigation navigation-next " aria-label="Next page: 4.1.10 安装EFK插件">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"4.1.9 安装heapster插件","level":"1.4.1.9","depth":3,"next":{"title":"4.1.10 安装EFK插件","level":"1.4.1.10","depth":3,"path":"practice/efk-addon-installation.md","ref":"practice/efk-addon-installation.md","articles":[]},"previous":{"title":"4.1.8 安装dashboard插件","level":"1.4.1.8","depth":3,"path":"practice/dashboard-addon-installation.md","ref":"practice/dashboard-addon-installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github","codesnippet","splitter","page-toc-button","image-captions","page-footer-ex","editlink","-lunr","-search","search-plus","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github":{"url":"https://github.com/rootsongjc/kubernetes-handbook"},"editlink":{"label":"编辑本页","multilingual":false,"base":"https://github.com/rootsongjc/kubernetes-handbook/blob/master/"},"livereload":{},"page-footer-ex":{"copyright":"for GitBook","update_format":"YYYY-MM-DD HH:mm:ss","update_label":"update"},"splitter":{},"codesnippet":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"page-toc-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"search-plus":{},"image-captions":{"variable_name":"_pictures"}},"page-footer-ex":{"copyright":"Jimmy Song","update_label":"最后更新:","update_format":"YYYY-MM-DD HH:mm:ss"},"theme":"default","author":"Jimmy Song","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"_pictures":[{"backlink":"index.html#fig1.1.1","level":"1.1","list_caption":"Figure: wercker status","alt":"wercker status","nro":1,"url":"https://app.wercker.com/status/b8b69e593784e17ddcfd1286adfd8f3c/s/master","index":1,"caption_template":"Figure: _CAPTION_","label":"wercker status","attributes":{},"title":"wercker status","skip":false,"key":"1.1.1"},{"backlink":"concepts/index.html#fig1.2.1","level":"1.2","list_caption":"Figure: Borg架构","alt":"Borg架构","nro":2,"url":"../images/borg.png","index":1,"caption_template":"Figure: _CAPTION_","label":"Borg架构","attributes":{},"skip":false,"key":"1.2.1"},{"backlink":"concepts/index.html#fig1.2.2","level":"1.2","list_caption":"Figure: Kubernetes架构","alt":"Kubernetes架构","nro":3,"url":"../images/architecture.png","index":2,"caption_template":"Figure: _CAPTION_","label":"Kubernetes架构","attributes":{},"skip":false,"key":"1.2.2"},{"backlink":"concepts/index.html#fig1.2.3","level":"1.2","list_caption":"Figure: kubernetes整体架构示意图","alt":"kubernetes整体架构示意图","nro":4,"url":"../images/kubernetes-whole-arch.png","index":3,"caption_template":"Figure: _CAPTION_","label":"kubernetes整体架构示意图","attributes":{},"skip":false,"key":"1.2.3"},{"backlink":"concepts/index.html#fig1.2.4","level":"1.2","list_caption":"Figure: Kubernetes master架构示意图","alt":"Kubernetes master架构示意图","nro":5,"url":"../images/kubernetes-master-arch.png","index":4,"caption_template":"Figure: _CAPTION_","label":"Kubernetes master架构示意图","attributes":{},"skip":false,"key":"1.2.4"},{"backlink":"concepts/index.html#fig1.2.5","level":"1.2","list_caption":"Figure: kubernetes node架构示意图","alt":"kubernetes node架构示意图","nro":6,"url":"../images/kubernetes-node-arch.png","index":5,"caption_template":"Figure: _CAPTION_","label":"kubernetes node架构示意图","attributes":{},"skip":false,"key":"1.2.5"},{"b
});
</script>
</div>
<script src="../gitbook/gitbook.js"></script>
<script src="../gitbook/theme.js"></script>
<script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
<script src="../gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-editlink/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
<script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
<script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>