OpenShift实战(五):OpenShift容器监控Metrics

dukuan 2018-04-18 原文

OpenShift实战(五):OpenShift容器监控Metrics

1、创建持久化metric pv卷

[root@master1 pv]# cat metrics.json 
apiVersion: v1
kind: PersistentVolume
metadata:
  name: metrics
spec:
  capacity:
    storage: 21Gi 
  accessModes:
  - ReadWriteOnce 
  nfs: 
    path: /export/pv/metrics
    server: 192.168.10.110
  persistentVolumeReclaimPolicy: Recycle

  PS:不做持久化存储无需创建PV

2、更改ansible hosts

  ansible文件与之前的教程同步。只是累加了metrics的一些参数。

[root@master1 ~]# cat /etc/ansible/hosts 
# Create an OSEv3 group that contains the masters, nodes, and etcd groups
[OSEv3:children]
masters
nodes
etcd
new_nodes
#lb
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
ansible_become=yes
debug_level=2
openshift_deployment_type=origin
# If ansible_ssh_user is not root, ansible_become must be set to true
#ansible_become=true
openshift_repos_enable_testing=true
openshift_enable_service_catalog=false
template_service_broker_install=false
# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
openshift_disable_check=disk_availability,docker_storage,memory_availability,docker_image_availability,package_version
# config for metrics
openshift_release=3.6.1
# config by metrics
openshift_metrics_install_metrics=true
openshift_metrics_image_prefix=openshift/origin-
openshift_metrics_image_version=v3.6.1
openshift_metrics_cassandra_pvc_size=21Gi

openshift_clock_enabled=true
#openshift_master_cluster_method=native
#openshift_master_cluster_hostname=openshift.xxx.net
#openshift_master_cluster_public_hostname=openshift.xxx.net
#openshift_node_kubelet_args={'pods-per-core': ['10'], 'max-pods': ['250'], 'image-gc-high-threshold': ['90'], 'image-gc-low-threshold': ['80']}
# host group for masters
[masters]
master1.xxx.net
#master2.xxx.net

# host group for lb
#[lb]
#etcd1.xxx.net

# host group for etcd
[etcd]
etcd1.xxx.net
etcd2.xxx.net
etcd3.xxx.net
# host group for nodes, includes region info
[nodes]
master1.xxx.net
#master2.xxx.net
node1.xxx.net openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node2.xxx.net openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node3.xxx.net openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node4.xxx.net
node5.xxx.net 
node6.xxx.net openshift_node_labels="{'region': 'subnet8', 'zone': 'default'}"
node7.xxx.net openshift_node_labels="{'region': 'subnet8', 'zone': 'default'}"
node8.xxx.net openshift_node_labels="{'region': 'subnet7', 'zone': 'default'}"
node9.xxx.net openshift_node_labels="{'region': 'subnet7', 'zone': 'default'}"
#
[new_nodes]

3、执行安装

  如果上述未指定pv,也就是不做持久化存储,设置openshift_metrics_cassandra_storage_type=emptydir

 

ansible-playbook -i /etc/ansible/hosts openshift-ansible-openshift-ansible-3.6.173.0.104-1/playbooks/byo/openshift-cluster/openshift-metrics.yml \
-e openshift_metrics_install_metrics=True \
-e openshift_metrics_hawkular_hostname=metrics.xxx.net \
-e openshift_metrics_cassandra_storage_type=pv

4、安装成功界面如下

  查看pods

[root@master1 ~]# oc get pods -n openshift-infra
NAME                         READY     STATUS    RESTARTS   AGE
hawkular-cassandra-1-jstd5   1/1       Running   0          6d
hawkular-metrics-gk4z1       1/1       Running   1          6d
heapster-glk31               1/1       Running   0          6d

5、查看web console

  PS:首次安装较慢

6、查看监控

7、一些说明

  配置k8s集群pod自动扩展,需要配置metric来获取数据,写一篇文档将实现Auto Scaling。

 

发表于 2018-04-18 18:37 杜先生的博客 阅读() 评论() 编辑 收藏

 

版权声明:本文为dukuan原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/dukuan/p/8876091.html

OpenShift实战(五):OpenShift容器监控Metrics的更多相关文章

  1. 004.OpenShift命令及故障排查

    一 CLI访问OpenShift资源 1.1 资源操作 OCP将OpenShift集群中的为由主节点管理的对象 […]...

  2. 007.OpenShift管理应用部署

    一 REPLICATION CONTROLLERS 1.1 RC概述 RC确保pod指定数量的副本一直运行。如 […]...

  3. OpenShift实战(七):OpenShift定制镜像S2I

    OpenShift实战(七):OpenShift定制镜像S2I 1、基础镜像制作   由于公司的程序是Java […]...

  4. 009.OpenShift管理及监控

    一 资源限制 1.1 pod资源限制 pod可以包括资源请求和资源限制: 资源请求 用于调度,并控制pod不能 […]...

  5. 010.OpenShift综合实验及应用

    实验一 安装OpenShift 1.1 前置准备 [student@workstation ~]$ lab r […]...

  6. 理解OpenShift(6):集中式日志处理

      理解OpenShift(1):网络之 Router 和 Route 理解OpenShift(2):网络之 […]...

  7. 008.OpenShift Metric应用

    一 METRICS子系统组件 1.1 metric架构介绍 OpenShift metric子系统支持捕获和长 […]...

  8. OpenShift实战(六):OpenShift日志监控EFK

    OpenShift实战(六):OpenShift日志监控EFK 1、镜像下载   为了防止安装过程中由于镜像下 […]...

随机推荐

  1. 策略模式(易懂)

    策略模式 策略模式:也叫作政策模式,定义一组算法,将每个算法都封装起来,并且使他们之间可以互换 策略模式的使用 […]...

  2. [发布] Photoshop ICO 文件格式插件 V2.0版

    经过了少许努力,现在我将能够发布给 Photoshop 使用的 ICO 文件格式插件 2.0 版。该插件 2. […]...

  3. Jupyter人工智能实验+深度学习模型+机器学习资源

    参考网站http://www.educg.net.cn/resources.html https://gith […]...

  4. 深入探究ASP.NET Core异常处理中间件

    前言     全局异常处理是我们编程过程中不可或缺的重要环节。有了全局异常处理机制给我们带来了很多便捷,首先我 […]...

  5. DDD实战进阶第一波(七):开发一般业务的大健康行业直销系统(实现产品上下文接口与测试)

    前一篇文章我们介绍了如何将创建产品的领域逻辑与产品的持久化仓储通过上架产品的用例组织起来,完成了一个功能。在实 […]...

  6. MacOS 安装MysqlDB 问题解决方案( 解决 IndexError: string index out of range) – 我是某某某是我

    MacOS 安装MysqlDB 问题解决方案( 解决 IndexError: string index out […]...

  7. Graphite在centeros 6下安装

    这段时间,一直在学习Graphite,做一个阶段性总结。 在centos 6.4系统下安装Graphite。 […]...

  8. 实现orm框架,类似hibernate功能

    之前使用Hibernate时,觉得很不错,但是自己平时做一些练习时都是一些小项目,所以自己想能不能自尝试写一个 […]...

展开目录

目录导航