Compare commits
51 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
6969b0bf73 | |
|
|
0ff35a9538 | |
|
|
c31388d310 | |
|
|
ed93d08003 | |
|
|
86ceaa600a | |
|
|
99946a6d44 | |
|
|
941060ed3d | |
|
|
f35eb9c63d | |
|
|
53c33cfd55 | |
|
|
6d952f2005 | |
|
|
90d68d584a | |
|
|
3bd2b20d9f | |
|
|
d09be03750 | |
|
|
9d3d7db32c | |
|
|
82ba8db94f | |
|
|
68d3915c0d | |
|
|
b8677eec62 | |
|
|
77dd08b2ed | |
|
|
21e0303767 | |
|
|
a15d368278 | |
|
|
ad659446d1 | |
|
|
20cf07ef39 | |
|
|
d12f5d1836 | |
|
|
db29f23053 | |
|
|
60fcac43cf | |
|
|
1ee8daba19 | |
|
|
7301451d9d | |
|
|
c100a5cf98 | |
|
|
e39fc06547 | |
|
|
4a4ab6620f | |
|
|
d47e6702a0 | |
|
|
638494989c | |
|
|
c19c5f57bc | |
|
|
27c2cb5d27 | |
|
|
1bfceb0979 | |
|
|
102d8d99d7 | |
|
|
2a2f4b13c4 | |
|
|
325c6b1d2f | |
|
|
ea5464f42c | |
|
|
e6bc734ee0 | |
|
|
e70233b8c9 | |
|
|
f965d8baed | |
|
|
141c69e8ce | |
|
|
13de345701 | |
|
|
ff0fbf2eea | |
|
|
11bf7544b0 | |
|
|
6e63b03bc8 | |
|
|
72a89df1eb | |
|
|
64efd54a9e | |
|
|
1188e964e3 | |
|
|
de7b35fa79 |
22
LICENSE
22
LICENSE
|
|
@ -1,21 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 若依
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
||||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
|
|
|||
403
README.md
403
README.md
|
|
@ -1,129 +1,312 @@
|
|||
<p align="center">
|
||||
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-b99b286755aef70355a7084753f89cdb7c9.png">
|
||||
</p>
|
||||
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">ci4s-cloud 1.0</h1>
|
||||
<h4 align="center">基于 React 和 Spring Boot/Spring Cloud & Alibaba 前后端分离的分布式微服务架构</h4>
|
||||
<p align="center">
|
||||
<a href="https://gitee.com/y_project/RuoYi-Cloud/stargazers"><img src="https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=dark"></a>
|
||||
<a href="https://gitee.com/y_project/RuoYi-Cloud"><img src="https://img.shields.io/badge/RuoYi-v3.6.3-brightgreen.svg"></a>
|
||||
<a href="https://gitee.com/y_project/RuoYi-Cloud/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
||||
</p>
|
||||
## 复杂智能软件统一管理平台
|
||||
### 📖 概述
|
||||
复杂智能软件统一管理平台是一个集数据标注、模型开发、训练部署于一体的综合性AI开发平台。平台提供从数据准备到模型服务的全生命周期管理,支持多模态数据处理、自动化机器学习、分布式训练等功能。
|
||||
|
||||
## 平台简介
|
||||
### 🎯 核心功能模块
|
||||
#### 1. 📊 数据标注中心 (Data Annotation)
|
||||
多模态标注能力
|
||||
图像标注: 支持 bounding box、多边形分割、关键点标注、图像分类
|
||||
|
||||
ci4s-cloud是复杂智能软件统一管理平台。
|
||||
文本标注: 实体识别、文本分类、情感分析、文本摘要
|
||||
|
||||
* 采用前后端分离的模式,微服务版本前端(基于React)。
|
||||
* 后端采用Spring Boot、Spring Cloud & Alibaba。
|
||||
* 注册中心、配置中心选型Nacos,权限认证使用Redis。
|
||||
* 流量控制框架选型Sentinel,分布式事务选型Seata。
|
||||
## 系统模块
|
||||
音频标注: 语音转写、声音事件检测、说话人识别
|
||||
|
||||
~~~
|
||||
com.ruoyi
|
||||
├── ruoyi-ui // 前端框架 [80]
|
||||
├── ruoyi-gateway // 网关模块 [8080]
|
||||
├── ruoyi-auth // 认证中心 [9200]
|
||||
├── ruoyi-api // 接口模块
|
||||
│ └── ruoyi-api-system // 系统接口
|
||||
├── ruoyi-common // 通用模块
|
||||
│ └── ruoyi-common-core // 核心模块
|
||||
│ └── ruoyi-common-datascope // 权限范围
|
||||
│ └── ruoyi-common-datasource // 多数据源
|
||||
│ └── ruoyi-common-log // 日志记录
|
||||
│ └── ruoyi-common-redis // 缓存服务
|
||||
│ └── ruoyi-common-seata // 分布式事务
|
||||
│ └── ruoyi-common-security // 安全模块
|
||||
│ └── ruoyi-common-swagger // 系统接口
|
||||
├── ruoyi-modules // 业务模块
|
||||
│ └── ruoyi-system // 系统模块 [9201]
|
||||
│ └── ruoyi-gen // 代码生成 [9202]
|
||||
│ └── ruoyi-job // 定时任务 [9203]
|
||||
│ └── ruoyi-file // 文件服务 [9300]
|
||||
│ └── management-platform // 文件服务 [9300]
|
||||
├── ruoyi-visual // 图形化管理模块
|
||||
│ └── ruoyi-visual-monitor // 监控中心 [9100]
|
||||
├──pom.xml // 公共依赖
|
||||
~~~
|
||||
视频标注: 视频动作识别、时序标注、多目标跟踪
|
||||
|
||||
## 架构图
|
||||
数据管理
|
||||
版本控制: 数据集版本管理,支持回溯和比较不同版本
|
||||
|
||||
<img src="https://oscimg.oschina.net/oscnet/up-82e9722ecb846786405a904bafcf19f73f3.png"/>
|
||||
数据可视化: 多维数据分布分析和统计可视化
|
||||
|
||||
## 内置功能
|
||||
#### 2. 💻 开发环境 (Development Environment)
|
||||
在线开发工具
|
||||
Jupyter Lab: 完整的Jupyter环境,支持多种kernel
|
||||
|
||||
1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。
|
||||
2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。
|
||||
3. 岗位管理:配置系统用户所属担任职务。
|
||||
4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。
|
||||
5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。
|
||||
6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。
|
||||
7. 参数管理:对系统动态配置常用参数。
|
||||
8. 通知公告:系统通知公告信息发布维护。
|
||||
9. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。
|
||||
10. 登录日志:系统登录日志记录查询包含登录异常。
|
||||
11. 在线用户:当前系统中活跃用户状态监控。
|
||||
12. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。
|
||||
13. 代码生成:前后端代码的生成(java、html、xml、sql)支持CRUD下载 。
|
||||
14. 系统接口:根据业务代码自动生成相关的api接口文档。
|
||||
15. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。
|
||||
16. 在线构建器:拖动表单元素生成相应的HTML代码。
|
||||
17. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
|
||||
VS Code Online: 基于浏览器的完整IDE体验
|
||||
|
||||
|
||||
SSH终端: 直接访问计算节点,支持远程调试
|
||||
|
||||
## 演示图
|
||||
环境管理
|
||||
预置环境: TensorFlow、PyTorch、MXNet等主流框架环境
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-4148b24f58660a9dc347761e4cf6162f28f.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-ece3fd37a3d4bb75a3926e905a3c5629055.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-ff9e3066561574aca73005c5730c6a41f15.png"/></td>
|
||||
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
自定义镜像: 支持用户构建和分享自定义环境镜像
|
||||
|
||||
依赖管理: 自动解决环境依赖冲突,支持多版本共存
|
||||
|
||||
## 复杂智能软件统一管理平台安装部署
|
||||
协作开发
|
||||
实时协作: 多用户同时编辑和运行代码
|
||||
|
||||
代码分享: 一键分享notebook和代码片段
|
||||
|
||||
代码审查: 集成Git工作流,支持代码评审和合并
|
||||
|
||||
#### 3. 📁 智能资源库
|
||||
##### 数据集管理系统
|
||||
元数据管理:
|
||||
|
||||
数据来源追踪:记录数据采集时间、来源渠道、采集方法
|
||||
|
||||
数据质量评估:自动计算数据质量指标(完整性、准确性、一致性)
|
||||
|
||||
数据血缘追踪:完整记录数据处理和变换历史
|
||||
|
||||
数据权限控制:细粒度的数据访问权限管理
|
||||
|
||||
版本演化:
|
||||
|
||||
数据集版本树:可视化展示数据集版本演进关系
|
||||
|
||||
差异对比:自动分析不同版本间的数据差异
|
||||
|
||||
版本回滚:支持快速回滚到任意历史版本
|
||||
|
||||
变更日志:详细记录每次数据变更的内容和原因
|
||||
|
||||
##### 模型仓库与演化追踪
|
||||
模型元数据管理:
|
||||
|
||||
训练配置存档:完整保存训练超参数、环境配置、代码版本
|
||||
|
||||
性能指标记录:准确记录模型在各测试集上的性能表现
|
||||
|
||||
资源消耗统计:记录训练和推理的GPU/CPU/内存使用情况
|
||||
|
||||
模型签名:基于模型结构和参数的唯一标识生成
|
||||
模型演化
|
||||
父子关系追踪:清晰记录模型迭代的传承关系
|
||||
|
||||
性能对比分析:自动对比不同迭代版本的性能差异
|
||||
|
||||
演化路径优化:基于历史迭代数据推荐优化方向
|
||||
|
||||
模型血缘分析:完整追溯模型从初始版本到最终版本的全过程
|
||||
|
||||
##### 镜像仓库
|
||||
环境镜像管理:
|
||||
|
||||
基础镜像库:预配置的各种深度学习环境
|
||||
|
||||
自定义镜像:用户基于Dockerfile构建的个性化环境
|
||||
|
||||
镜像版本控制:支持镜像版本管理和回滚
|
||||
|
||||
##### 代码库
|
||||
算法模板:
|
||||
|
||||
预置算法:分类、检测、分割、生成等常见任务模板
|
||||
|
||||
最佳实践:经过验证的高效实现方案
|
||||
|
||||
可复现配置:确保代码在不同环境下的可复现性
|
||||
|
||||
#### 4. 🚀 模型训练与管理平台
|
||||
##### 训练流水线
|
||||
可视化工作流设计器:
|
||||
|
||||
拖拽式界面:直观构建复杂训练流水线
|
||||
|
||||
模块化组件:数据预处理、模型训练、评估验证等标准化组件
|
||||
|
||||
条件分支:支持基于训练结果的动态流水线调整
|
||||
|
||||
参数传递:组件间数据和服务的高效传递
|
||||
|
||||
分布式训练支持:
|
||||
|
||||
多机多卡训练:自动分布式数据并行和模型并行
|
||||
|
||||
弹性训练:动态调整训练资源,支持训练过程中扩容缩容
|
||||
|
||||
混合精度训练:自动FP16/FP32混合精度优化
|
||||
|
||||
梯度优化:梯度压缩、异步更新等分布式优化技术
|
||||
|
||||
##### 实验管理系统
|
||||
实验追踪:
|
||||
|
||||
全量记录:超参数、环境变量、代码版本、数据版本
|
||||
|
||||
实时监控:训练指标、资源使用、日志输出的实时采集
|
||||
|
||||
比较分析:多实验结果的并行对比和差异分析
|
||||
|
||||
实验复现:一键复现历史实验的完整环境
|
||||
|
||||
可视化分析:
|
||||
|
||||
训练曲线:损失函数、准确率等指标的可视化展示
|
||||
|
||||
超参数分析:超参数与模型性能的关系可视化
|
||||
|
||||
模型诊断:梯度分布、激活值分布等模型内部状态分析
|
||||
|
||||
数据洞察:训练数据与模型性能的关联分析
|
||||
|
||||
##### 自动机器学习
|
||||
端到端自动化:
|
||||
|
||||
自动特征工程:基于遗传编程的特征自动生成和选择
|
||||
|
||||
模型选择优化:自动尝试多种算法和架构组合
|
||||
|
||||
超参数自动优化:贝叶斯优化、进化算法等智能搜索策略
|
||||
|
||||
神经网络架构搜索:基于强化学习的自动网络结构设计
|
||||
|
||||
智能优化策略:
|
||||
|
||||
多目标优化:同时优化多个性能指标(精度、速度、大小)
|
||||
|
||||
早停机制:智能判断训练趋势,提前终止无效训练
|
||||
|
||||
资源感知:根据可用计算资源自适应调整搜索空间
|
||||
|
||||
迁移学习:利用历史实验数据加速新任务优化
|
||||
|
||||
##### 主动学习系统
|
||||
智能样本选择:
|
||||
|
||||
不确定性采样:选择模型最不确定的样本进行标注
|
||||
|
||||
多样性采样:确保选择样本的代表性和多样性
|
||||
|
||||
预期模型变化:选择能带来最大模型改进的样本
|
||||
|
||||
多模态策略:针对不同数据类型采用不同的选择策略
|
||||
|
||||
迭代优化流程:
|
||||
|
||||
人机协作循环:自动化的标注-训练-评估迭代流程
|
||||
|
||||
进度监控:实时跟踪标注效率和模型提升效果
|
||||
|
||||
成本控制:在标注成本和模型性能间智能平衡
|
||||
|
||||
效果评估:自动评估主动学习策略的有效性
|
||||
|
||||
##### 超参数寻优
|
||||
多策略优化:
|
||||
|
||||
网格搜索: exhaustive搜索,适合小参数空间
|
||||
|
||||
随机搜索: 高效的大参数空间探索
|
||||
|
||||
贝叶斯优化: 基于高斯过程的智能参数搜索
|
||||
|
||||
进化算法: 基于种群进化的全局优化策略
|
||||
|
||||
高级功能:
|
||||
|
||||
热启动优化: 利用历史实验数据加速优化过程
|
||||
|
||||
多保真度优化: 使用低精度训练快速评估参数组合
|
||||
|
||||
并行优化: 同时进行多个参数组合的实验
|
||||
|
||||
条件参数空间: 支持参数间的条件依赖关系
|
||||
|
||||
大规模训练支持
|
||||
弹性计算:
|
||||
|
||||
动态资源分配:根据训练阶段自动调整计算资源
|
||||
|
||||
容错训练:自动处理节点故障,支持训练恢复
|
||||
|
||||
异构计算:同时利用CPU、GPU、专用AI芯片
|
||||
|
||||
成本优化:智能调度降低训练成本
|
||||
|
||||
#### 5. 🌐 应用部署与服务化
|
||||
模型部署
|
||||
一键部署:
|
||||
|
||||
多种服务模式:实时API、批量处理、流式处理
|
||||
|
||||
自动容器化:将模型自动打包为Docker容器
|
||||
|
||||
服务配置:自动生成服务配置和API文档
|
||||
|
||||
服务管理
|
||||
弹性伸缩:
|
||||
|
||||
自动扩缩容:基于流量负载自动调整实例数量
|
||||
|
||||
资源优化:智能分配资源,提高资源利用率
|
||||
|
||||
成本控制:基于使用模式的弹性计费优化
|
||||
|
||||
监控告警
|
||||
服务健康监控:
|
||||
|
||||
性能指标:QPS、延迟、错误率等实时监控
|
||||
|
||||
资源监控:CPU、内存、GPU使用情况监控
|
||||
|
||||
业务指标:自定义业务指标监控和告警
|
||||
|
||||
A/B测试
|
||||
多版本对比:
|
||||
|
||||
流量分配:精确控制不同版本的流量比例
|
||||
|
||||
效果评估:自动统计各版本的业务指标
|
||||
|
||||
智能推荐:基于效果数据自动推荐最优版本
|
||||
|
||||
### 🏗️ 系统架构
|
||||
#### 前端架构
|
||||
微前端架构: 各功能模块独立开发部署
|
||||
|
||||
响应式设计: 支持桌面端和移动端访问
|
||||
|
||||
实时更新: WebSocket实现实时状态更新
|
||||
|
||||
#### 后端架构
|
||||
微服务架构:
|
||||
|
||||
标注服务、训练服务、部署服务等独立微服务
|
||||
|
||||
服务发现和负载均衡
|
||||
|
||||
容错和熔断机制
|
||||
|
||||
#### 工作流引擎:
|
||||
|
||||
基于Argo Workflows的训练流水线
|
||||
|
||||
可视化工作流监控和管理
|
||||
|
||||
工作流版本控制和模板化
|
||||
|
||||
#### 资源管理
|
||||
GPU资源池: 共享GPU计算资源
|
||||
|
||||
弹性配额: 按需分配计算资源
|
||||
|
||||
成本优化: 智能调度降低计算成本
|
||||
|
||||
### 🚀 快速开始
|
||||
环境要求
|
||||
Kubernetes集群 1.20+
|
||||
|
||||
NVIDIA GPU驱动(如使用GPU)
|
||||
|
||||
存储系统(S3兼容存储或NFS)
|
||||
|
||||
上传安装脚本
|
||||
|
||||
#### step1: 安装mysql
|
||||
```
|
||||
step1: 安装mysql
|
||||
helm install mysql . -n ci4s-test
|
||||
#### step2: 安装redis
|
||||
step2: 安装redis
|
||||
helm install redis . -n ci4s-test
|
||||
#### step3: 安装nacos
|
||||
step3: 安装nacos
|
||||
在第一步安装的mysql中创建nacos-ci4s-config数据库(选UTF-8),并且运行naocs初始化脚本
|
||||
kubectl create -f k8s-3nacos.yaml
|
||||
#### step4: 安装ruoyi服务
|
||||
kubectl create -f *.yaml
|
||||
step4: 安装服务
|
||||
kubectl create -f *.yaml
|
||||
```
|
||||
### 📝 贡献指南
|
||||
我们欢迎社区贡献,欢迎提交PR参与开发。
|
||||
|
||||
### 📄 许可证
|
||||
Apache License 2.0
|
||||
|
|
@ -20,9 +20,8 @@ export default {
|
|||
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
|
||||
'/api/': {
|
||||
// 要代理的地址
|
||||
// target: 'http://172.20.32.197:31213', // 开发环境
|
||||
// target: 'http://172.20.32.235:31213', // 测试环境
|
||||
target: 'http://172.20.32.44:8082',
|
||||
target: 'http://172.20.32.185:31213', // 开发环境
|
||||
// target: 'http://172.20.32.98:8082',
|
||||
// target: 'http://172.20.32.150:8082',
|
||||
// 配置了这个可以从 http 代理到 https
|
||||
// 依赖 origin 的功能可能需要这个,比如 cookie
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,23 @@
|
|||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: arguments-parameters-
|
||||
spec:
|
||||
entrypoint: whalesay
|
||||
# Parameters can be passed/overridden via the argo CLI.
|
||||
# To override the printed message, run `argo submit` with the -p option:
|
||||
# $ argo submit examples/arguments-parameters.yaml -p message="goodbye world"
|
||||
arguments:
|
||||
parameters:
|
||||
- name: message
|
||||
value: hello world
|
||||
|
||||
templates:
|
||||
- name: whalesay
|
||||
inputs:
|
||||
parameters:
|
||||
- name: message
|
||||
container:
|
||||
image: ccr.ccs.tencentyun.com/somunslotus/huoshi-ubuntu-nginx:1.18-20.04_beta-arm64
|
||||
command: [echo]
|
||||
args: ["{{inputs.parameters.message}}"]
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pipeline-convert
|
||||
namespace: argo
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: pipeline-convert
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pipeline-convert
|
||||
spec:
|
||||
serviceAccountName: default
|
||||
containers:
|
||||
- name: pipeline-convert
|
||||
image: ccr.ccs.tencentyun.com/somunslotus/pipeline-convert:202410241506-arm
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
volumeMounts:
|
||||
- mountPath: /var/log/pipeline-convert
|
||||
name: pipeline-convert-log
|
||||
volumes:
|
||||
- name: pipeline-convert-log
|
||||
hostPath:
|
||||
path: /work/pipeline-convert/log
|
||||
type: DirectoryOrCreate
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: pipeline-convert-service
|
||||
namespace: argo
|
||||
spec:
|
||||
selector:
|
||||
app: pipeline-convert
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
nodePort: 31000
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<!-- This is an auto-generated file. DO NOT EDIT -->
|
||||
# volcano
|
||||
|
||||
* Needs:
|
||||
* Image: 172.20.32.187/pipeline-service/argo-volcano-job-plugin:v1
|
||||
|
||||
|
||||
|
||||
Install:
|
||||
|
||||
kubectl apply -f volcano-executor-plugin-configmap.yaml
|
||||
|
||||
Uninstall:
|
||||
|
||||
kubectl delete cm volcano-executor-plugin
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: hello-
|
||||
spec:
|
||||
automountServiceAccountToken: true
|
||||
entrypoint: main
|
||||
templates:
|
||||
- name: main
|
||||
executor:
|
||||
serviceAccountName: volcano-executor-plugin
|
||||
plugin:
|
||||
volcano:
|
||||
job:
|
||||
apiVersion: batch.volcano.sh/v1alpha1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "{{workflow.name}}"
|
||||
namespace: "{{workflow.namespace}}"
|
||||
ownerReferences:
|
||||
- apiVersion: argoproj.io/v1alpha1
|
||||
blockOwnerDeletion: true
|
||||
controller: true
|
||||
kind: Workflow
|
||||
name: "{{workflow.name}}"
|
||||
uid: "{{workflow.uid}}"
|
||||
spec:
|
||||
minAvailable: 3
|
||||
schedulerName: volcano
|
||||
plugins:
|
||||
env: []
|
||||
svc: []
|
||||
queue: default
|
||||
policies:
|
||||
- event: PodEvicted
|
||||
action: RestartJob
|
||||
- event: TaskCompleted
|
||||
action: CompleteJob
|
||||
tasks:
|
||||
- replicas: 1
|
||||
name: ps
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
PS_HOST=`cat /etc/volcano/ps.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`;
|
||||
WORKER_HOST=`cat /etc/volcano/worker.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`;
|
||||
export TF_CONFIG={\"cluster\":{\"ps\":[${PS_HOST}],\"worker\":[${WORKER_HOST}]},\"task\":{\"type\":\"ps\",\"index\":${VK_TASK_INDEX}},\"environment\":\"cloud\"};
|
||||
python /var/tf_dist_mnist/dist_mnist.py
|
||||
image: volcanosh/dist-mnist-tf-example:0.0.1
|
||||
name: tensorflow
|
||||
ports:
|
||||
- containerPort: 2222
|
||||
name: tfjob-port
|
||||
resources: {}
|
||||
restartPolicy: Never
|
||||
- replicas: 2
|
||||
name: worker
|
||||
policies:
|
||||
- event: TaskCompleted
|
||||
action: CompleteJob
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
PS_HOST=`cat /etc/volcano/ps.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`;
|
||||
WORKER_HOST=`cat /etc/volcano/worker.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`;
|
||||
export TF_CONFIG={\"cluster\":{\"ps\":[${PS_HOST}],\"worker\":[${WORKER_HOST}]},\"task\":{\"type\":\"worker\",\"index\":${VK_TASK_INDEX}},\"environment\":\"cloud\"};
|
||||
python /var/tf_dist_mnist/dist_mnist.py
|
||||
image: volcanosh/dist-mnist-tf-example:0.0.1
|
||||
name: tensorflow
|
||||
ports:
|
||||
- containerPort: 2222
|
||||
name: tfjob-port
|
||||
resources: {}
|
||||
restartPolicy: Never
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: sleep-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: sleep-container
|
||||
image: ccr.ccs.tencentyun.com/somunslotus/argo-execturo-plugin:v1-arm
|
||||
command: ["sleep", "3600"]
|
||||
restartPolicy: Never
|
||||
|
||||
Binary file not shown.
|
|
@ -0,0 +1,25 @@
|
|||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ExecutorPlugin
|
||||
metadata:
|
||||
name: volcano
|
||||
spec:
|
||||
sidecar:
|
||||
container:
|
||||
image: 172.20.32.187/pipeline-service/argo-volcano-job-plugin:v1
|
||||
name: volcano-executor-plugin
|
||||
args:
|
||||
- server
|
||||
- --port
|
||||
- 8080
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 65534 # nobody
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "1"
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: executor-role-bind
|
||||
namespace: argo
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: executor-vcjob
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: argo
|
||||
- kind: ServiceAccount
|
||||
name: volcano-executor-plugin
|
||||
namespace: argo
|
||||
- kind: ServiceAccount
|
||||
name: argo
|
||||
namespace: argo
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: executor-vcjob
|
||||
namespace: argo
|
||||
annotations:
|
||||
workflows.argoproj.io/description: |
|
||||
Recommended minimum permissions for the `docker` executor.
|
||||
This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore.
|
||||
rules:
|
||||
- apiGroups:
|
||||
- "argoproj.io"
|
||||
resources:
|
||||
- "*"
|
||||
verbs:
|
||||
- "*"
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: executor-role-bind
|
||||
namespace: argo
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: executor-vcjob
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: argo
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: executor-vcjob
|
||||
namespace: argo
|
||||
annotations:
|
||||
workflows.argoproj.io/description: |
|
||||
Recommended minimum permissions for the `docker` executor.
|
||||
This executor is superseded by the `emmisary` executor, so we do not recommend you use it anymore.
|
||||
rules:
|
||||
- apiGroups:
|
||||
- argoproj.io
|
||||
resources:
|
||||
- workflowtaskresults
|
||||
- workflowtasksets/status
|
||||
verbs:
|
||||
- create
|
||||
- patch
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: volcano-executor-plugin
|
||||
namespace: argo
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: volcano-atp
|
||||
rules:
|
||||
- apiGroups: ["apiextensions.k8s.io"]
|
||||
resources: ["customresourcedefinitions"]
|
||||
verbs: ["create", "get", "list", "watch", "delete"]
|
||||
- apiGroups: ["batch.volcano.sh"]
|
||||
resources: ["jobs"]
|
||||
verbs: ["create","get", "list", "watch", "update", "delete"]
|
||||
- apiGroups: ["batch.volcano.sh"]
|
||||
resources: ["jobs/status", "jobs/finalizers"]
|
||||
verbs: ["update", "patch"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: atp-volcano
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: argo
|
||||
- kind: ServiceAccount
|
||||
name: volcano-executor-plugin
|
||||
namespace: argo
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: volcano-atp
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: volcano-atp
|
||||
rules:
|
||||
- apiGroups: ["apiextensions.k8s.io"]
|
||||
resources: ["customresourcedefinitions"]
|
||||
verbs: ["create", "get", "list", "watch", "delete"]
|
||||
- apiGroups: ["batch.volcano.sh"]
|
||||
resources: ["jobs"]
|
||||
verbs: ["create","get", "list", "watch", "update", "delete"]
|
||||
- apiGroups: ["batch.volcano.sh"]
|
||||
resources: ["jobs/status", "jobs/finalizers"]
|
||||
verbs: ["update", "patch"]
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: atp-volcano
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: argo
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: volcano-atp
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: volcano-executor-plugin.service-account-token
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: volcano-executor-plugin
|
||||
type: kubernetes.io/service-account-token
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: argo.service-account-token
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: argo
|
||||
type: kubernetes.io/service-account-token
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
generateName: volcano-dag-job-
|
||||
spec:
|
||||
entrypoint: volcano-dag-job
|
||||
serviceAccountName: argo
|
||||
templates:
|
||||
- name: volcano-dag-job
|
||||
dag:
|
||||
tasks:
|
||||
- name: echo-start
|
||||
template: start
|
||||
arguments:
|
||||
parameters: [{name: message, value: echo start}]
|
||||
- name: wholesay
|
||||
template: hello-tmpl
|
||||
arguments:
|
||||
parameters: [{name: message, value: hello2a}, {name: task, value: hello2a}]
|
||||
dependencies: [echo-start]
|
||||
- name: echo-end
|
||||
template: end
|
||||
arguments:
|
||||
parameters: [{name: message, value: echo end}]
|
||||
dependencies: [wholesay]
|
||||
- name: start
|
||||
inputs:
|
||||
parameters:
|
||||
- name: message
|
||||
plugin:
|
||||
volcano:
|
||||
job:
|
||||
apiVersion: batch.volcano.sh/v1alpha1
|
||||
kind: Job
|
||||
metadata:
|
||||
namespace: "{{workflow.namespace}}"
|
||||
name: "{{workflow.name}}-echo-start"
|
||||
ownerReferences:
|
||||
- apiVersion: argoproj.io/v1alpha1
|
||||
blockOwnerDeletion: true
|
||||
kind: Workflow
|
||||
name: "{{workflow.name}}"
|
||||
uid: "{{workflow.uid}}"
|
||||
spec:
|
||||
minAvailable: 1
|
||||
schedulerName: volcano
|
||||
policies:
|
||||
- event: PodEvicted
|
||||
action: RestartJob
|
||||
plugins:
|
||||
ssh: []
|
||||
env: []
|
||||
svc: []
|
||||
maxRetry: 1
|
||||
#queue: vc-queue
|
||||
tasks:
|
||||
- name: "task1"
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
name: helloworld1
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm
|
||||
name: echo
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: [echo, "{{inputs.parameters.message}}"]
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
restartPolicy: Never
|
||||
- name: end
|
||||
inputs:
|
||||
parameters:
|
||||
- name: message
|
||||
plugin:
|
||||
volcano:
|
||||
job:
|
||||
apiVersion: batch.volcano.sh/v1alpha1
|
||||
kind: Job
|
||||
metadata:
|
||||
namespace: "{{workflow.namespace}}"
|
||||
name: "{{workflow.name}}-echo-end"
|
||||
ownerReferences:
|
||||
- apiVersion: argoproj.io/v1alpha1
|
||||
blockOwnerDeletion: true
|
||||
kind: Workflow
|
||||
name: "{{workflow.name}}"
|
||||
uid: "{{workflow.uid}}"
|
||||
spec:
|
||||
minAvailable: 1
|
||||
schedulerName: volcano
|
||||
policies:
|
||||
- event: PodEvicted
|
||||
action: RestartJob
|
||||
plugins:
|
||||
ssh: []
|
||||
env: []
|
||||
svc: []
|
||||
maxRetry: 1
|
||||
#queue: vc-queue
|
||||
tasks:
|
||||
- name: "task1"
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
name: helloworld1
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm
|
||||
name: echo
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: [echo, "{{inputs.parameters.message}}"]
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
restartPolicy: Never
|
||||
- name: hello-tmpl
|
||||
inputs:
|
||||
parameters:
|
||||
- name: message
|
||||
- name: task
|
||||
plugin:
|
||||
volcano:
|
||||
job:
|
||||
apiVersion: batch.volcano.sh/v1alpha1
|
||||
kind: Job
|
||||
metadata:
|
||||
namespace: "{{workflow.namespace}}"
|
||||
name: "{{workflow.name}}-main-task"
|
||||
ownerReferences:
|
||||
- apiVersion: argoproj.io/v1alpha1
|
||||
blockOwnerDeletion: true
|
||||
kind: Workflow
|
||||
name: "{{workflow.name}}"
|
||||
uid: "{{workflow.uid}}"
|
||||
spec:
|
||||
minAvailable: 1
|
||||
schedulerName: volcano
|
||||
policies:
|
||||
- event: PodEvicted
|
||||
action: RestartJob
|
||||
plugins:
|
||||
ssh: []
|
||||
env: []
|
||||
svc: []
|
||||
maxRetry: 1
|
||||
#queue: vc-queue
|
||||
tasks:
|
||||
- name: "task999"
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
name: helloworld1
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: [sleep 60]
|
||||
name: hello111
|
||||
resources:
|
||||
requests:
|
||||
cpu: "2"
|
||||
memory: "8Gi"
|
||||
restartPolicy: Never
|
||||
- name: "task999999"
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
name: helloworld222
|
||||
spec:
|
||||
containers:
|
||||
- image: ccr.ccs.tencentyun.com/somunslotus/alpine:latest-arm
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: [echo, "{{inputs.parameters.message}}"]
|
||||
name: hello222
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
restartPolicy: Never
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# This is an auto-generated file. DO NOT EDIT
|
||||
apiVersion: v1
|
||||
data:
|
||||
sidecar.automountServiceAccountToken: "true"
|
||||
sidecar.container: |
|
||||
args:
|
||||
- server
|
||||
- --port
|
||||
- "8080"
|
||||
image: ccr.ccs.tencentyun.com/somunslotus/argo-execturo-plugin:v1-arm
|
||||
name: volcano-executor-plugin
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
resources:
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 64Mi
|
||||
securityContext:
|
||||
runAsNonRoot: false
|
||||
runAsUser: 0
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
workflows.argoproj.io/configmap-type: ExecutorPlugin
|
||||
name: volcano-executor-plugin
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: custom-workflow
|
||||
namespace: argo
|
||||
rules:
|
||||
- apiGroups:
|
||||
- argoproj.io
|
||||
resources:
|
||||
- workflows
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods/exec
|
||||
verbs:
|
||||
- create
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
- apiGroups:
|
||||
- "apps"
|
||||
resources:
|
||||
- deployments
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- create
|
||||
- update
|
||||
- patch
|
||||
- delete
|
||||
---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: custom-workflow-default
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: custom-workflow
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
FROM arm64v8/ubuntu:latest
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive PATH="/root/miniconda3/bin:${PATH}" TZ=Asia/Shanghai PIP_ROOT_USER_ACTION=ignore
|
||||
|
||||
ARG PATH="/root/miniconda3/bin:${PATH}"
|
||||
|
||||
ADD Miniconda3-py311_24.3.0-0-Linux-aarch64.sh .
|
||||
|
||||
RUN bash *.sh -b -u && ~/miniconda3/bin/conda init bash && rm -rf Miniconda3* ~/.cache
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone &&\
|
||||
rm -rf /etc/apt/sources.list.d/cuda* /etc/apt/sources.list.d/* && gpg --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC 2>&1 > /dev/null &&\
|
||||
gpg --export --armor A4B469963BF863CC | apt-key add - 2>&1 > /dev/null && apt-get update &&\
|
||||
apt-get install -y tmux screen vim wget curl net-tools apt-utils unzip zip git openssl libaio1 libaio-dev iputils-ping openssh-server openssh-client &&\
|
||||
apt-get install -y git-lfs libssl-dev openssl make gcc libffi-dev zlib1g-dev libbz2-dev software-properties-common nginx lsof iftop htop tcpdump sysstat &&\
|
||||
apt-get install -y locate cmake g++ build-essential zlib1g-dev libncurses5-dev libgdbm-dev language-pack-zh-hans tree libgl1 libglib2.0-0 &&\
|
||||
apt-get install -y libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev libjpeg-dev &&\
|
||||
apt-get install -y build-essential liblzma-dev libsqlite3-dev pkg-config libnuma-dev libgl1-mesa-glx xvfb &&\
|
||||
apt-get install -y libssh2-1-dev ca-certificates libfreetype6-dev mlocate swig llvm libncursesw5-dev tk-dev &&\
|
||||
apt-get install -y openmpi-bin openmpi-common libopenmpi-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg &&\
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null &&\
|
||||
apt update && apt install gh && apt-get clean && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/*
|
||||
|
||||
RUN pip install --upgrade pip
|
||||
|
||||
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn && pip config set global.timeout 60
|
||||
|
||||
RUN pip install --no-cache-dir huggingface_hub modelscope cloudpickle tensorboard jupyterlab jupyterlab-language-pack-zh-CN
|
||||
|
||||
ADD plugin.jupyterlab-settings /root/.jupyter/lab/user-settings/\@jupyterlab/translation-extension/
|
||||
|
||||
RUN jupyter lab --generate-config
|
||||
|
||||
RUN echo "c.ServerApp.allow_root = True\nc.ExtensionApp.open_browser = False\nc.ServerApp.password_required = False\nc.ServerApp.ip = '*'\nc.ServerApp.token = ''\nc.ServerApp.root_dir = '/opt/notebooks/'\nc.ServerApp.tornado_settings = {'headers':{'Content-Security-Policy':\"frame-ancestors 'self' * \"}}\nc.NotebookApp.terminado_settings = {'shell_command' : ['/bin/bash']}" >> /root/.jupyter/jupyter_lab_config.py
|
||||
# 设置环境变量以避免在Jupyter中出现问题
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
# 设置工作目录
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
# 启动Jupyter Notebook服务器,并且让它在后台持续运行
|
||||
CMD ["jupyter", "lab"]
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
FROM ccr.ccs.tencentyun.com/somunslotus/jupyter:test1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive PATH="/root/miniconda3/bin:${PATH}" TZ=Asia/Shanghai PIP_ROOT_USER_ACTION=ignore
|
||||
|
||||
ARG PATH="/root/miniconda3/bin:${PATH}"
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /opt
|
||||
|
||||
# 启动Jupyter Notebook服务器,并且让它在后台持续运行
|
||||
CMD ["jupyter", "lab"]
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
// Extension Manager
|
||||
// @jupyterlab/extensionmanager-extension:plugin
|
||||
// Extension manager settings.
|
||||
// *********************************************
|
||||
|
||||
// Disclaimed Status
|
||||
// Whether the user understand that extensions managed through this interface run arbitrary code that may be dangerous
|
||||
"disclaimed": true,
|
||||
|
||||
// Enabled Status
|
||||
// Enables extension manager (requires Node.js/npm).
|
||||
// WARNING: installing untrusted extensions may be unsafe.
|
||||
"enabled": true
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: local-path-storage
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: local-path-provisioner-service-account
|
||||
namespace: local-path-storage
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: local-path-provisioner-role
|
||||
namespace: local-path-storage
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["get", "list", "watch", "create", "patch", "update", "delete"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: local-path-provisioner-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["nodes", "persistentvolumeclaims", "configmaps", "pods", "pods/log"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumes"]
|
||||
verbs: ["get", "list", "watch", "create", "patch", "update", "delete"]
|
||||
- apiGroups: [""]
|
||||
resources: ["events"]
|
||||
verbs: ["create", "patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["storageclasses"]
|
||||
verbs: ["get", "list", "watch"]
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: local-path-provisioner-bind
|
||||
namespace: local-path-storage
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: local-path-provisioner-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: local-path-provisioner-service-account
|
||||
namespace: local-path-storage
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: local-path-provisioner-bind
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: local-path-provisioner-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: local-path-provisioner-service-account
|
||||
namespace: local-path-storage
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: local-path-provisioner
|
||||
namespace: local-path-storage
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: local-path-provisioner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: local-path-provisioner
|
||||
spec:
|
||||
serviceAccountName: local-path-provisioner-service-account
|
||||
containers:
|
||||
- name: local-path-provisioner
|
||||
image: ccr.ccs.tencentyun.com/somunslotus/rancher-local-path-provisioner:v0.0.30-arm
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- local-path-provisioner
|
||||
- --debug
|
||||
- start
|
||||
- --config
|
||||
- /etc/config/config.json
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /etc/config/
|
||||
env:
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CONFIG_MOUNT_PATH
|
||||
value: /etc/config/
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: local-path-config
|
||||
|
||||
---
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: local-path
|
||||
provisioner: rancher.io/local-path
|
||||
volumeBindingMode: WaitForFirstConsumer
|
||||
reclaimPolicy: Delete
|
||||
|
||||
---
|
||||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: local-path-config
|
||||
namespace: local-path-storage
|
||||
data:
|
||||
config.json: |-
|
||||
{
|
||||
"nodePathMap":[
|
||||
{
|
||||
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
|
||||
"paths":["/opt/local-path-provisioner"]
|
||||
}
|
||||
]
|
||||
}
|
||||
setup: |-
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
mkdir -m 0777 -p "$VOL_DIR"
|
||||
teardown: |-
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
rm -rf "$VOL_DIR"
|
||||
helperPod.yaml: |-
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: helper-pod
|
||||
spec:
|
||||
priorityClassName: system-node-critical
|
||||
tolerations:
|
||||
- key: node.kubernetes.io/disk-pressure
|
||||
operator: Exists
|
||||
effect: NoSchedule
|
||||
containers:
|
||||
- name: helper-pod
|
||||
image: busybox
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
#apiVersion: v1
|
||||
#kind: PersistentVolumeClaim
|
||||
#metadata:
|
||||
# name: grafana-pvc
|
||||
#spec:
|
||||
# storageClassName: juicefs-sc
|
||||
# accessModes:
|
||||
# - ReadWriteOnce
|
||||
# resources:
|
||||
# requests:
|
||||
# storage: 10Gi
|
||||
#---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: grafana
|
||||
name: grafana
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: grafana
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: grafana
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 472
|
||||
supplementalGroups:
|
||||
- 0
|
||||
containers:
|
||||
- name: grafana
|
||||
image: grafana/grafana:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
name: http-grafana
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /robots.txt
|
||||
port: 3000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 30
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 2
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
tcpSocket:
|
||||
port: 3000
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1000m
|
||||
memory: 2000Mi
|
||||
# volumeMounts:
|
||||
# - mountPath: /var/lib/grafana
|
||||
# name: grafana-hostpath
|
||||
# subPath: grafana
|
||||
# volumes:
|
||||
# - name: grafana-hostpath
|
||||
# hostPath:
|
||||
# path: /platform-data
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: grafana
|
||||
spec:
|
||||
ports:
|
||||
- port: 3000
|
||||
protocol: TCP
|
||||
targetPort: http-grafana
|
||||
nodePort: 31825
|
||||
selector:
|
||||
app: grafana
|
||||
sessionAffinity: None
|
||||
type: NodePort
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
## Install grafana on Loki-log
|
||||
|
||||
安装之前需要确认storageclass是否存在,如果不存在,则需要创建storageclass
|
||||
|
||||
```
|
||||
kubectl create namespace loki-log
|
||||
kubectl apply -f grafana.yaml
|
||||
```
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Define images and tags
|
||||
images=(
|
||||
"ccr.ccs.tencentyun.com/somunslotus/quay.io-prometheus-operator-prometheus-config-reloader:v0.67.1-arm quay.io/prometheus-operator/prometheus-config-reloader:v0.67.1"
|
||||
"ccr.ccs.tencentyun.com/somunslotus/grafana-agent:v0.39.1-arm grafana/agent:v0.39.1"
|
||||
"ccr.ccs.tencentyun.com/somunslotus/grafana-promtail:latest-arm grafana/promtail:latest"
|
||||
"ccr.ccs.tencentyun.com/somunslotus/nginxinc/nginx-unprivileged:1.24-alpine-arm nginxinc/nginx-unprivileged:1.24-alpine"
|
||||
"ccr.ccs.tencentyun.com/somunslotus/grafana-agent-operator:v0.39.1-arm grafana/agent-operator:v0.39.1"
|
||||
"ccr.ccs.tencentyun.com/somunslotus/grafana-loki:2.9.3-arm grafana/loki:2.9.3"
|
||||
"ccr.ccs.tencentyun.com/somunslotus/grafana-grafana:latest-arm grafana/grafana:latest"
|
||||
)
|
||||
|
||||
# Loop through each image, pull, and tag
|
||||
for image in "${images[@]}"; do
|
||||
# Split each entry into source and destination
|
||||
src="${image%% *}"
|
||||
dst="${image##* }"
|
||||
|
||||
# Pull the source image
|
||||
echo "Pulling $src..."
|
||||
docker pull "$src"
|
||||
|
||||
# Tag the image to the original target
|
||||
echo "Tagging $src as $dst..."
|
||||
docker tag "$src" "$dst"
|
||||
done
|
||||
|
||||
echo "All images have been pulled and retagged."
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
## Install Loki
|
||||
安装前先确认values.yaml里面的strorageclass和s3(minio)配置正确
|
||||
|
||||
###
|
||||
```
|
||||
kubectl create namespace loki-log
|
||||
helm upgrade --install loki ./loki -n loki-log -f values.yaml
|
||||
```
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -0,0 +1,22 @@
|
|||
loki:
|
||||
enabled: true
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClassName: hostpath
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 10Gi
|
||||
|
||||
promtail:
|
||||
enabled: true
|
||||
|
||||
grafana:
|
||||
enabled: true
|
||||
service:
|
||||
type: NodePort
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClassName: hostpath
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 10Gi
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
dependencies:
|
||||
- name: minio
|
||||
repository: https://charts.min.io/
|
||||
version: 4.0.15
|
||||
- name: grafana-agent-operator
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 0.3.15
|
||||
digest: sha256:b7a42cd0e56544f6168a586fde03e26c801bb20cf69bc004a8f6000d93b98100
|
||||
generated: "2024-01-27T21:57:28.190462917+05:30"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
apiVersion: v2
|
||||
appVersion: 2.9.3
|
||||
dependencies:
|
||||
- alias: minio
|
||||
condition: minio.enabled
|
||||
name: minio
|
||||
repository: https://charts.min.io/
|
||||
version: 4.0.15
|
||||
- alias: grafana-agent-operator
|
||||
condition: monitoring.selfMonitoring.grafanaAgent.installOperator
|
||||
name: grafana-agent-operator
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 0.3.15
|
||||
description: Helm chart for Grafana Loki in simple, scalable mode
|
||||
home: https://grafana.github.io/helm-charts
|
||||
icon: https://grafana.com/docs/loki/latest/logo_and_name.png
|
||||
maintainers:
|
||||
- name: trevorwhitney
|
||||
- name: jeschkies
|
||||
name: loki
|
||||
sources:
|
||||
- https://github.com/grafana/loki
|
||||
- https://grafana.com/oss/loki/
|
||||
- https://grafana.com/docs/loki/latest/
|
||||
type: application
|
||||
version: 5.42.0
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
.DEFAULT_GOAL := all
|
||||
.PHONY: lint lint-yaml
|
||||
|
||||
lint: lint-yaml
|
||||
|
||||
lint-yaml:
|
||||
yamllint -c $(CURDIR)/src/.yamllint.yaml $(CURDIR)/src
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# loki
|
||||
|
||||
  
|
||||
|
||||
Helm chart for Grafana Loki in simple, scalable mode
|
||||
|
||||
## Source Code
|
||||
|
||||
* <https://github.com/grafana/loki>
|
||||
* <https://grafana.com/oss/loki/>
|
||||
* <https://grafana.com/docs/loki/latest/>
|
||||
|
||||
## Requirements
|
||||
|
||||
| Repository | Name | Version |
|
||||
|------------|------|---------|
|
||||
| https://charts.min.io/ | minio(minio) | 4.0.15 |
|
||||
| https://grafana.github.io/helm-charts | grafana-agent-operator(grafana-agent-operator) | 0.3.15 |
|
||||
|
||||
Find more information in the Loki Helm Chart [documentation](https://grafana.com/docs/loki/next/installation/helm).
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: v2
|
||||
appVersion: 0.39.1
|
||||
description: A Helm chart for Grafana Agent Operator
|
||||
home: https://grafana.com/docs/agent/v0.39/
|
||||
icon: https://raw.githubusercontent.com/grafana/agent/v0.39.1/docs/sources/assets/logo_and_name.png
|
||||
maintainers:
|
||||
- email: grafana-agent-team@googlegroups.com
|
||||
name: Grafana Agent Team
|
||||
name: grafana-agent-operator
|
||||
sources:
|
||||
- https://github.com/grafana/agent/tree/v0.39.1/pkg/operator
|
||||
type: application
|
||||
version: 0.3.15
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
# grafana-agent-operator
|
||||
|
||||
  
|
||||
|
||||
A Helm chart for Grafana Agent Operator
|
||||
|
||||
⚠️ **Please create issues relating to this Helm chart in the [Agent](https://github.com/grafana/agent/issues) repo.**
|
||||
|
||||
## Source Code
|
||||
|
||||
* <https://github.com/grafana/agent/tree/v0.39.1/pkg/operator>
|
||||
|
||||
Note that this chart does not provision custom resources like `GrafanaAgent` and `MetricsInstance` (formerly `PrometheusInstance`) or any `*Monitor` resources.
|
||||
|
||||
To learn how to deploy these resources, please see Grafana's [Agent Operator getting started guide](https://grafana.com/docs/agent/latest/operator/getting-started/).
|
||||
|
||||
## CRDs
|
||||
|
||||
The CRDs are synced into this chart manually (for now) from the Grafana Agent [GitHub repo](https://github.com/grafana/agent/tree/main/operations/agent-static-operator/crds). To learn more about how Helm manages CRDs, please see [Custom Resource Definitions](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) from the Helm docs.
|
||||
|
||||
## Get Repo Info
|
||||
|
||||
```console
|
||||
helm repo add grafana https://grafana.github.io/helm-charts
|
||||
helm repo update
|
||||
```
|
||||
|
||||
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
helm install my-release grafana/grafana-agent-operator
|
||||
```
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the my-release deployment:
|
||||
|
||||
```console
|
||||
helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Upgrading an existing Release to a new major version
|
||||
|
||||
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions. Until this chart's version reaches `v1.0`, there are no promises of backwards compatibility.
|
||||
|
||||
## Values
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| affinity | object | `{}` | Pod affinity configuration |
|
||||
| annotations | object | `{}` | Annotations for the Deployment |
|
||||
| containerSecurityContext | object | `{}` | Container security context (allowPrivilegeEscalation, etc.) |
|
||||
| extraArgs | list | `[]` | List of additional cli arguments to configure agent-operator (example: `--log.level`) |
|
||||
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
|
||||
| hostAliases | list | `[]` | hostAliases to add |
|
||||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
|
||||
| image.pullSecrets | list | `[]` | Image pull secrets |
|
||||
| image.registry | string | `"docker.io"` | Image registry |
|
||||
| image.repository | string | `"grafana/agent-operator"` | Image repo |
|
||||
| image.tag | string | `"v0.39.1"` | Image tag |
|
||||
| kubeletService | object | `{"namespace":"default","serviceName":"kubelet"}` | If both are set, Agent Operator will create and maintain a service for scraping kubelets https://grafana.com/docs/agent/latest/operator/getting-started/#monitor-kubelets |
|
||||
| nameOverride | string | `""` | Overrides the chart's name |
|
||||
| nodeSelector | object | `{}` | nodeSelector configuration |
|
||||
| podAnnotations | object | `{}` | Annotations for the Deployment Pods |
|
||||
| podLabels | object | `{}` | Annotations for the Deployment Pods |
|
||||
| podSecurityContext | object | `{}` | Pod security context (runAsUser, etc.) |
|
||||
| rbac.create | bool | `true` | Toggle to create ClusterRole and ClusterRoleBinding |
|
||||
| rbac.podSecurityPolicyName | string | `""` | Name of a PodSecurityPolicy to use in the ClusterRole. If unset, no PodSecurityPolicy is used. |
|
||||
| resources | object | `{}` | Resource limits and requests config |
|
||||
| serviceAccount.create | bool | `true` | Toggle to create ServiceAccount |
|
||||
| serviceAccount.name | string | `nil` | Service account name |
|
||||
| tolerations | list | `[]` | Tolerations applied to Pods |
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
{{ template "chart.header" . }}
|
||||
|
||||
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
|
||||
|
||||
{{ template "chart.description" . }}
|
||||
|
||||
⚠️ **Please create issues relating to this Helm chart in the [Agent](https://github.com/grafana/agent/issues) repo.**
|
||||
|
||||
{{ template "chart.sourcesSection" . }}
|
||||
|
||||
{{ template "chart.requirementsSection" . }}
|
||||
|
||||
Note that this chart does not provision custom resources like `GrafanaAgent` and `MetricsInstance` (formerly `PrometheusInstance`) or any `*Monitor` resources.
|
||||
|
||||
To learn how to deploy these resources, please see Grafana's [Agent Operator getting started guide](https://grafana.com/docs/agent/latest/operator/getting-started/).
|
||||
|
||||
## CRDs
|
||||
|
||||
The CRDs are synced into this chart manually (for now) from the Grafana Agent [GitHub repo](https://github.com/grafana/agent/tree/main/operations/agent-static-operator/crds). To learn more about how Helm manages CRDs, please see [Custom Resource Definitions](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) from the Helm docs.
|
||||
|
||||
## Get Repo Info
|
||||
|
||||
```console
|
||||
helm repo add grafana https://grafana.github.io/helm-charts
|
||||
helm repo update
|
||||
```
|
||||
|
||||
_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
helm install my-release grafana/grafana-agent-operator
|
||||
```
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the my-release deployment:
|
||||
|
||||
```console
|
||||
helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Upgrading an existing Release to a new major version
|
||||
|
||||
A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions. Until this chart's version reaches `v1.0`, there are no promises of backwards compatibility.
|
||||
|
||||
{{ template "chart.valuesSection" . }}
|
||||
|
|
@ -0,0 +1,679 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
creationTimestamp: null
|
||||
name: podmonitors.monitoring.coreos.com
|
||||
spec:
|
||||
group: monitoring.coreos.com
|
||||
names:
|
||||
categories:
|
||||
- prometheus-operator
|
||||
kind: PodMonitor
|
||||
listKind: PodMonitorList
|
||||
plural: podmonitors
|
||||
shortNames:
|
||||
- pmon
|
||||
singular: podmonitor
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: PodMonitor defines monitoring for a set of pods.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Specification of desired Pod selection for target discovery
|
||||
by Prometheus.
|
||||
properties:
|
||||
attachMetadata:
|
||||
description: Attaches node metadata to discovered targets. Requires
|
||||
Prometheus v2.35.0 and above.
|
||||
properties:
|
||||
node:
|
||||
description: When set to true, Prometheus must have permissions
|
||||
to get Nodes.
|
||||
type: boolean
|
||||
type: object
|
||||
jobLabel:
|
||||
description: The label to use to retrieve the job name from.
|
||||
type: string
|
||||
labelLimit:
|
||||
description: Per-scrape limit on number of labels that will be accepted
|
||||
for a sample. Only valid in Prometheus versions 2.27.0 and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
labelNameLengthLimit:
|
||||
description: Per-scrape limit on length of labels name that will be
|
||||
accepted for a sample. Only valid in Prometheus versions 2.27.0
|
||||
and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
labelValueLengthLimit:
|
||||
description: Per-scrape limit on length of labels value that will
|
||||
be accepted for a sample. Only valid in Prometheus versions 2.27.0
|
||||
and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
namespaceSelector:
|
||||
description: Selector to select which namespaces the Endpoints objects
|
||||
are discovered from.
|
||||
properties:
|
||||
any:
|
||||
description: Boolean describing whether all namespaces are selected
|
||||
in contrast to a list restricting them.
|
||||
type: boolean
|
||||
matchNames:
|
||||
description: List of namespace names to select from.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
podMetricsEndpoints:
|
||||
description: A list of endpoints allowed as part of this PodMonitor.
|
||||
items:
|
||||
description: PodMetricsEndpoint defines a scrapeable endpoint of
|
||||
a Kubernetes Pod serving Prometheus metrics.
|
||||
properties:
|
||||
authorization:
|
||||
description: Authorization section for this endpoint
|
||||
properties:
|
||||
credentials:
|
||||
description: The secret's key that contains the credentials
|
||||
of the request
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type:
|
||||
description: Set the authentication type. Defaults to Bearer,
|
||||
Basic will cause an error
|
||||
type: string
|
||||
type: object
|
||||
basicAuth:
|
||||
description: 'BasicAuth allow an endpoint to authenticate over
|
||||
basic authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint'
|
||||
properties:
|
||||
password:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the password for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
username:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the username for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
bearerTokenSecret:
|
||||
description: Secret to mount to read bearer token for scraping
|
||||
targets. The secret needs to be in the same namespace as the
|
||||
pod monitor and accessible by the Prometheus Operator.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
enableHttp2:
|
||||
description: Whether to enable HTTP2.
|
||||
type: boolean
|
||||
filterRunning:
|
||||
description: 'Drop pods that are not running. (Failed, Succeeded).
|
||||
Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase'
|
||||
type: boolean
|
||||
followRedirects:
|
||||
description: FollowRedirects configures whether scrape requests
|
||||
follow HTTP 3xx redirects.
|
||||
type: boolean
|
||||
honorLabels:
|
||||
description: HonorLabels chooses the metric's labels on collisions
|
||||
with target labels.
|
||||
type: boolean
|
||||
honorTimestamps:
|
||||
description: HonorTimestamps controls whether Prometheus respects
|
||||
the timestamps present in scraped data.
|
||||
type: boolean
|
||||
interval:
|
||||
description: Interval at which metrics should be scraped If
|
||||
not specified Prometheus' global scrape interval is used.
|
||||
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
|
||||
type: string
|
||||
metricRelabelings:
|
||||
description: MetricRelabelConfigs to apply to samples before
|
||||
ingestion.
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the
|
||||
label set, being applied to samples before ingestion. It
|
||||
defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex
|
||||
capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name
|
||||
which may only contain ASCII letters, numbers, as
|
||||
well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
oauth2:
|
||||
description: OAuth2 for the URL. Only valid in Prometheus versions
|
||||
2.27.0 and newer.
|
||||
properties:
|
||||
clientId:
|
||||
description: The secret or configmap containing the OAuth2
|
||||
client id
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
clientSecret:
|
||||
description: The secret containing the OAuth2 client secret
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endpointParams:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Parameters to append to the token URL
|
||||
type: object
|
||||
scopes:
|
||||
description: OAuth2 scopes used for the token request
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
tokenUrl:
|
||||
description: The URL to fetch the token from
|
||||
minLength: 1
|
||||
type: string
|
||||
required:
|
||||
- clientId
|
||||
- clientSecret
|
||||
- tokenUrl
|
||||
type: object
|
||||
params:
|
||||
additionalProperties:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
description: Optional HTTP URL parameters
|
||||
type: object
|
||||
path:
|
||||
description: HTTP path to scrape for metrics. If empty, Prometheus
|
||||
uses the default value (e.g. `/metrics`).
|
||||
type: string
|
||||
port:
|
||||
description: Name of the pod port this endpoint refers to. Mutually
|
||||
exclusive with targetPort.
|
||||
type: string
|
||||
proxyUrl:
|
||||
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
|
||||
to proxy through this endpoint.
|
||||
type: string
|
||||
relabelings:
|
||||
description: 'RelabelConfigs to apply to samples before scraping.
|
||||
Prometheus Operator automatically adds relabelings for a few
|
||||
standard Kubernetes fields. The original scrape job''s name
|
||||
is available via the `__tmp_prometheus_job_name` label. More
|
||||
info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the
|
||||
label set, being applied to samples before ingestion. It
|
||||
defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex
|
||||
capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name
|
||||
which may only contain ASCII letters, numbers, as
|
||||
well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
scheme:
|
||||
description: HTTP scheme to use for scraping. `http` and `https`
|
||||
are the expected values unless you rewrite the `__scheme__`
|
||||
label via relabeling. If empty, Prometheus uses the default
|
||||
value `http`.
|
||||
enum:
|
||||
- http
|
||||
- https
|
||||
type: string
|
||||
scrapeTimeout:
|
||||
description: Timeout after which the scrape is ended If not
|
||||
specified, the Prometheus global scrape interval is used.
|
||||
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
|
||||
type: string
|
||||
targetPort:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: 'Deprecated: Use ''port'' instead.'
|
||||
x-kubernetes-int-or-string: true
|
||||
tlsConfig:
|
||||
description: TLS configuration to use when scraping the endpoint.
|
||||
properties:
|
||||
ca:
|
||||
description: Certificate authority used when verifying server
|
||||
certificates.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
cert:
|
||||
description: Client certificate to present when doing client-authentication.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
insecureSkipVerify:
|
||||
description: Disable target certificate validation.
|
||||
type: boolean
|
||||
keySecret:
|
||||
description: Secret containing the client key file for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
serverName:
|
||||
description: Used to verify the hostname for the targets.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
type: array
|
||||
podTargetLabels:
|
||||
description: PodTargetLabels transfers labels on the Kubernetes Pod
|
||||
onto the target.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
sampleLimit:
|
||||
description: SampleLimit defines per-scrape limit on number of scraped
|
||||
samples that will be accepted.
|
||||
format: int64
|
||||
type: integer
|
||||
selector:
|
||||
description: Selector to select Pod objects.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
targetLimit:
|
||||
description: TargetLimit defines a limit on the number of scraped
|
||||
targets that will be accepted.
|
||||
format: int64
|
||||
type: integer
|
||||
required:
|
||||
- podMetricsEndpoints
|
||||
- selector
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
|
|
@ -0,0 +1,722 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
creationTimestamp: null
|
||||
name: probes.monitoring.coreos.com
|
||||
spec:
|
||||
group: monitoring.coreos.com
|
||||
names:
|
||||
categories:
|
||||
- prometheus-operator
|
||||
kind: Probe
|
||||
listKind: ProbeList
|
||||
plural: probes
|
||||
shortNames:
|
||||
- prb
|
||||
singular: probe
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: Probe defines monitoring for a set of static targets or ingresses.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Specification of desired Ingress selection for target discovery
|
||||
by Prometheus.
|
||||
properties:
|
||||
authorization:
|
||||
description: Authorization section for this endpoint
|
||||
properties:
|
||||
credentials:
|
||||
description: The secret's key that contains the credentials of
|
||||
the request
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be
|
||||
a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be
|
||||
defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type:
|
||||
description: Set the authentication type. Defaults to Bearer,
|
||||
Basic will cause an error
|
||||
type: string
|
||||
type: object
|
||||
basicAuth:
|
||||
description: 'BasicAuth allow an endpoint to authenticate over basic
|
||||
authentication. More info: https://prometheus.io/docs/operating/configuration/#endpoint'
|
||||
properties:
|
||||
password:
|
||||
description: The secret in the service monitor namespace that
|
||||
contains the password for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be
|
||||
a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be
|
||||
defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
username:
|
||||
description: The secret in the service monitor namespace that
|
||||
contains the username for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be
|
||||
a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be
|
||||
defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
bearerTokenSecret:
|
||||
description: Secret to mount to read bearer token for scraping targets.
|
||||
The secret needs to be in the same namespace as the probe and accessible
|
||||
by the Prometheus Operator.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be a
|
||||
valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
interval:
|
||||
description: Interval at which targets are probed using the configured
|
||||
prober. If not specified Prometheus' global scrape interval is used.
|
||||
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
|
||||
type: string
|
||||
jobName:
|
||||
description: The job name assigned to scraped metrics by default.
|
||||
type: string
|
||||
labelLimit:
|
||||
description: Per-scrape limit on number of labels that will be accepted
|
||||
for a sample. Only valid in Prometheus versions 2.27.0 and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
labelNameLengthLimit:
|
||||
description: Per-scrape limit on length of labels name that will be
|
||||
accepted for a sample. Only valid in Prometheus versions 2.27.0
|
||||
and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
labelValueLengthLimit:
|
||||
description: Per-scrape limit on length of labels value that will
|
||||
be accepted for a sample. Only valid in Prometheus versions 2.27.0
|
||||
and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
metricRelabelings:
|
||||
description: MetricRelabelConfigs to apply to samples before ingestion.
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the label
|
||||
set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section
|
||||
of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching. Default
|
||||
is 'replace'. uppercase and lowercase actions require Prometheus
|
||||
>= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source label
|
||||
values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex capture
|
||||
groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source label
|
||||
values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing labels.
|
||||
Their content is concatenated using the configured separator
|
||||
and matched against the configured regular expression for
|
||||
the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name which
|
||||
may only contain ASCII letters, numbers, as well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written in
|
||||
a replace action. It is mandatory for replace actions. Regex
|
||||
capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
module:
|
||||
description: 'The module to use for probing specifying how to probe
|
||||
the target. Example module configuring in the blackbox exporter:
|
||||
https://github.com/prometheus/blackbox_exporter/blob/master/example.yml'
|
||||
type: string
|
||||
oauth2:
|
||||
description: OAuth2 for the URL. Only valid in Prometheus versions
|
||||
2.27.0 and newer.
|
||||
properties:
|
||||
clientId:
|
||||
description: The secret or configmap containing the OAuth2 client
|
||||
id
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
clientSecret:
|
||||
description: The secret containing the OAuth2 client secret
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be
|
||||
a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be
|
||||
defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endpointParams:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Parameters to append to the token URL
|
||||
type: object
|
||||
scopes:
|
||||
description: OAuth2 scopes used for the token request
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
tokenUrl:
|
||||
description: The URL to fetch the token from
|
||||
minLength: 1
|
||||
type: string
|
||||
required:
|
||||
- clientId
|
||||
- clientSecret
|
||||
- tokenUrl
|
||||
type: object
|
||||
prober:
|
||||
description: Specification for the prober to use for probing targets.
|
||||
The prober.URL parameter is required. Targets cannot be probed if
|
||||
left empty.
|
||||
properties:
|
||||
path:
|
||||
default: /probe
|
||||
description: Path to collect metrics from. Defaults to `/probe`.
|
||||
type: string
|
||||
proxyUrl:
|
||||
description: Optional ProxyURL.
|
||||
type: string
|
||||
scheme:
|
||||
description: HTTP scheme to use for scraping. `http` and `https`
|
||||
are the expected values unless you rewrite the `__scheme__`
|
||||
label via relabeling. If empty, Prometheus uses the default
|
||||
value `http`.
|
||||
enum:
|
||||
- http
|
||||
- https
|
||||
type: string
|
||||
url:
|
||||
description: Mandatory URL of the prober.
|
||||
type: string
|
||||
required:
|
||||
- url
|
||||
type: object
|
||||
sampleLimit:
|
||||
description: SampleLimit defines per-scrape limit on number of scraped
|
||||
samples that will be accepted.
|
||||
format: int64
|
||||
type: integer
|
||||
scrapeTimeout:
|
||||
description: Timeout for scraping metrics from the Prometheus exporter.
|
||||
If not specified, the Prometheus global scrape timeout is used.
|
||||
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
|
||||
type: string
|
||||
targetLimit:
|
||||
description: TargetLimit defines a limit on the number of scraped
|
||||
targets that will be accepted.
|
||||
format: int64
|
||||
type: integer
|
||||
targets:
|
||||
description: Targets defines a set of static or dynamically discovered
|
||||
targets to probe.
|
||||
properties:
|
||||
ingress:
|
||||
description: ingress defines the Ingress objects to probe and
|
||||
the relabeling configuration. If `staticConfig` is also defined,
|
||||
`staticConfig` takes precedence.
|
||||
properties:
|
||||
namespaceSelector:
|
||||
description: From which namespaces to select Ingress objects.
|
||||
properties:
|
||||
any:
|
||||
description: Boolean describing whether all namespaces
|
||||
are selected in contrast to a list restricting them.
|
||||
type: boolean
|
||||
matchNames:
|
||||
description: List of namespace names to select from.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
relabelingConfigs:
|
||||
description: 'RelabelConfigs to apply to the label set of
|
||||
the target before it gets scraped. The original ingress
|
||||
address is available via the `__tmp_prometheus_ingress_address`
|
||||
label. It can be used to customize the probed URL. The original
|
||||
scrape job''s name is available via the `__tmp_prometheus_job_name`
|
||||
label. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of
|
||||
the label set, being applied to samples before ingestion.
|
||||
It defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex
|
||||
replace is performed if the regular expression matches.
|
||||
Regex capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label
|
||||
name which may only contain ASCII letters, numbers,
|
||||
as well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
selector:
|
||||
description: Selector to select the Ingress objects.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector
|
||||
requirements. The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector
|
||||
that contains values, a key, and an operator that
|
||||
relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector
|
||||
applies to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship
|
||||
to a set of values. Valid operators are In, NotIn,
|
||||
Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values.
|
||||
If the operator is In or NotIn, the values array
|
||||
must be non-empty. If the operator is Exists or
|
||||
DoesNotExist, the values array must be empty.
|
||||
This array is replaced during a strategic merge
|
||||
patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs.
|
||||
A single {key,value} in the matchLabels map is equivalent
|
||||
to an element of matchExpressions, whose key field is
|
||||
"key", the operator is "In", and the values array contains
|
||||
only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
staticConfig:
|
||||
description: 'staticConfig defines the static list of targets
|
||||
to probe and the relabeling configuration. If `ingress` is also
|
||||
defined, `staticConfig` takes precedence. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config.'
|
||||
properties:
|
||||
labels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Labels assigned to all metrics scraped from the
|
||||
targets.
|
||||
type: object
|
||||
relabelingConfigs:
|
||||
description: 'RelabelConfigs to apply to the label set of
|
||||
the targets before it gets scraped. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of
|
||||
the label set, being applied to samples before ingestion.
|
||||
It defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex
|
||||
replace is performed if the regular expression matches.
|
||||
Regex capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label
|
||||
name which may only contain ASCII letters, numbers,
|
||||
as well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
static:
|
||||
description: The list of hosts to probe.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
type: object
|
||||
tlsConfig:
|
||||
description: TLS configuration to use when scraping the endpoint.
|
||||
properties:
|
||||
ca:
|
||||
description: Certificate authority used when verifying server
|
||||
certificates.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
cert:
|
||||
description: Client certificate to present when doing client-authentication.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
insecureSkipVerify:
|
||||
description: Disable target certificate validation.
|
||||
type: boolean
|
||||
keySecret:
|
||||
description: Secret containing the client key file for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be
|
||||
a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be
|
||||
defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
serverName:
|
||||
description: Used to verify the hostname for the targets.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
|
|
@ -0,0 +1,709 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
creationTimestamp: null
|
||||
name: servicemonitors.monitoring.coreos.com
|
||||
spec:
|
||||
group: monitoring.coreos.com
|
||||
names:
|
||||
categories:
|
||||
- prometheus-operator
|
||||
kind: ServiceMonitor
|
||||
listKind: ServiceMonitorList
|
||||
plural: servicemonitors
|
||||
shortNames:
|
||||
- smon
|
||||
singular: servicemonitor
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ServiceMonitor defines monitoring for a set of services.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Specification of desired Service selection for target discovery
|
||||
by Prometheus.
|
||||
properties:
|
||||
attachMetadata:
|
||||
description: Attaches node metadata to discovered targets. Requires
|
||||
Prometheus v2.37.0 and above.
|
||||
properties:
|
||||
node:
|
||||
description: When set to true, Prometheus must have permissions
|
||||
to get Nodes.
|
||||
type: boolean
|
||||
type: object
|
||||
endpoints:
|
||||
description: A list of endpoints allowed as part of this ServiceMonitor.
|
||||
items:
|
||||
description: Endpoint defines a scrapeable endpoint serving Prometheus
|
||||
metrics.
|
||||
properties:
|
||||
authorization:
|
||||
description: Authorization section for this endpoint
|
||||
properties:
|
||||
credentials:
|
||||
description: The secret's key that contains the credentials
|
||||
of the request
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type:
|
||||
description: Set the authentication type. Defaults to Bearer,
|
||||
Basic will cause an error
|
||||
type: string
|
||||
type: object
|
||||
basicAuth:
|
||||
description: 'BasicAuth allow an endpoint to authenticate over
|
||||
basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
|
||||
properties:
|
||||
password:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the password for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
username:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the username for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
bearerTokenFile:
|
||||
description: File to read bearer token for scraping targets.
|
||||
type: string
|
||||
bearerTokenSecret:
|
||||
description: Secret to mount to read bearer token for scraping
|
||||
targets. The secret needs to be in the same namespace as the
|
||||
service monitor and accessible by the Prometheus Operator.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
enableHttp2:
|
||||
description: Whether to enable HTTP2.
|
||||
type: boolean
|
||||
filterRunning:
|
||||
description: 'Drop pods that are not running. (Failed, Succeeded).
|
||||
Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase'
|
||||
type: boolean
|
||||
followRedirects:
|
||||
description: FollowRedirects configures whether scrape requests
|
||||
follow HTTP 3xx redirects.
|
||||
type: boolean
|
||||
honorLabels:
|
||||
description: HonorLabels chooses the metric's labels on collisions
|
||||
with target labels.
|
||||
type: boolean
|
||||
honorTimestamps:
|
||||
description: HonorTimestamps controls whether Prometheus respects
|
||||
the timestamps present in scraped data.
|
||||
type: boolean
|
||||
interval:
|
||||
description: Interval at which metrics should be scraped If
|
||||
not specified Prometheus' global scrape interval is used.
|
||||
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
|
||||
type: string
|
||||
metricRelabelings:
|
||||
description: MetricRelabelConfigs to apply to samples before
|
||||
ingestion.
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the
|
||||
label set, being applied to samples before ingestion. It
|
||||
defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex
|
||||
capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name
|
||||
which may only contain ASCII letters, numbers, as
|
||||
well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
oauth2:
|
||||
description: OAuth2 for the URL. Only valid in Prometheus versions
|
||||
2.27.0 and newer.
|
||||
properties:
|
||||
clientId:
|
||||
description: The secret or configmap containing the OAuth2
|
||||
client id
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
clientSecret:
|
||||
description: The secret containing the OAuth2 client secret
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endpointParams:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Parameters to append to the token URL
|
||||
type: object
|
||||
scopes:
|
||||
description: OAuth2 scopes used for the token request
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
tokenUrl:
|
||||
description: The URL to fetch the token from
|
||||
minLength: 1
|
||||
type: string
|
||||
required:
|
||||
- clientId
|
||||
- clientSecret
|
||||
- tokenUrl
|
||||
type: object
|
||||
params:
|
||||
additionalProperties:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
description: Optional HTTP URL parameters
|
||||
type: object
|
||||
path:
|
||||
description: HTTP path to scrape for metrics. If empty, Prometheus
|
||||
uses the default value (e.g. `/metrics`).
|
||||
type: string
|
||||
port:
|
||||
description: Name of the service port this endpoint refers to.
|
||||
Mutually exclusive with targetPort.
|
||||
type: string
|
||||
proxyUrl:
|
||||
description: ProxyURL eg http://proxyserver:2195 Directs scrapes
|
||||
to proxy through this endpoint.
|
||||
type: string
|
||||
relabelings:
|
||||
description: 'RelabelConfigs to apply to samples before scraping.
|
||||
Prometheus Operator automatically adds relabelings for a few
|
||||
standard Kubernetes fields. The original scrape job''s name
|
||||
is available via the `__tmp_prometheus_job_name` label. More
|
||||
info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the
|
||||
label set, being applied to samples before ingestion. It
|
||||
defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex
|
||||
capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name
|
||||
which may only contain ASCII letters, numbers, as
|
||||
well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
scheme:
|
||||
description: HTTP scheme to use for scraping. `http` and `https`
|
||||
are the expected values unless you rewrite the `__scheme__`
|
||||
label via relabeling. If empty, Prometheus uses the default
|
||||
value `http`.
|
||||
enum:
|
||||
- http
|
||||
- https
|
||||
type: string
|
||||
scrapeTimeout:
|
||||
description: Timeout after which the scrape is ended If not
|
||||
specified, the Prometheus global scrape timeout is used unless
|
||||
it is less than `Interval` in which the latter is used.
|
||||
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
|
||||
type: string
|
||||
targetPort:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: Name or number of the target port of the Pod behind
|
||||
the Service, the port must be specified with container port
|
||||
property. Mutually exclusive with port.
|
||||
x-kubernetes-int-or-string: true
|
||||
tlsConfig:
|
||||
description: TLS configuration to use when scraping the endpoint
|
||||
properties:
|
||||
ca:
|
||||
description: Certificate authority used when verifying server
|
||||
certificates.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
caFile:
|
||||
description: Path to the CA cert in the Prometheus container
|
||||
to use for the targets.
|
||||
type: string
|
||||
cert:
|
||||
description: Client certificate to present when doing client-authentication.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
certFile:
|
||||
description: Path to the client cert file in the Prometheus
|
||||
container for the targets.
|
||||
type: string
|
||||
insecureSkipVerify:
|
||||
description: Disable target certificate validation.
|
||||
type: boolean
|
||||
keyFile:
|
||||
description: Path to the client key file in the Prometheus
|
||||
container for the targets.
|
||||
type: string
|
||||
keySecret:
|
||||
description: Secret containing the client key file for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
serverName:
|
||||
description: Used to verify the hostname for the targets.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
type: array
|
||||
jobLabel:
|
||||
description: "JobLabel selects the label from the associated Kubernetes
|
||||
service which will be used as the `job` label for all metrics. \n
|
||||
For example: If in `ServiceMonitor.spec.jobLabel: foo` and in `Service.metadata.labels.foo:
|
||||
bar`, then the `job=\"bar\"` label is added to all metrics. \n If
|
||||
the value of this field is empty or if the label doesn't exist for
|
||||
the given Service, the `job` label of the metrics defaults to the
|
||||
name of the Kubernetes Service."
|
||||
type: string
|
||||
labelLimit:
|
||||
description: Per-scrape limit on number of labels that will be accepted
|
||||
for a sample. Only valid in Prometheus versions 2.27.0 and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
labelNameLengthLimit:
|
||||
description: Per-scrape limit on length of labels name that will be
|
||||
accepted for a sample. Only valid in Prometheus versions 2.27.0
|
||||
and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
labelValueLengthLimit:
|
||||
description: Per-scrape limit on length of labels value that will
|
||||
be accepted for a sample. Only valid in Prometheus versions 2.27.0
|
||||
and newer.
|
||||
format: int64
|
||||
type: integer
|
||||
namespaceSelector:
|
||||
description: Selector to select which namespaces the Kubernetes Endpoints
|
||||
objects are discovered from.
|
||||
properties:
|
||||
any:
|
||||
description: Boolean describing whether all namespaces are selected
|
||||
in contrast to a list restricting them.
|
||||
type: boolean
|
||||
matchNames:
|
||||
description: List of namespace names to select from.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
podTargetLabels:
|
||||
description: PodTargetLabels transfers labels on the Kubernetes `Pod`
|
||||
onto the created metrics.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
sampleLimit:
|
||||
description: SampleLimit defines per-scrape limit on number of scraped
|
||||
samples that will be accepted.
|
||||
format: int64
|
||||
type: integer
|
||||
selector:
|
||||
description: Selector to select Endpoints objects.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
targetLabels:
|
||||
description: TargetLabels transfers labels from the Kubernetes `Service`
|
||||
onto the created metrics.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
targetLimit:
|
||||
description: TargetLimit defines a limit on the number of scraped
|
||||
targets that will be accepted.
|
||||
format: int64
|
||||
type: integer
|
||||
required:
|
||||
- endpoints
|
||||
- selector
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,500 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
creationTimestamp: null
|
||||
name: logsinstances.monitoring.grafana.com
|
||||
spec:
|
||||
group: monitoring.grafana.com
|
||||
names:
|
||||
categories:
|
||||
- agent-operator
|
||||
kind: LogsInstance
|
||||
listKind: LogsInstanceList
|
||||
plural: logsinstances
|
||||
singular: logsinstance
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: LogsInstance controls an individual logs instance within a Grafana
|
||||
Agent deployment.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Spec holds the specification of the desired behavior for
|
||||
the logs instance.
|
||||
properties:
|
||||
additionalScrapeConfigs:
|
||||
description: "AdditionalScrapeConfigs allows specifying a key of a
|
||||
Secret containing additional Grafana Agent logging scrape configurations.
|
||||
Scrape configurations specified are appended to the configurations
|
||||
generated by the Grafana Agent Operator. \n Job configurations specified
|
||||
must have the form as specified in the official Promtail documentation:
|
||||
\n https://grafana.com/docs/loki/latest/clients/promtail/configuration/#scrape_configs
|
||||
\n As scrape configs are appended, the user is responsible to make
|
||||
sure it is valid. Note that using this feature may expose the possibility
|
||||
to break upgrades of Grafana Agent. It is advised to review both
|
||||
Grafana Agent and Promtail release notes to ensure that no incompatible
|
||||
scrape configs are going to break Grafana Agent after the upgrade."
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be a
|
||||
valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
clients:
|
||||
description: Clients controls where logs are written to for this instance.
|
||||
items:
|
||||
description: LogsClientSpec defines the client integration for logs,
|
||||
indicating which Loki server to send logs to.
|
||||
properties:
|
||||
backoffConfig:
|
||||
description: Configures how to retry requests to Loki when a
|
||||
request fails. Defaults to a minPeriod of 500ms, maxPeriod
|
||||
of 5m, and maxRetries of 10.
|
||||
properties:
|
||||
maxPeriod:
|
||||
description: Maximum backoff time between retries.
|
||||
type: string
|
||||
maxRetries:
|
||||
description: Maximum number of retries to perform before
|
||||
giving up a request.
|
||||
type: integer
|
||||
minPeriod:
|
||||
description: Initial backoff time between retries. Time
|
||||
between retries is increased exponentially.
|
||||
type: string
|
||||
type: object
|
||||
basicAuth:
|
||||
description: BasicAuth for the Loki server.
|
||||
properties:
|
||||
password:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the password for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
username:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the username for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
batchSize:
|
||||
description: Maximum batch size (in bytes) of logs to accumulate
|
||||
before sending the batch to Loki.
|
||||
type: integer
|
||||
batchWait:
|
||||
description: Maximum amount of time to wait before sending a
|
||||
batch, even if that batch isn't full.
|
||||
type: string
|
||||
bearerToken:
|
||||
description: BearerToken used for remote_write.
|
||||
type: string
|
||||
bearerTokenFile:
|
||||
description: BearerTokenFile used to read bearer token.
|
||||
type: string
|
||||
externalLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: ExternalLabels are labels to add to any time series
|
||||
when sending data to Loki.
|
||||
type: object
|
||||
oauth2:
|
||||
description: Oauth2 for URL
|
||||
properties:
|
||||
clientId:
|
||||
description: The secret or configmap containing the OAuth2
|
||||
client id
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
clientSecret:
|
||||
description: The secret containing the OAuth2 client secret
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endpointParams:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Parameters to append to the token URL
|
||||
type: object
|
||||
scopes:
|
||||
description: OAuth2 scopes used for the token request
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
tokenUrl:
|
||||
description: The URL to fetch the token from
|
||||
minLength: 1
|
||||
type: string
|
||||
required:
|
||||
- clientId
|
||||
- clientSecret
|
||||
- tokenUrl
|
||||
type: object
|
||||
proxyUrl:
|
||||
description: ProxyURL to proxy requests through. Optional.
|
||||
type: string
|
||||
tenantId:
|
||||
description: Tenant ID used by default to push logs to Loki.
|
||||
If omitted assumes remote Loki is running in single-tenant
|
||||
mode or an authentication layer is used to inject an X-Scope-OrgID
|
||||
header.
|
||||
type: string
|
||||
timeout:
|
||||
description: Maximum time to wait for a server to respond to
|
||||
a request.
|
||||
type: string
|
||||
tlsConfig:
|
||||
description: TLSConfig to use for the client. Only used when
|
||||
the protocol of the URL is https.
|
||||
properties:
|
||||
ca:
|
||||
description: Certificate authority used when verifying server
|
||||
certificates.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
caFile:
|
||||
description: Path to the CA cert in the Prometheus container
|
||||
to use for the targets.
|
||||
type: string
|
||||
cert:
|
||||
description: Client certificate to present when doing client-authentication.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
certFile:
|
||||
description: Path to the client cert file in the Prometheus
|
||||
container for the targets.
|
||||
type: string
|
||||
insecureSkipVerify:
|
||||
description: Disable target certificate validation.
|
||||
type: boolean
|
||||
keyFile:
|
||||
description: Path to the client key file in the Prometheus
|
||||
container for the targets.
|
||||
type: string
|
||||
keySecret:
|
||||
description: Secret containing the client key file for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
serverName:
|
||||
description: Used to verify the hostname for the targets.
|
||||
type: string
|
||||
type: object
|
||||
url:
|
||||
description: 'URL is the URL where Loki is listening. Must be
|
||||
a full HTTP URL, including protocol. Required. Example: https://logs-prod-us-central1.grafana.net/loki/api/v1/push.'
|
||||
type: string
|
||||
required:
|
||||
- url
|
||||
type: object
|
||||
type: array
|
||||
podLogsNamespaceSelector:
|
||||
description: Set of labels to determine which namespaces should be
|
||||
watched for PodLogs. If not provided, checks only namespace of the
|
||||
instance.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
podLogsSelector:
|
||||
description: Determines which PodLogs should be selected for including
|
||||
in this instance.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
targetConfig:
|
||||
description: Configures how tailed targets are watched.
|
||||
properties:
|
||||
syncPeriod:
|
||||
description: Period to resync directories being watched and files
|
||||
being tailed to discover new ones or stop watching removed ones.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
|
|
@ -0,0 +1,861 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
creationTimestamp: null
|
||||
name: metricsinstances.monitoring.grafana.com
|
||||
spec:
|
||||
group: monitoring.grafana.com
|
||||
names:
|
||||
categories:
|
||||
- agent-operator
|
||||
kind: MetricsInstance
|
||||
listKind: MetricsInstanceList
|
||||
plural: metricsinstances
|
||||
singular: metricsinstance
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: MetricsInstance controls an individual Metrics instance within
|
||||
a Grafana Agent deployment.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Spec holds the specification of the desired behavior for
|
||||
the Metrics instance.
|
||||
properties:
|
||||
additionalScrapeConfigs:
|
||||
description: 'AdditionalScrapeConfigs lets you specify a key of a
|
||||
Secret containing additional Grafana Agent Prometheus scrape configurations.
|
||||
The specified scrape configurations are appended to the configurations
|
||||
generated by Grafana Agent Operator. Specified job configurations
|
||||
must have the form specified in the official Prometheus documentation:
|
||||
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config.
|
||||
As scrape configs are appended, you must make sure the configuration
|
||||
is still valid. Note that it''s possible that this feature will
|
||||
break future upgrades of Grafana Agent. Review both Grafana Agent
|
||||
and Prometheus release notes to ensure that no incompatible scrape
|
||||
configs will break Grafana Agent after the upgrade.'
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must be a
|
||||
valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
maxWALTime:
|
||||
description: MaxWALTime is the maximum amount of time that series
|
||||
and samples can exist in the WAL before being forcibly deleted.
|
||||
type: string
|
||||
minWALTime:
|
||||
description: MinWALTime is the minimum amount of time that series
|
||||
and samples can exist in the WAL before being considered for deletion.
|
||||
type: string
|
||||
podMonitorNamespaceSelector:
|
||||
description: PodMonitorNamespaceSelector are the set of labels to
|
||||
determine which namespaces to watch for PodMonitor discovery. If
|
||||
nil, it only checks its own namespace.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
podMonitorSelector:
|
||||
description: PodMonitorSelector determines which PodMonitors to selected
|
||||
for target discovery. Experimental.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
probeNamespaceSelector:
|
||||
description: ProbeNamespaceSelector is the set of labels that determines
|
||||
which namespaces to watch for Probe discovery. If nil, it only checks
|
||||
own namespace.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
probeSelector:
|
||||
description: ProbeSelector determines which Probes to select for target
|
||||
discovery.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
remoteFlushDeadline:
|
||||
description: RemoteFlushDeadline is the deadline for flushing data
|
||||
when an instance shuts down.
|
||||
type: string
|
||||
remoteWrite:
|
||||
description: RemoteWrite controls remote_write settings for this instance.
|
||||
items:
|
||||
description: RemoteWriteSpec defines the remote_write configuration
|
||||
for Prometheus.
|
||||
properties:
|
||||
basicAuth:
|
||||
description: BasicAuth for the URL.
|
||||
properties:
|
||||
password:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the password for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
username:
|
||||
description: The secret in the service monitor namespace
|
||||
that contains the username for authentication.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
bearerToken:
|
||||
description: BearerToken used for remote_write.
|
||||
type: string
|
||||
bearerTokenFile:
|
||||
description: BearerTokenFile used to read bearer token.
|
||||
type: string
|
||||
headers:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Headers is a set of custom HTTP headers to be sent
|
||||
along with each remote_write request. Be aware that any headers
|
||||
set by Grafana Agent itself can't be overwritten.
|
||||
type: object
|
||||
metadataConfig:
|
||||
description: MetadataConfig configures the sending of series
|
||||
metadata to remote storage.
|
||||
properties:
|
||||
send:
|
||||
description: Send enables metric metadata to be sent to
|
||||
remote storage.
|
||||
type: boolean
|
||||
sendInterval:
|
||||
description: SendInterval controls how frequently metric
|
||||
metadata is sent to remote storage.
|
||||
type: string
|
||||
type: object
|
||||
name:
|
||||
description: Name of the remote_write queue. Must be unique
|
||||
if specified. The name is used in metrics and logging in order
|
||||
to differentiate queues.
|
||||
type: string
|
||||
oauth2:
|
||||
description: Oauth2 for URL
|
||||
properties:
|
||||
clientId:
|
||||
description: The secret or configmap containing the OAuth2
|
||||
client id
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
clientSecret:
|
||||
description: The secret containing the OAuth2 client secret
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
endpointParams:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: Parameters to append to the token URL
|
||||
type: object
|
||||
scopes:
|
||||
description: OAuth2 scopes used for the token request
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
tokenUrl:
|
||||
description: The URL to fetch the token from
|
||||
minLength: 1
|
||||
type: string
|
||||
required:
|
||||
- clientId
|
||||
- clientSecret
|
||||
- tokenUrl
|
||||
type: object
|
||||
proxyUrl:
|
||||
description: ProxyURL to proxy requests through. Optional.
|
||||
type: string
|
||||
queueConfig:
|
||||
description: QueueConfig allows tuning of the remote_write queue
|
||||
parameters.
|
||||
properties:
|
||||
batchSendDeadline:
|
||||
description: BatchSendDeadline is the maximum time a sample
|
||||
will wait in the buffer.
|
||||
type: string
|
||||
capacity:
|
||||
description: Capacity is the number of samples to buffer
|
||||
per shard before samples start being dropped.
|
||||
type: integer
|
||||
maxBackoff:
|
||||
description: MaxBackoff is the maximum retry delay.
|
||||
type: string
|
||||
maxRetries:
|
||||
description: MaxRetries is the maximum number of times to
|
||||
retry a batch on recoverable errors.
|
||||
type: integer
|
||||
maxSamplesPerSend:
|
||||
description: MaxSamplesPerSend is the maximum number of
|
||||
samples per send.
|
||||
type: integer
|
||||
maxShards:
|
||||
description: MaxShards is the maximum number of shards,
|
||||
i.e., the amount of concurrency.
|
||||
type: integer
|
||||
minBackoff:
|
||||
description: MinBackoff is the initial retry delay. MinBackoff
|
||||
is doubled for every retry.
|
||||
type: string
|
||||
minShards:
|
||||
description: MinShards is the minimum number of shards,
|
||||
i.e., the amount of concurrency.
|
||||
type: integer
|
||||
retryOnRateLimit:
|
||||
description: RetryOnRateLimit retries requests when encountering
|
||||
rate limits.
|
||||
type: boolean
|
||||
type: object
|
||||
remoteTimeout:
|
||||
description: RemoteTimeout is the timeout for requests to the
|
||||
remote_write endpoint.
|
||||
type: string
|
||||
sigv4:
|
||||
description: SigV4 configures SigV4-based authentication to
|
||||
the remote_write endpoint. SigV4-based authentication is used
|
||||
if SigV4 is defined, even with an empty object.
|
||||
properties:
|
||||
accessKey:
|
||||
description: AccessKey holds the secret of the AWS API access
|
||||
key to use for signing. If not provided, the environment
|
||||
variable AWS_ACCESS_KEY_ID is used.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
profile:
|
||||
description: Profile is the named AWS profile to use for
|
||||
authentication.
|
||||
type: string
|
||||
region:
|
||||
description: Region of the AWS endpoint. If blank, the region
|
||||
from the default credentials chain is used.
|
||||
type: string
|
||||
roleARN:
|
||||
description: RoleARN is the AWS Role ARN to use for authentication,
|
||||
as an alternative for using the AWS API keys.
|
||||
type: string
|
||||
secretKey:
|
||||
description: SecretKey of the AWS API to use for signing.
|
||||
If blank, the environment variable AWS_SECRET_ACCESS_KEY
|
||||
is used.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
tlsConfig:
|
||||
description: TLSConfig to use for remote_write.
|
||||
properties:
|
||||
ca:
|
||||
description: Certificate authority used when verifying server
|
||||
certificates.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
caFile:
|
||||
description: Path to the CA cert in the Prometheus container
|
||||
to use for the targets.
|
||||
type: string
|
||||
cert:
|
||||
description: Client certificate to present when doing client-authentication.
|
||||
properties:
|
||||
configMap:
|
||||
description: ConfigMap containing data to use for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key to select.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the ConfigMap or its
|
||||
key must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
secret:
|
||||
description: Secret containing data to use for the targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind,
|
||||
uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key
|
||||
must be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
type: object
|
||||
certFile:
|
||||
description: Path to the client cert file in the Prometheus
|
||||
container for the targets.
|
||||
type: string
|
||||
insecureSkipVerify:
|
||||
description: Disable target certificate validation.
|
||||
type: boolean
|
||||
keyFile:
|
||||
description: Path to the client key file in the Prometheus
|
||||
container for the targets.
|
||||
type: string
|
||||
keySecret:
|
||||
description: Secret containing the client key file for the
|
||||
targets.
|
||||
properties:
|
||||
key:
|
||||
description: The key of the secret to select from. Must
|
||||
be a valid secret key.
|
||||
type: string
|
||||
name:
|
||||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
|
||||
TODO: Add other useful fields. apiVersion, kind, uid?'
|
||||
type: string
|
||||
optional:
|
||||
description: Specify whether the Secret or its key must
|
||||
be defined
|
||||
type: boolean
|
||||
required:
|
||||
- key
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
serverName:
|
||||
description: Used to verify the hostname for the targets.
|
||||
type: string
|
||||
type: object
|
||||
url:
|
||||
description: URL of the endpoint to send samples to.
|
||||
type: string
|
||||
writeRelabelConfigs:
|
||||
description: WriteRelabelConfigs holds relabel_configs to relabel
|
||||
samples before they are sent to the remote_write endpoint.
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the
|
||||
label set, being applied to samples before ingestion. It
|
||||
defines `<metric_relabel_configs>`-section of Prometheus
|
||||
configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching.
|
||||
Default is 'replace'. uppercase and lowercase actions
|
||||
require Prometheus >= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source
|
||||
label values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex
|
||||
capture groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source
|
||||
label values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing
|
||||
labels. Their content is concatenated using the configured
|
||||
separator and matched against the configured regular
|
||||
expression for the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name
|
||||
which may only contain ASCII letters, numbers, as
|
||||
well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written
|
||||
in a replace action. It is mandatory for replace actions.
|
||||
Regex capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- url
|
||||
type: object
|
||||
type: array
|
||||
serviceMonitorNamespaceSelector:
|
||||
description: ServiceMonitorNamespaceSelector is the set of labels
|
||||
that determine which namespaces to watch for ServiceMonitor discovery.
|
||||
If nil, it only checks its own namespace.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
serviceMonitorSelector:
|
||||
description: ServiceMonitorSelector determines which ServiceMonitors
|
||||
to select for target discovery.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
walTruncateFrequency:
|
||||
description: WALTruncateFrequency specifies how frequently to run
|
||||
the WAL truncation process. Higher values cause the WAL to increase
|
||||
and for old series to stay in the WAL longer, but reduces the chance
|
||||
of data loss when remote_write fails for longer than the given frequency.
|
||||
type: string
|
||||
writeStaleOnShutdown:
|
||||
description: WriteStaleOnShutdown writes staleness markers on shutdown
|
||||
for all series.
|
||||
type: boolean
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
|
|
@ -0,0 +1,588 @@
|
|||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.9.2
|
||||
creationTimestamp: null
|
||||
name: podlogs.monitoring.grafana.com
|
||||
spec:
|
||||
group: monitoring.grafana.com
|
||||
names:
|
||||
categories:
|
||||
- agent-operator
|
||||
kind: PodLogs
|
||||
listKind: PodLogsList
|
||||
plural: podlogs
|
||||
singular: podlogs
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: PodLogs defines how to collect logs for a pod.
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation
|
||||
of an object. Servers should convert recognized schemas to the latest
|
||||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this
|
||||
object represents. Servers may infer this from the endpoint the client
|
||||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
type: object
|
||||
spec:
|
||||
description: Spec holds the specification of the desired behavior for
|
||||
the PodLogs.
|
||||
properties:
|
||||
jobLabel:
|
||||
description: The label to use to retrieve the job name from.
|
||||
type: string
|
||||
namespaceSelector:
|
||||
description: Selector to select which namespaces the Pod objects are
|
||||
discovered from.
|
||||
properties:
|
||||
any:
|
||||
description: Boolean describing whether all namespaces are selected
|
||||
in contrast to a list restricting them.
|
||||
type: boolean
|
||||
matchNames:
|
||||
description: List of namespace names to select from.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
type: object
|
||||
pipelineStages:
|
||||
description: Pipeline stages for this pod. Pipeline stages support
|
||||
transforming and filtering log lines.
|
||||
items:
|
||||
description: "PipelineStageSpec defines an individual pipeline stage.
|
||||
Each stage type is mutually exclusive and no more than one may
|
||||
be set per stage. \n More information on pipelines can be found
|
||||
in the Promtail documentation: https://grafana.com/docs/loki/latest/clients/promtail/pipelines/"
|
||||
properties:
|
||||
cri:
|
||||
description: 'CRI is a parsing stage that reads log lines using
|
||||
the standard CRI logging format. Supply cri: {} to enable.'
|
||||
type: object
|
||||
docker:
|
||||
description: 'Docker is a parsing stage that reads log lines
|
||||
using the standard Docker logging format. Supply docker: {}
|
||||
to enable.'
|
||||
type: object
|
||||
drop:
|
||||
description: Drop is a filtering stage that lets you drop certain
|
||||
logs.
|
||||
properties:
|
||||
dropCounterReason:
|
||||
description: Every time a log line is dropped, the metric
|
||||
logentry_dropped_lines_total is incremented. A "reason"
|
||||
label is added, and can be customized by providing a custom
|
||||
value here. Defaults to "drop_stage".
|
||||
type: string
|
||||
expression:
|
||||
description: "RE2 regular expression. \n If source is provided,
|
||||
the regex attempts to match the source. \n If no source
|
||||
is provided, then the regex attempts to attach the log
|
||||
line. \n If the provided regex matches the log line or
|
||||
a provided source, the line is dropped."
|
||||
type: string
|
||||
longerThan:
|
||||
description: LongerThan will drop a log line if it its content
|
||||
is longer than this value (in bytes). Can be expressed
|
||||
as an integer (8192) or a number with a suffix (8kb).
|
||||
type: string
|
||||
olderThan:
|
||||
description: OlderThan will be parsed as a Go duration.
|
||||
If the log line's timestamp is older than the current
|
||||
time minus the provided duration, it will be dropped.
|
||||
type: string
|
||||
source:
|
||||
description: Name from the extract data to parse. If empty,
|
||||
uses the log message.
|
||||
type: string
|
||||
value:
|
||||
description: "Value can only be specified when source is
|
||||
specified. If the value provided is an exact match for
|
||||
the given source then the line will be dropped. \n Mutually
|
||||
exclusive with expression."
|
||||
type: string
|
||||
type: object
|
||||
json:
|
||||
description: "JSON is a parsing stage that reads the log line
|
||||
as JSON and accepts JMESPath expressions to extract data.
|
||||
\n Information on JMESPath: http://jmespath.org/"
|
||||
properties:
|
||||
expressions:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: "Set of the key/value pairs of JMESPath expressions.
|
||||
The key will be the key in the extracted data while the
|
||||
expression will be the value, evaluated as a JMESPath
|
||||
from the source data. \n Literal JMESPath expressions
|
||||
can be used by wrapping a key in double quotes, which
|
||||
then must be wrapped again in single quotes in YAML so
|
||||
they get passed to the JMESPath parser."
|
||||
type: object
|
||||
source:
|
||||
description: Name from the extracted data to parse as JSON.
|
||||
If empty, uses entire log message.
|
||||
type: string
|
||||
type: object
|
||||
labelAllow:
|
||||
description: LabelAllow is an action stage that only allows
|
||||
the provided labels to be included in the label set that is
|
||||
sent to Loki with the log entry.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
labelDrop:
|
||||
description: LabelDrop is an action stage that drops labels
|
||||
from the label set that is sent to Loki with the log entry.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
labels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: "Labels is an action stage that takes data from
|
||||
the extracted map and modifies the label set that is sent
|
||||
to Loki with the log entry. \n The key is REQUIRED and represents
|
||||
the name for the label that will be created. Value is optional
|
||||
and will be the name from extracted data to use for the value
|
||||
of the label. If the value is not provided, it defaults to
|
||||
match the key."
|
||||
type: object
|
||||
limit:
|
||||
description: Limit is a rate-limiting stage that throttles logs
|
||||
based on several options.
|
||||
properties:
|
||||
burst:
|
||||
description: The cap in the quantity of burst lines that
|
||||
Promtail will push to Loki.
|
||||
type: integer
|
||||
drop:
|
||||
description: "When drop is true, log lines that exceed the
|
||||
current rate limit are discarded. When drop is false,
|
||||
log lines that exceed the current rate limit wait to enter
|
||||
the back pressure mode. \n Defaults to false."
|
||||
type: boolean
|
||||
rate:
|
||||
description: The rate limit in lines per second that Promtail
|
||||
will push to Loki.
|
||||
type: integer
|
||||
type: object
|
||||
match:
|
||||
description: Match is a filtering stage that conditionally applies
|
||||
a set of stages or drop entries when a log entry matches a
|
||||
configurable LogQL stream selector and filter expressions.
|
||||
properties:
|
||||
action:
|
||||
description: Determines what action is taken when the selector
|
||||
matches the log line. Can be keep or drop. Defaults to
|
||||
keep. When set to drop, entries are dropped and no later
|
||||
metrics are recorded. Stages must be empty when dropping
|
||||
metrics.
|
||||
type: string
|
||||
dropCounterReason:
|
||||
description: Every time a log line is dropped, the metric
|
||||
logentry_dropped_lines_total is incremented. A "reason"
|
||||
label is added, and can be customized by providing a custom
|
||||
value here. Defaults to "match_stage."
|
||||
type: string
|
||||
pipelineName:
|
||||
description: Names the pipeline. When defined, creates an
|
||||
additional label in the pipeline_duration_seconds histogram,
|
||||
where the value is concatenated with job_name using an
|
||||
underscore.
|
||||
type: string
|
||||
selector:
|
||||
description: LogQL stream selector and filter expressions.
|
||||
Required.
|
||||
type: string
|
||||
stages:
|
||||
description: "Nested set of pipeline stages to execute when
|
||||
action is keep and the log line matches selector. \n An
|
||||
example value for stages may be: \n stages: | - json:
|
||||
{} - labelAllow: [foo, bar] \n Note that stages is a string
|
||||
because SIG API Machinery does not support recursive types,
|
||||
and so it cannot be validated for correctness. Be careful
|
||||
not to mistype anything."
|
||||
type: string
|
||||
required:
|
||||
- selector
|
||||
type: object
|
||||
metrics:
|
||||
additionalProperties:
|
||||
description: MetricsStageSpec is an action stage that allows
|
||||
for defining and updating metrics based on data from the
|
||||
extracted map. Created metrics are not pushed to Loki or
|
||||
Prometheus and are instead exposed via the /metrics endpoint
|
||||
of the Grafana Agent pod. The Grafana Agent Operator should
|
||||
be configured with a MetricsInstance that discovers the
|
||||
logging DaemonSet to collect metrics created by this stage.
|
||||
properties:
|
||||
action:
|
||||
description: "The action to take against the metric. Required.
|
||||
\n Must be either \"inc\" or \"add\" for type: counter
|
||||
or type: histogram. When type: gauge, must be one of
|
||||
\"set\", \"inc\", \"dec\", \"add\", or \"sub\". \n \"add\",
|
||||
\"set\", or \"sub\" requires the extracted value to
|
||||
be convertible to a positive float."
|
||||
type: string
|
||||
buckets:
|
||||
description: 'Buckets to create. Bucket values must be
|
||||
convertible to float64s. Extremely large or small numbers
|
||||
are subject to some loss of precision. Only valid for
|
||||
type: histogram.'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
countEntryBytes:
|
||||
description: "If true all log line bytes are counted.
|
||||
Can only be set with matchAll: true and action: add.
|
||||
\n Only valid for type: counter."
|
||||
type: boolean
|
||||
description:
|
||||
description: Sets the description for the created metric.
|
||||
type: string
|
||||
matchAll:
|
||||
description: "If true, all log lines are counted without
|
||||
attempting to match the source to the extracted map.
|
||||
Mutually exclusive with value. \n Only valid for type:
|
||||
counter."
|
||||
type: boolean
|
||||
maxIdleDuration:
|
||||
description: "Label values on metrics are dynamic which
|
||||
can cause exported metrics to go stale. To prevent unbounded
|
||||
cardinality, any metrics not updated within MaxIdleDuration
|
||||
are removed. \n Must be greater or equal to 1s. Defaults
|
||||
to 5m."
|
||||
type: string
|
||||
prefix:
|
||||
description: Sets the custom prefix name for the metric.
|
||||
Defaults to "promtail_custom_".
|
||||
type: string
|
||||
source:
|
||||
description: Key from the extracted data map to use for
|
||||
the metric. Defaults to the metrics name if not present.
|
||||
type: string
|
||||
type:
|
||||
description: The metric type to create. Must be one of
|
||||
counter, gauge, histogram. Required.
|
||||
type: string
|
||||
value:
|
||||
description: Filters down source data and only changes
|
||||
the metric if the targeted value matches the provided
|
||||
string exactly. If not present, all data matches.
|
||||
type: string
|
||||
required:
|
||||
- action
|
||||
- type
|
||||
type: object
|
||||
description: Metrics is an action stage that supports defining
|
||||
and updating metrics based on data from the extracted map.
|
||||
Created metrics are not pushed to Loki or Prometheus and are
|
||||
instead exposed via the /metrics endpoint of the Grafana Agent
|
||||
pod. The Grafana Agent Operator should be configured with
|
||||
a MetricsInstance that discovers the logging DaemonSet to
|
||||
collect metrics created by this stage.
|
||||
type: object
|
||||
multiline:
|
||||
description: Multiline stage merges multiple lines into a multiline
|
||||
block before passing it on to the next stage in the pipeline.
|
||||
properties:
|
||||
firstLine:
|
||||
description: RE2 regular expression. Creates a new multiline
|
||||
block when matched. Required.
|
||||
type: string
|
||||
maxLines:
|
||||
description: Maximum number of lines a block can have. A
|
||||
new block is started if the number of lines surpasses
|
||||
this value. Defaults to 128.
|
||||
type: integer
|
||||
maxWaitTime:
|
||||
description: Maximum time to wait before passing on the
|
||||
multiline block to the next stage if no new lines are
|
||||
received. Defaults to 3s.
|
||||
type: string
|
||||
required:
|
||||
- firstLine
|
||||
type: object
|
||||
output:
|
||||
description: Output stage is an action stage that takes data
|
||||
from the extracted map and changes the log line that will
|
||||
be sent to Loki.
|
||||
properties:
|
||||
source:
|
||||
description: Name from extract data to use for the log entry.
|
||||
Required.
|
||||
type: string
|
||||
required:
|
||||
- source
|
||||
type: object
|
||||
pack:
|
||||
description: Pack is a transform stage that lets you embed extracted
|
||||
values and labels into the log line by packing the log line
|
||||
and labels inside of a JSON object.
|
||||
properties:
|
||||
ingestTimestamp:
|
||||
description: If the resulting log line should use any existing
|
||||
timestamp or use time.Now() when the line was created.
|
||||
Set to true when combining several log streams from different
|
||||
containers to avoid out of order errors.
|
||||
type: boolean
|
||||
labels:
|
||||
description: Name from extracted data or line labels. Required.
|
||||
Labels provided here are automatically removed from output
|
||||
labels.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- labels
|
||||
type: object
|
||||
regex:
|
||||
description: Regex is a parsing stage that parses a log line
|
||||
using a regular expression. Named capture groups in the regex
|
||||
allows for adding data into the extracted map.
|
||||
properties:
|
||||
expression:
|
||||
description: RE2 regular expression. Each capture group
|
||||
MUST be named. Required.
|
||||
type: string
|
||||
source:
|
||||
description: Name from extracted data to parse. If empty,
|
||||
defaults to using the log message.
|
||||
type: string
|
||||
required:
|
||||
- expression
|
||||
type: object
|
||||
replace:
|
||||
description: Replace is a parsing stage that parses a log line
|
||||
using a regular expression and replaces the log line. Named
|
||||
capture groups in the regex allows for adding data into the
|
||||
extracted map.
|
||||
properties:
|
||||
expression:
|
||||
description: RE2 regular expression. Each capture group
|
||||
MUST be named. Required.
|
||||
type: string
|
||||
replace:
|
||||
description: Value to replace the captured group with.
|
||||
type: string
|
||||
source:
|
||||
description: Name from extracted data to parse. If empty,
|
||||
defaults to using the log message.
|
||||
type: string
|
||||
required:
|
||||
- expression
|
||||
type: object
|
||||
template:
|
||||
description: Template is a transform stage that manipulates
|
||||
the values in the extracted map using Go's template syntax.
|
||||
properties:
|
||||
source:
|
||||
description: Name from extracted data to parse. Required.
|
||||
If empty, defaults to using the log message.
|
||||
type: string
|
||||
template:
|
||||
description: Go template string to use. Required. In addition
|
||||
to normal template functions, ToLower, ToUpper, Replace,
|
||||
Trim, TrimLeft, TrimRight, TrimPrefix, and TrimSpace are
|
||||
also available.
|
||||
type: string
|
||||
required:
|
||||
- source
|
||||
- template
|
||||
type: object
|
||||
tenant:
|
||||
description: Tenant is an action stage that sets the tenant
|
||||
ID for the log entry picking it from a field in the extracted
|
||||
data map. If the field is missing, the default LogsClientSpec.tenantId
|
||||
will be used.
|
||||
properties:
|
||||
label:
|
||||
description: Name from labels whose value should be set
|
||||
as tenant ID. Mutually exclusive with source and value.
|
||||
type: string
|
||||
source:
|
||||
description: Name from extracted data to use as the tenant
|
||||
ID. Mutually exclusive with label and value.
|
||||
type: string
|
||||
value:
|
||||
description: Value to use for the template ID. Useful when
|
||||
this stage is used within a conditional pipeline such
|
||||
as match. Mutually exclusive with label and source.
|
||||
type: string
|
||||
type: object
|
||||
timestamp:
|
||||
description: Timestamp is an action stage that can change the
|
||||
timestamp of a log line before it is sent to Loki. If not
|
||||
present, the timestamp of a log line defaults to the time
|
||||
when the log line was read.
|
||||
properties:
|
||||
actionOnFailure:
|
||||
description: Action to take when the timestamp can't be
|
||||
extracted or parsed. Can be skip or fudge. Defaults to
|
||||
fudge.
|
||||
type: string
|
||||
fallbackFormats:
|
||||
description: Fallback formats to try if format fails.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
format:
|
||||
description: 'Determines format of the time string. Required.
|
||||
Can be one of: ANSIC, UnixDate, RubyDate, RFC822, RFC822Z,
|
||||
RFC850, RFC1123, RFC1123Z, RFC3339, RFC3339Nano, Unix,
|
||||
UnixMs, UnixUs, UnixNs.'
|
||||
type: string
|
||||
location:
|
||||
description: IANA Timezone Database string.
|
||||
type: string
|
||||
source:
|
||||
description: Name from extracted data to use as the timestamp.
|
||||
Required.
|
||||
type: string
|
||||
required:
|
||||
- format
|
||||
- source
|
||||
type: object
|
||||
type: object
|
||||
type: array
|
||||
podTargetLabels:
|
||||
description: PodTargetLabels transfers labels on the Kubernetes Pod
|
||||
onto the target.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
relabelings:
|
||||
description: "RelabelConfigs to apply to logs before delivering. Grafana
|
||||
Agent Operator automatically adds relabelings for a few standard
|
||||
Kubernetes fields and replaces original scrape job name with __tmp_logs_job_name.
|
||||
\n More info: https://grafana.com/docs/loki/latest/clients/promtail/configuration/#relabel_configs"
|
||||
items:
|
||||
description: 'RelabelConfig allows dynamic rewriting of the label
|
||||
set, being applied to samples before ingestion. It defines `<metric_relabel_configs>`-section
|
||||
of Prometheus configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
|
||||
properties:
|
||||
action:
|
||||
default: replace
|
||||
description: Action to perform based on regex matching. Default
|
||||
is 'replace'. uppercase and lowercase actions require Prometheus
|
||||
>= 2.36.
|
||||
enum:
|
||||
- replace
|
||||
- Replace
|
||||
- keep
|
||||
- Keep
|
||||
- drop
|
||||
- Drop
|
||||
- hashmod
|
||||
- HashMod
|
||||
- labelmap
|
||||
- LabelMap
|
||||
- labeldrop
|
||||
- LabelDrop
|
||||
- labelkeep
|
||||
- LabelKeep
|
||||
- lowercase
|
||||
- Lowercase
|
||||
- uppercase
|
||||
- Uppercase
|
||||
- keepequal
|
||||
- KeepEqual
|
||||
- dropequal
|
||||
- DropEqual
|
||||
type: string
|
||||
modulus:
|
||||
description: Modulus to take of the hash of the source label
|
||||
values.
|
||||
format: int64
|
||||
type: integer
|
||||
regex:
|
||||
description: Regular expression against which the extracted
|
||||
value is matched. Default is '(.*)'
|
||||
type: string
|
||||
replacement:
|
||||
description: Replacement value against which a regex replace
|
||||
is performed if the regular expression matches. Regex capture
|
||||
groups are available. Default is '$1'
|
||||
type: string
|
||||
separator:
|
||||
description: Separator placed between concatenated source label
|
||||
values. default is ';'.
|
||||
type: string
|
||||
sourceLabels:
|
||||
description: The source labels select values from existing labels.
|
||||
Their content is concatenated using the configured separator
|
||||
and matched against the configured regular expression for
|
||||
the replace, keep, and drop actions.
|
||||
items:
|
||||
description: LabelName is a valid Prometheus label name which
|
||||
may only contain ASCII letters, numbers, as well as underscores.
|
||||
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
|
||||
type: string
|
||||
type: array
|
||||
targetLabel:
|
||||
description: Label to which the resulting value is written in
|
||||
a replace action. It is mandatory for replace actions. Regex
|
||||
capture groups are available.
|
||||
type: string
|
||||
type: object
|
||||
type: array
|
||||
selector:
|
||||
description: Selector to select Pod objects. Required.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements.
|
||||
The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that
|
||||
contains values, a key, and an operator that relates the key
|
||||
and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies
|
||||
to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to
|
||||
a set of values. Valid operators are In, NotIn, Exists
|
||||
and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the
|
||||
operator is In or NotIn, the values array must be non-empty.
|
||||
If the operator is Exists or DoesNotExist, the values
|
||||
array must be empty. This array is replaced during a strategic
|
||||
merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single
|
||||
{key,value} in the matchLabels map is equivalent to an element
|
||||
of matchExpressions, whose key field is "key", the operator
|
||||
is "In", and the values array contains only "value". The requirements
|
||||
are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
required:
|
||||
- selector
|
||||
type: object
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "ga-operator.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "ga-operator.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "ga-operator.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "ga-operator.labels" -}}
|
||||
{{ include "ga-operator.selectorLabels" . }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/component: operator
|
||||
helm.sh/chart: {{ include "ga-operator.chart" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.customLabels }}
|
||||
{{ toYaml .Values.customLabels }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "ga-operator.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "ga-operator.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "ga-operator.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "ga-operator.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
{{- if .Values.rbac.create -}}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ include "ga-operator.fullname" . }}
|
||||
labels:
|
||||
{{ include "ga-operator.labels" . | indent 4 }}
|
||||
rules:
|
||||
- apiGroups: [monitoring.grafana.com]
|
||||
resources:
|
||||
- grafanaagents
|
||||
- metricsinstances
|
||||
- logsinstances
|
||||
- podlogs
|
||||
- integrations
|
||||
verbs: [get, list, watch]
|
||||
- apiGroups: [monitoring.grafana.com]
|
||||
resources:
|
||||
- grafanaagents/finalizers
|
||||
- metricsinstances/finalizers
|
||||
- logsinstances/finalizers
|
||||
- podlogs/finalizers
|
||||
- integrations/finalizers
|
||||
verbs: [get, list, watch, update]
|
||||
- apiGroups: [monitoring.coreos.com]
|
||||
resources:
|
||||
- podmonitors
|
||||
- probes
|
||||
- servicemonitors
|
||||
verbs: [get, list, watch]
|
||||
- apiGroups: [monitoring.coreos.com]
|
||||
resources:
|
||||
- podmonitors/finalizers
|
||||
- probes/finalizers
|
||||
- servicemonitors/finalizers
|
||||
verbs: [get, list, watch, update]
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- namespaces
|
||||
- nodes
|
||||
verbs: [get, list, watch]
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- secrets
|
||||
- services
|
||||
- configmaps
|
||||
- endpoints
|
||||
verbs: [get, list, watch, create, update, patch, delete]
|
||||
- apiGroups: ["apps"]
|
||||
resources:
|
||||
- statefulsets
|
||||
- daemonsets
|
||||
- deployments
|
||||
verbs: [get, list, watch, create, update, patch, delete]
|
||||
{{- with .Values.rbac.podSecurityPolicyName }}
|
||||
- apiGroups: [policy]
|
||||
resources:
|
||||
- podsecuritypolicies
|
||||
verbs: [use]
|
||||
resourceNames: [ {{ . }} ]
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{{- if .Values.rbac.create -}}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ include "ga-operator.fullname" . }}
|
||||
labels:
|
||||
{{ include "ga-operator.labels" . | indent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ include "ga-operator.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "ga-operator.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end -}}
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "ga-operator.fullname" . }}
|
||||
labels:
|
||||
{{ include "ga-operator.labels" . | indent 4 }}
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{ include "ga-operator.selectorLabels" . | indent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{ include "ga-operator.selectorLabels" . | indent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.priorityClassName }}
|
||||
priorityClassName: {{ . }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ template "ga-operator.serviceAccountName" . }}
|
||||
{{- with .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ include "ga-operator.name" . }}
|
||||
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
{{- with .Values.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if or (and .Values.kubeletService.namespace .Values.kubeletService.serviceName) (.Values.extraArgs) }}
|
||||
args:
|
||||
{{- if and .Values.kubeletService.namespace .Values.kubeletService.serviceName }}
|
||||
- --kubelet-service={{ .Values.kubeletService.namespace }}/{{ .Values.kubeletService.serviceName }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraArgs }}
|
||||
{{- range .Values.extraArgs }}
|
||||
- {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "ga-operator.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{ include "ga-operator.labels" . | indent 4 }}
|
||||
{{- end -}}
|
||||
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
apiVersion: monitoring.grafana.com/v1alpha1
|
||||
kind: GrafanaAgent
|
||||
metadata:
|
||||
name: grafana-agent-test
|
||||
labels:
|
||||
app: grafana-agent-test
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
||||
spec:
|
||||
image: "{{ .Values.image.registry }}/grafana/agent:{{ .Values.image.tag }}"
|
||||
logLevel: info
|
||||
serviceAccountName: grafana-agent-test-sa
|
||||
metrics:
|
||||
instanceSelector:
|
||||
matchLabels:
|
||||
agent: grafana-agent-test
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: grafana-agent-test-sa
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
||||
|
||||
---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: grafana-agent-test-cr
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- nodes
|
||||
- nodes/proxy
|
||||
- nodes/metrics
|
||||
- services
|
||||
- endpoints
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- nonResourceURLs:
|
||||
- /metrics
|
||||
- /metrics/cadvisor
|
||||
verbs:
|
||||
- get
|
||||
|
||||
---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: grafana-agent-test-crb
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: grafana-agent-test-cr
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: grafana-agent-test-sa
|
||||
namespace: {{ .Release.Namespace }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: monitoring.grafana.com/v1alpha1
|
||||
kind: MetricsInstance
|
||||
metadata:
|
||||
name: primary-test
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
||||
labels:
|
||||
agent: grafana-agent-test
|
||||
spec: {}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: grafana-agent-test-probe
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
"helm.sh/hook-weight": "1"
|
||||
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
|
||||
spec:
|
||||
containers:
|
||||
- name: busybox
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['grafana-agent-test-operated:8080/-/healthy']
|
||||
# Wait for GrafanaAgent CR
|
||||
initContainers:
|
||||
- name: sleep
|
||||
image: busybox
|
||||
command: ['sleep', '60']
|
||||
restartPolicy: Never
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
# -- Overrides the chart's name
|
||||
nameOverride: ""
|
||||
|
||||
# -- Overrides the chart's computed fullname
|
||||
fullnameOverride: ""
|
||||
|
||||
# -- Annotations for the Deployment
|
||||
annotations: {}
|
||||
|
||||
# -- Annotations for the Deployment Pods
|
||||
podAnnotations: {}
|
||||
|
||||
# -- Annotations for the Deployment Pods
|
||||
podLabels: {}
|
||||
|
||||
# -- Pod security context (runAsUser, etc.)
|
||||
podSecurityContext: {}
|
||||
|
||||
# -- Container security context (allowPrivilegeEscalation, etc.)
|
||||
containerSecurityContext: {}
|
||||
|
||||
rbac:
|
||||
# -- Toggle to create ClusterRole and ClusterRoleBinding
|
||||
create: true
|
||||
# -- Name of a PodSecurityPolicy to use in the ClusterRole. If unset, no PodSecurityPolicy is used.
|
||||
podSecurityPolicyName: ''
|
||||
|
||||
serviceAccount:
|
||||
# -- Toggle to create ServiceAccount
|
||||
create: true
|
||||
# -- Service account name
|
||||
name:
|
||||
|
||||
image:
|
||||
# -- Image registry
|
||||
registry: docker.io
|
||||
# -- Image repo
|
||||
repository: grafana/agent-operator
|
||||
# -- Image tag
|
||||
tag: v0.39.1
|
||||
# -- Image pull policy
|
||||
pullPolicy: IfNotPresent
|
||||
# -- Image pull secrets
|
||||
pullSecrets: []
|
||||
|
||||
# -- hostAliases to add
|
||||
hostAliases: []
|
||||
# - ip: 1.2.3.4
|
||||
# hostnames:
|
||||
# - domain.tld
|
||||
|
||||
# -- If both are set, Agent Operator will create and maintain a service for scraping kubelets
|
||||
# https://grafana.com/docs/agent/latest/operator/getting-started/#monitor-kubelets
|
||||
kubeletService:
|
||||
namespace: default
|
||||
serviceName: kubelet
|
||||
|
||||
# -- List of additional cli arguments to configure agent-operator (example: `--log.level`)
|
||||
extraArgs: []
|
||||
|
||||
# -- Resource limits and requests config
|
||||
resources: {}
|
||||
|
||||
# -- nodeSelector configuration
|
||||
nodeSelector: {}
|
||||
|
||||
# -- Tolerations applied to Pods
|
||||
tolerations: []
|
||||
|
||||
# -- Pod affinity configuration
|
||||
affinity: {}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
# OWNERS file for Kubernetes
|
||||
OWNERS
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: v1
|
||||
appVersion: RELEASE.2022-09-17T00-09-45Z
|
||||
description: Multi-Cloud Object Storage
|
||||
home: https://min.io
|
||||
icon: https://min.io/resources/img/logo/MINIO_wordmark.png
|
||||
keywords:
|
||||
- minio
|
||||
- storage
|
||||
- object-storage
|
||||
- s3
|
||||
- cluster
|
||||
maintainers:
|
||||
- email: dev@minio.io
|
||||
name: MinIO, Inc
|
||||
name: minio
|
||||
sources:
|
||||
- https://github.com/minio/minio
|
||||
version: 4.0.15
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
# MinIO Helm Chart
|
||||
|
||||
[](https://slack.min.io) [](https://github.com/minio/minio/blob/master/LICENSE)
|
||||
|
||||
MinIO is a High Performance Object Storage released under GNU Affero General Public License v3.0. It is API compatible with Amazon S3 cloud storage service. Use MinIO to build high performance infrastructure for machine learning, analytics and application data workloads.
|
||||
|
||||
For more detailed documentation please visit [here](https://docs.minio.io/)
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps MinIO Cluster on [Kubernetes](http://kubernetes.io) using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Helm cli with Kubernetes cluster configured.
|
||||
- PV provisioner support in the underlying infrastructure. (We recommend using <https://github.com/minio/direct-csi>)
|
||||
- Use Kubernetes version v1.19 and later for best experience.
|
||||
|
||||
## Configure MinIO Helm repo
|
||||
|
||||
```bash
|
||||
helm repo add minio https://charts.min.io/
|
||||
```
|
||||
|
||||
### Installing the Chart
|
||||
|
||||
Install this chart using:
|
||||
|
||||
```bash
|
||||
helm install --namespace minio --set rootUser=rootuser,rootPassword=rootpass123 --generate-name minio/minio
|
||||
```
|
||||
|
||||
The command deploys MinIO on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
|
||||
|
||||
### Upgrading the Chart
|
||||
|
||||
You can use Helm to update MinIO version in a live release. Assuming your release is named as `my-release`, get the values using the command:
|
||||
|
||||
```bash
|
||||
helm get values my-release > old_values.yaml
|
||||
```
|
||||
|
||||
Then change the field `image.tag` in `old_values.yaml` file with MinIO image tag you want to use. Now update the chart using
|
||||
|
||||
```bash
|
||||
helm upgrade -f old_values.yaml my-release minio/minio
|
||||
```
|
||||
|
||||
Default upgrade strategies are specified in the `values.yaml` file. Update these fields if you'd like to use a different strategy.
|
||||
|
||||
### Configuration
|
||||
|
||||
Refer the [Values file](./values.yaml) for all the possible config fields.
|
||||
|
||||
You can specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```bash
|
||||
helm install --name my-release --set persistence.size=1Ti minio/minio
|
||||
```
|
||||
|
||||
The above command deploys MinIO server with a 1Ti backing persistent volume.
|
||||
|
||||
Alternately, you can provide a YAML file that specifies parameter values while installing the chart. For example,
|
||||
|
||||
```bash
|
||||
helm install --name my-release -f values.yaml minio/minio
|
||||
```
|
||||
|
||||
### Persistence
|
||||
|
||||
This chart provisions a PersistentVolumeClaim and mounts corresponding persistent volume to default location `/export`. You'll need physical storage available in the Kubernetes cluster for this to work. If you'd rather use `emptyDir`, disable PersistentVolumeClaim by:
|
||||
|
||||
```bash
|
||||
helm install --set persistence.enabled=false minio/minio
|
||||
```
|
||||
|
||||
> *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."*
|
||||
|
||||
### Existing PersistentVolumeClaim
|
||||
|
||||
If a Persistent Volume Claim already exists, specify it during installation.
|
||||
|
||||
1. Create the PersistentVolume
|
||||
2. Create the PersistentVolumeClaim
|
||||
3. Install the chart
|
||||
|
||||
```bash
|
||||
helm install --set persistence.existingClaim=PVC_NAME minio/minio
|
||||
```
|
||||
|
||||
### NetworkPolicy
|
||||
|
||||
To enable network policy for MinIO,
|
||||
install [a networking plugin that implements the Kubernetes
|
||||
NetworkPolicy spec](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy#before-you-begin),
|
||||
and set `networkPolicy.enabled` to `true`.
|
||||
|
||||
For Kubernetes v1.5 & v1.6, you must also turn on NetworkPolicy by setting
|
||||
the DefaultDeny namespace annotation. Note: this will enforce policy for *all* pods in the namespace:
|
||||
|
||||
```
|
||||
kubectl annotate namespace default "net.beta.kubernetes.io/network-policy={\"ingress\":{\"isolation\":\"DefaultDeny\"}}"
|
||||
```
|
||||
|
||||
With NetworkPolicy enabled, traffic will be limited to just port 9000.
|
||||
|
||||
For more precise policy, set `networkPolicy.allowExternal=true`. This will
|
||||
only allow pods with the generated client label to connect to MinIO.
|
||||
This label will be displayed in the output of a successful install.
|
||||
|
||||
### Existing secret
|
||||
|
||||
Instead of having this chart create the secret for you, you can supply a preexisting secret, much
|
||||
like an existing PersistentVolumeClaim.
|
||||
|
||||
First, create the secret:
|
||||
|
||||
```bash
|
||||
kubectl create secret generic my-minio-secret --from-literal=rootUser=foobarbaz --from-literal=rootPassword=foobarbazqux
|
||||
```
|
||||
|
||||
Then install the chart, specifying that you want to use an existing secret:
|
||||
|
||||
```bash
|
||||
helm install --set existingSecret=my-minio-secret minio/minio
|
||||
```
|
||||
|
||||
The following fields are expected in the secret:
|
||||
|
||||
| .data.\<key\> in Secret | Corresponding variable | Description | Required |
|
||||
|:------------------------|:-----------------------|:---------------|:---------|
|
||||
| `rootUser` | `rootUser` | Root user. | yes |
|
||||
| `rootPassword` | `rootPassword` | Root password. | yes |
|
||||
|
||||
All corresponding variables will be ignored in values file.
|
||||
|
||||
### Configure TLS
|
||||
|
||||
To enable TLS for MinIO containers, acquire TLS certificates from a CA or create self-signed certificates. While creating / acquiring certificates ensure the corresponding domain names are set as per the standard [DNS naming conventions](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-identity) in a Kubernetes StatefulSet (for a distributed MinIO setup). Then create a secret using
|
||||
|
||||
```bash
|
||||
kubectl create secret generic tls-ssl-minio --from-file=path/to/private.key --from-file=path/to/public.crt
|
||||
```
|
||||
|
||||
Then install the chart, specifying that you want to use the TLS secret:
|
||||
|
||||
```bash
|
||||
helm install --set tls.enabled=true,tls.certSecret=tls-ssl-minio minio/minio
|
||||
```
|
||||
|
||||
### Installing certificates from third party CAs
|
||||
|
||||
MinIO can connect to other servers, including MinIO nodes or other server types such as NATs and Redis. If these servers use certificates that were not registered with a known CA, add trust for these certificates to MinIO Server by bundling these certificates into a Kubernetes secret and providing it to Helm via the `trustedCertsSecret` value. If `.Values.tls.enabled` is `true` and you're installing certificates for third party CAs, remember to include MinIO's own certificate with key `public.crt`, if it also needs to be trusted.
|
||||
|
||||
For instance, given that TLS is enabled and you need to add trust for MinIO's own CA and for the CA of a Keycloak server, a Kubernetes secret can be created from the certificate files using `kubectl`:
|
||||
|
||||
```
|
||||
kubectl -n minio create secret generic minio-trusted-certs --from-file=public.crt --from-file=keycloak.crt
|
||||
```
|
||||
|
||||
If TLS is not enabled, you would need only the third party CA:
|
||||
|
||||
```
|
||||
kubectl -n minio create secret generic minio-trusted-certs --from-file=keycloak.crt
|
||||
```
|
||||
|
||||
The name of the generated secret can then be passed to Helm using a values file or the `--set` parameter:
|
||||
|
||||
```
|
||||
trustedCertsSecret: "minio-trusted-certs"
|
||||
|
||||
or
|
||||
|
||||
--set trustedCertsSecret=minio-trusted-certs
|
||||
```
|
||||
|
||||
### Create buckets after install
|
||||
|
||||
Install the chart, specifying the buckets you want to create after install:
|
||||
|
||||
```bash
|
||||
helm install --set buckets[0].name=bucket1,buckets[0].policy=none,buckets[0].purge=false minio/minio
|
||||
```
|
||||
|
||||
Description of the configuration parameters used above -
|
||||
|
||||
- `buckets[].name` - name of the bucket to create, must be a string with length > 0
|
||||
- `buckets[].policy` - can be one of none|download|upload|public
|
||||
- `buckets[].purge` - purge if bucket exists already
|
||||
|
||||
### Create policies after install
|
||||
|
||||
Install the chart, specifying the policies you want to create after install:
|
||||
|
||||
```bash
|
||||
helm install --set policies[0].name=mypolicy,policies[0].statements[0].resources[0]='arn:aws:s3:::bucket1',policies[0].statements[0].actions[0]='s3:ListBucket',policies[0].statements[0].actions[1]='s3:GetObject' minio/minio
|
||||
```
|
||||
|
||||
Description of the configuration parameters used above -
|
||||
|
||||
- `policies[].name` - name of the policy to create, must be a string with length > 0
|
||||
- `policies[].statements[]` - list of statements, includes actions and resources
|
||||
- `policies[].statements[].resources[]` - list of resources that applies the statement
|
||||
- `policies[].statements[].actions[]` - list of actions granted
|
||||
|
||||
### Create user after install
|
||||
|
||||
Install the chart, specifying the users you want to create after install:
|
||||
|
||||
```bash
|
||||
helm install --set users[0].accessKey=accessKey,users[0].secretKey=secretKey,users[0].policy=none,users[1].accessKey=accessKey2,users[1].secretRef=existingSecret,users[1].secretKey=password,users[1].policy=none minio/minio
|
||||
```
|
||||
|
||||
Description of the configuration parameters used above -
|
||||
|
||||
- `users[].accessKey` - accessKey of user
|
||||
- `users[].secretKey` - secretKey of usersecretRef
|
||||
- `users[].existingSecret` - secret name that contains the secretKey of user
|
||||
- `users[].existingSecretKey` - data key in existingSecret secret containing the secretKey
|
||||
- `users[].policy` - name of the policy to assign to user
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
Assuming your release is named as `my-release`, delete it using the command:
|
||||
|
||||
```bash
|
||||
helm delete my-release
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
helm uninstall my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
{{- if eq .Values.service.type "ClusterIP" "NodePort" }}
|
||||
MinIO can be accessed via port {{ .Values.service.port }} on the following DNS name from within your cluster:
|
||||
{{ template "minio.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
|
||||
|
||||
To access MinIO from localhost, run the below commands:
|
||||
|
||||
1. export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
|
||||
2. kubectl port-forward $POD_NAME 9000 --namespace {{ .Release.Namespace }}
|
||||
|
||||
Read more about port forwarding here: http://kubernetes.io/docs/user-guide/kubectl/kubectl_port-forward/
|
||||
|
||||
You can now access MinIO server on http://localhost:9000. Follow the below steps to connect to MinIO server with mc client:
|
||||
|
||||
1. Download the MinIO mc client - https://docs.minio.io/docs/minio-client-quickstart-guide
|
||||
|
||||
2. export MC_HOST_{{ template "minio.fullname" . }}-local=http://$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "minio.secretName" . }} -o jsonpath="{.data.rootUser}" | base64 --decode):$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "minio.secretName" . }} -o jsonpath="{.data.rootPassword}" | base64 --decode)@localhost:{{ .Values.service.port }}
|
||||
|
||||
3. mc ls {{ template "minio.fullname" . }}-local
|
||||
|
||||
{{- end }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }}
|
||||
MinIO can be accessed via port {{ .Values.service.port }} on an external IP address. Get the service external IP address by:
|
||||
kubectl get svc --namespace {{ .Release.Namespace }} -l app={{ template "minio.fullname" . }}
|
||||
|
||||
Note that the public IP may take a couple of minutes to be available.
|
||||
|
||||
You can now access MinIO server on http://<External-IP>:9000. Follow the below steps to connect to MinIO server with mc client:
|
||||
|
||||
1. Download the MinIO mc client - https://docs.minio.io/docs/minio-client-quickstart-guide
|
||||
|
||||
2. export MC_HOST_{{ template "minio.fullname" . }}-local=http://$(kubectl get secret {{ template "minio.secretName" . }} --namespace {{ .Release.Namespace }} -o jsonpath="{.data.rootUser}" | base64 --decode):$(kubectl get secret {{ template "minio.secretName" . }} -o jsonpath="{.data.rootPassword}" | base64 --decode)@<External-IP>:{{ .Values.service.port }}
|
||||
|
||||
3. mc ls {{ template "minio.fullname" . }}
|
||||
|
||||
Alternately, you can use your browser or the MinIO SDK to access the server - https://docs.minio.io/categories/17
|
||||
{{- end }}
|
||||
|
||||
{{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
|
||||
Note: Since NetworkPolicy is enabled, only pods with label
|
||||
{{ template "minio.fullname" . }}-client=true"
|
||||
will be able to connect to this minio cluster.
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
#!/bin/sh
|
||||
set -e ; # Have script exit in the event of a failed command.
|
||||
|
||||
{{- if .Values.configPathmc }}
|
||||
MC_CONFIG_DIR="{{ .Values.configPathmc }}"
|
||||
MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}"
|
||||
{{- else }}
|
||||
MC="/usr/bin/mc --insecure"
|
||||
{{- end }}
|
||||
|
||||
# connectToMinio
|
||||
# Use a check-sleep-check loop to wait for MinIO service to be available
|
||||
connectToMinio() {
|
||||
SCHEME=$1
|
||||
ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts
|
||||
set -e ; # fail if we can't read the keys.
|
||||
ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ;
|
||||
set +e ; # The connections to minio are allowed to fail.
|
||||
echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ;
|
||||
MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ;
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
until [ $STATUS = 0 ]
|
||||
do
|
||||
ATTEMPTS=`expr $ATTEMPTS + 1` ;
|
||||
echo \"Failed attempts: $ATTEMPTS\" ;
|
||||
if [ $ATTEMPTS -gt $LIMIT ]; then
|
||||
exit 1 ;
|
||||
fi ;
|
||||
sleep 2 ; # 1 second intervals between attempts
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
done ;
|
||||
set -e ; # reset `e` as active
|
||||
return 0
|
||||
}
|
||||
|
||||
# checkBucketExists ($bucket)
|
||||
# Check if the bucket exists, by using the exit code of `mc ls`
|
||||
checkBucketExists() {
|
||||
BUCKET=$1
|
||||
CMD=$(${MC} ls myminio/$BUCKET > /dev/null 2>&1)
|
||||
return $?
|
||||
}
|
||||
|
||||
# createBucket ($bucket, $policy, $purge)
|
||||
# Ensure bucket exists, purging if asked to
|
||||
createBucket() {
|
||||
BUCKET=$1
|
||||
POLICY=$2
|
||||
PURGE=$3
|
||||
VERSIONING=$4
|
||||
OBJECTLOCKING=$5
|
||||
|
||||
# Purge the bucket, if set & exists
|
||||
# Since PURGE is user input, check explicitly for `true`
|
||||
if [ $PURGE = true ]; then
|
||||
if checkBucketExists $BUCKET ; then
|
||||
echo "Purging bucket '$BUCKET'."
|
||||
set +e ; # don't exit if this fails
|
||||
${MC} rm -r --force myminio/$BUCKET
|
||||
set -e ; # reset `e` as active
|
||||
else
|
||||
echo "Bucket '$BUCKET' does not exist, skipping purge."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Create the bucket if it does not exist and set objectlocking if enabled (NOTE: versioning will be not changed if OBJECTLOCKING is set because it enables versioning to the Buckets created)
|
||||
if ! checkBucketExists $BUCKET ; then
|
||||
if [ ! -z $OBJECTLOCKING ] ; then
|
||||
if [ $OBJECTLOCKING = true ] ; then
|
||||
echo "Creating bucket with OBJECTLOCKING '$BUCKET'"
|
||||
${MC} mb --with-lock myminio/$BUCKET
|
||||
elif [ $OBJECTLOCKING = false ] ; then
|
||||
echo "Creating bucket '$BUCKET'"
|
||||
${MC} mb myminio/$BUCKET
|
||||
fi
|
||||
elif [ -z $OBJECTLOCKING ] ; then
|
||||
echo "Creating bucket '$BUCKET'"
|
||||
${MC} mb myminio/$BUCKET
|
||||
else
|
||||
echo "Bucket '$BUCKET' already exists."
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# set versioning for bucket if objectlocking is disabled or not set
|
||||
if [ -z $OBJECTLOCKING ] ; then
|
||||
if [ ! -z $VERSIONING ] ; then
|
||||
if [ $VERSIONING = true ] ; then
|
||||
echo "Enabling versioning for '$BUCKET'"
|
||||
${MC} version enable myminio/$BUCKET
|
||||
elif [ $VERSIONING = false ] ; then
|
||||
echo "Suspending versioning for '$BUCKET'"
|
||||
${MC} version suspend myminio/$BUCKET
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Bucket '$BUCKET' versioning unchanged."
|
||||
fi
|
||||
|
||||
|
||||
# At this point, the bucket should exist, skip checking for existence
|
||||
# Set policy on the bucket
|
||||
echo "Setting policy of bucket '$BUCKET' to '$POLICY'."
|
||||
${MC} policy set $POLICY myminio/$BUCKET
|
||||
}
|
||||
|
||||
# Try connecting to MinIO instance
|
||||
{{- if .Values.tls.enabled }}
|
||||
scheme=https
|
||||
{{- else }}
|
||||
scheme=http
|
||||
{{- end }}
|
||||
connectToMinio $scheme
|
||||
|
||||
{{ if .Values.buckets }}
|
||||
{{ $global := . }}
|
||||
# Create the buckets
|
||||
{{- range .Values.buckets }}
|
||||
createBucket {{ tpl .name $global }} {{ .policy }} {{ .purge }} {{ .versioning }} {{ .objectlocking }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/sh
|
||||
set -e ; # Have script exit in the event of a failed command.
|
||||
|
||||
{{- if .Values.configPathmc }}
|
||||
MC_CONFIG_DIR="{{ .Values.configPathmc }}"
|
||||
MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}"
|
||||
{{- else }}
|
||||
MC="/usr/bin/mc --insecure"
|
||||
{{- end }}
|
||||
|
||||
# connectToMinio
|
||||
# Use a check-sleep-check loop to wait for MinIO service to be available
|
||||
connectToMinio() {
|
||||
SCHEME=$1
|
||||
ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts
|
||||
set -e ; # fail if we can't read the keys.
|
||||
ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ;
|
||||
set +e ; # The connections to minio are allowed to fail.
|
||||
echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ;
|
||||
MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ;
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
until [ $STATUS = 0 ]
|
||||
do
|
||||
ATTEMPTS=`expr $ATTEMPTS + 1` ;
|
||||
echo \"Failed attempts: $ATTEMPTS\" ;
|
||||
if [ $ATTEMPTS -gt $LIMIT ]; then
|
||||
exit 1 ;
|
||||
fi ;
|
||||
sleep 2 ; # 1 second intervals between attempts
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
done ;
|
||||
set -e ; # reset `e` as active
|
||||
return 0
|
||||
}
|
||||
|
||||
# checkPolicyExists ($policy)
|
||||
# Check if the policy exists, by using the exit code of `mc admin policy info`
|
||||
checkPolicyExists() {
|
||||
POLICY=$1
|
||||
CMD=$(${MC} admin policy info myminio $POLICY > /dev/null 2>&1)
|
||||
return $?
|
||||
}
|
||||
|
||||
# createPolicy($name, $filename)
|
||||
createPolicy () {
|
||||
NAME=$1
|
||||
FILENAME=$2
|
||||
|
||||
# Create the name if it does not exist
|
||||
echo "Checking policy: $NAME (in /config/$FILENAME.json)"
|
||||
if ! checkPolicyExists $NAME ; then
|
||||
echo "Creating policy '$NAME'"
|
||||
else
|
||||
echo "Policy '$NAME' already exists."
|
||||
fi
|
||||
${MC} admin policy add myminio $NAME /config/$FILENAME.json
|
||||
|
||||
}
|
||||
|
||||
# Try connecting to MinIO instance
|
||||
{{- if .Values.tls.enabled }}
|
||||
scheme=https
|
||||
{{- else }}
|
||||
scheme=http
|
||||
{{- end }}
|
||||
connectToMinio $scheme
|
||||
|
||||
{{ if .Values.policies }}
|
||||
# Create the policies
|
||||
{{- range $idx, $policy := .Values.policies }}
|
||||
createPolicy {{ $policy.name }} policy_{{ $idx }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
#!/bin/sh
|
||||
set -e ; # Have script exit in the event of a failed command.
|
||||
|
||||
{{- if .Values.configPathmc }}
|
||||
MC_CONFIG_DIR="{{ .Values.configPathmc }}"
|
||||
MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}"
|
||||
{{- else }}
|
||||
MC="/usr/bin/mc --insecure"
|
||||
{{- end }}
|
||||
|
||||
# AccessKey and secretkey credentials file are added to prevent shell execution errors caused by special characters.
|
||||
# Special characters for example : ',",<,>,{,}
|
||||
MINIO_ACCESSKEY_SECRETKEY_TMP="/tmp/accessKey_and_secretKey_tmp"
|
||||
|
||||
# connectToMinio
|
||||
# Use a check-sleep-check loop to wait for MinIO service to be available
|
||||
connectToMinio() {
|
||||
SCHEME=$1
|
||||
ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts
|
||||
set -e ; # fail if we can't read the keys.
|
||||
ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ;
|
||||
set +e ; # The connections to minio are allowed to fail.
|
||||
echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ;
|
||||
MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ;
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
until [ $STATUS = 0 ]
|
||||
do
|
||||
ATTEMPTS=`expr $ATTEMPTS + 1` ;
|
||||
echo \"Failed attempts: $ATTEMPTS\" ;
|
||||
if [ $ATTEMPTS -gt $LIMIT ]; then
|
||||
exit 1 ;
|
||||
fi ;
|
||||
sleep 2 ; # 1 second intervals between attempts
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
done ;
|
||||
set -e ; # reset `e` as active
|
||||
return 0
|
||||
}
|
||||
|
||||
# checkUserExists ()
|
||||
# Check if the user exists, by using the exit code of `mc admin user info`
|
||||
checkUserExists() {
|
||||
CMD=$(${MC} admin user info myminio $(head -1 $MINIO_ACCESSKEY_SECRETKEY_TMP) > /dev/null 2>&1)
|
||||
return $?
|
||||
}
|
||||
|
||||
# createUser ($policy)
|
||||
createUser() {
|
||||
POLICY=$1
|
||||
#check accessKey_and_secretKey_tmp file
|
||||
if [[ ! -f $MINIO_ACCESSKEY_SECRETKEY_TMP ]];then
|
||||
echo "credentials file does not exist"
|
||||
return 1
|
||||
fi
|
||||
if [[ $(cat $MINIO_ACCESSKEY_SECRETKEY_TMP|wc -l) -ne 2 ]];then
|
||||
echo "credentials file is invalid"
|
||||
rm -f $MINIO_ACCESSKEY_SECRETKEY_TMP
|
||||
return 1
|
||||
fi
|
||||
USER=$(head -1 $MINIO_ACCESSKEY_SECRETKEY_TMP)
|
||||
# Create the user if it does not exist
|
||||
if ! checkUserExists ; then
|
||||
echo "Creating user '$USER'"
|
||||
cat $MINIO_ACCESSKEY_SECRETKEY_TMP | ${MC} admin user add myminio
|
||||
else
|
||||
echo "User '$USER' already exists."
|
||||
fi
|
||||
#clean up credentials files.
|
||||
rm -f $MINIO_ACCESSKEY_SECRETKEY_TMP
|
||||
|
||||
# set policy for user
|
||||
if [ ! -z $POLICY -a $POLICY != " " ] ; then
|
||||
echo "Adding policy '$POLICY' for '$USER'"
|
||||
${MC} admin policy set myminio $POLICY user=$USER
|
||||
else
|
||||
echo "User '$USER' has no policy attached."
|
||||
fi
|
||||
}
|
||||
|
||||
# Try connecting to MinIO instance
|
||||
{{- if .Values.tls.enabled }}
|
||||
scheme=https
|
||||
{{- else }}
|
||||
scheme=http
|
||||
{{- end }}
|
||||
connectToMinio $scheme
|
||||
|
||||
{{ if .Values.users }}
|
||||
{{ $global := . }}
|
||||
# Create the users
|
||||
{{- range .Values.users }}
|
||||
echo {{ tpl .accessKey $global }} > $MINIO_ACCESSKEY_SECRETKEY_TMP
|
||||
{{- if .existingSecret }}
|
||||
cat /config/secrets/{{ tpl .existingSecretKey $global }} >> $MINIO_ACCESSKEY_SECRETKEY_TMP
|
||||
# Add a new line if it doesn't exist
|
||||
sed -i '$a\' $MINIO_ACCESSKEY_SECRETKEY_TMP
|
||||
createUser {{ .policy }}
|
||||
{{ else }}
|
||||
echo {{ .secretKey }} >> $MINIO_ACCESSKEY_SECRETKEY_TMP
|
||||
createUser {{ .policy }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#!/bin/sh
|
||||
set -e ; # Have script exit in the event of a failed command.
|
||||
|
||||
{{- if .Values.configPathmc }}
|
||||
MC_CONFIG_DIR="{{ .Values.configPathmc }}"
|
||||
MC="/usr/bin/mc --insecure --config-dir ${MC_CONFIG_DIR}"
|
||||
{{- else }}
|
||||
MC="/usr/bin/mc --insecure"
|
||||
{{- end }}
|
||||
|
||||
# connectToMinio
|
||||
# Use a check-sleep-check loop to wait for MinIO service to be available
|
||||
connectToMinio() {
|
||||
SCHEME=$1
|
||||
ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts
|
||||
set -e ; # fail if we can't read the keys.
|
||||
ACCESS=$(cat /config/rootUser) ; SECRET=$(cat /config/rootPassword) ;
|
||||
set +e ; # The connections to minio are allowed to fail.
|
||||
echo "Connecting to MinIO server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ;
|
||||
MC_COMMAND="${MC} alias set myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ;
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
until [ $STATUS = 0 ]
|
||||
do
|
||||
ATTEMPTS=`expr $ATTEMPTS + 1` ;
|
||||
echo \"Failed attempts: $ATTEMPTS\" ;
|
||||
if [ $ATTEMPTS -gt $LIMIT ]; then
|
||||
exit 1 ;
|
||||
fi ;
|
||||
sleep 2 ; # 1 second intervals between attempts
|
||||
$MC_COMMAND ;
|
||||
STATUS=$? ;
|
||||
done ;
|
||||
set -e ; # reset `e` as active
|
||||
return 0
|
||||
}
|
||||
|
||||
# runCommand ($@)
|
||||
# Run custom mc command
|
||||
runCommand() {
|
||||
${MC} "$@"
|
||||
return $?
|
||||
}
|
||||
|
||||
# Try connecting to MinIO instance
|
||||
{{- if .Values.tls.enabled }}
|
||||
scheme=https
|
||||
{{- else }}
|
||||
scheme=http
|
||||
{{- end }}
|
||||
connectToMinio $scheme
|
||||
|
||||
{{ if .Values.customCommands }}
|
||||
# Run custom commands
|
||||
{{- range .Values.customCommands }}
|
||||
runCommand {{ .command }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
{{- $statements_length := len .statements -}}
|
||||
{{- $statements_length := sub $statements_length 1 -}}
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{{- range $i, $statement := .statements }}
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"{{ $statement.actions | join "\",\n\"" }}"
|
||||
]{{ if $statement.resources }},
|
||||
"Resource": [
|
||||
"{{ $statement.resources | join "\",\n\"" }}"
|
||||
]{{ end }}
|
||||
{{- if $statement.conditions }}
|
||||
{{- $condition_len := len $statement.conditions }}
|
||||
{{- $condition_len := sub $condition_len 1 }}
|
||||
,
|
||||
"Condition": {
|
||||
{{- range $k,$v := $statement.conditions }}
|
||||
{{- range $operator,$object := $v }}
|
||||
"{{ $operator }}": { {{ $object }} }{{- if lt $k $condition_len }},{{- end }}
|
||||
{{- end }}{{- end }}
|
||||
}{{- end }}
|
||||
}{{ if lt $i $statements_length }},{{end }}
|
||||
{{- end }}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "minio.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "minio.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "minio.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for networkpolicy.
|
||||
*/}}
|
||||
{{- define "minio.networkPolicy.apiVersion" -}}
|
||||
{{- if semverCompare ">=1.4-0, <1.7-0" .Capabilities.KubeVersion.Version -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else if semverCompare ">=1.7-0, <1.16-0" .Capabilities.KubeVersion.Version -}}
|
||||
{{- print "networking.k8s.io/v1beta1" -}}
|
||||
{{- else if semverCompare "^1.16-0" .Capabilities.KubeVersion.Version -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for deployment.
|
||||
*/}}
|
||||
{{- define "minio.deployment.apiVersion" -}}
|
||||
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.Version -}}
|
||||
{{- print "apps/v1beta2" -}}
|
||||
{{- else -}}
|
||||
{{- print "apps/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for statefulset.
|
||||
*/}}
|
||||
{{- define "minio.statefulset.apiVersion" -}}
|
||||
{{- if semverCompare "<1.16-0" .Capabilities.KubeVersion.Version -}}
|
||||
{{- print "apps/v1beta2" -}}
|
||||
{{- else -}}
|
||||
{{- print "apps/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for ingress.
|
||||
*/}}
|
||||
{{- define "minio.ingress.apiVersion" -}}
|
||||
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "networking.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for console ingress.
|
||||
*/}}
|
||||
{{- define "minio.consoleIngress.apiVersion" -}}
|
||||
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "networking.k8s.io/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Determine secret name.
|
||||
*/}}
|
||||
{{- define "minio.secretName" -}}
|
||||
{{- if .Values.existingSecret -}}
|
||||
{{- .Values.existingSecret }}
|
||||
{{- else -}}
|
||||
{{- include "minio.fullname" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Determine name for scc role and rolebinding
|
||||
*/}}
|
||||
{{- define "minio.sccRoleName" -}}
|
||||
{{- printf "%s-%s" "scc" (include "minio.fullname" .) | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Properly format optional additional arguments to MinIO binary
|
||||
*/}}
|
||||
{{- define "minio.extraArgs" -}}
|
||||
{{- range .Values.extraArgs -}}
|
||||
{{ " " }}{{ . }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "minio.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{ toYaml .Values.imagePullSecrets }}
|
||||
{{- end -}}
|
||||
{{- else if .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{ toYaml .Values.imagePullSecrets }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Formats volumeMount for MinIO TLS keys and trusted certs
|
||||
*/}}
|
||||
{{- define "minio.tlsKeysVolumeMount" -}}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume
|
||||
mountPath: {{ .Values.certsPath }}
|
||||
{{- end }}
|
||||
{{- if or .Values.tls.enabled (ne .Values.trustedCertsSecret "") }}
|
||||
{{- $casPath := printf "%s/CAs" .Values.certsPath | clean }}
|
||||
- name: trusted-cert-secret-volume
|
||||
mountPath: {{ $casPath }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Formats volume for MinIO TLS keys and trusted certs
|
||||
*/}}
|
||||
{{- define "minio.tlsKeysVolume" -}}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume
|
||||
secret:
|
||||
secretName: {{ .Values.tls.certSecret }}
|
||||
items:
|
||||
- key: {{ .Values.tls.publicCrt }}
|
||||
path: public.crt
|
||||
- key: {{ .Values.tls.privateKey }}
|
||||
path: private.key
|
||||
{{- end }}
|
||||
{{- if or .Values.tls.enabled (ne .Values.trustedCertsSecret "") }}
|
||||
{{- $certSecret := eq .Values.trustedCertsSecret "" | ternary .Values.tls.certSecret .Values.trustedCertsSecret }}
|
||||
{{- $publicCrt := eq .Values.trustedCertsSecret "" | ternary .Values.tls.publicCrt "" }}
|
||||
- name: trusted-cert-secret-volume
|
||||
secret:
|
||||
secretName: {{ $certSecret }}
|
||||
{{- if ne $publicCrt "" }}
|
||||
items:
|
||||
- key: {{ $publicCrt }}
|
||||
path: public.crt
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Returns the available value for certain key in an existing secret (if it exists),
|
||||
otherwise it generates a random value.
|
||||
*/}}
|
||||
{{- define "minio.getValueFromSecret" }}
|
||||
{{- $len := (default 16 .Length) | int -}}
|
||||
{{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}}
|
||||
{{- if $obj }}
|
||||
{{- index $obj .Key | b64dec -}}
|
||||
{{- else -}}
|
||||
{{- randAlphaNum $len -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "minio.root.username" -}}
|
||||
{{- if .Values.rootUser }}
|
||||
{{- .Values.rootUser | toString }}
|
||||
{{- else }}
|
||||
{{- include "minio.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "minio.fullname" .) "Length" 20 "Key" "rootUser") }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "minio.root.password" -}}
|
||||
{{- if .Values.rootPassword }}
|
||||
{{- .Values.rootPassword | toString }}
|
||||
{{- else }}
|
||||
{{- include "minio.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" (include "minio.fullname" .) "Length" 40 "Key" "rootPassword") }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
initialize: |-
|
||||
{{ include (print $.Template.BasePath "/_helper_create_bucket.txt") . | indent 4 }}
|
||||
add-user: |-
|
||||
{{ include (print $.Template.BasePath "/_helper_create_user.txt") . | indent 4 }}
|
||||
add-policy: |-
|
||||
{{ include (print $.Template.BasePath "/_helper_create_policy.txt") . | indent 4 }}
|
||||
{{- range $idx, $policy := .Values.policies }}
|
||||
# {{ $policy.name }}
|
||||
policy_{{ $idx }}.json: |-
|
||||
{{ include (print $.Template.BasePath "/_helper_policy.tpl") . | indent 4 }}
|
||||
{{ end }}
|
||||
custom-command: |-
|
||||
{{ include (print $.Template.BasePath "/_helper_custom_command.txt") . | indent 4 }}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
{{- if .Values.consoleIngress.enabled -}}
|
||||
{{- $fullName := printf "%s-console" (include "minio.fullname" .) -}}
|
||||
{{- $servicePort := .Values.consoleService.port -}}
|
||||
{{- $ingressPath := .Values.consoleIngress.path -}}
|
||||
apiVersion: {{ template "minio.consoleIngress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.consoleIngress.labels }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.consoleIngress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.consoleIngress.ingressClassName }}
|
||||
ingressClassName: {{ .Values.consoleIngress.ingressClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.consoleIngress.tls }}
|
||||
tls:
|
||||
{{- range .Values.consoleIngress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.consoleIngress.hosts }}
|
||||
- http:
|
||||
paths:
|
||||
- path: {{ $ingressPath }}
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
backend:
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- if . }}
|
||||
host: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
{{ $scheme := "http" }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{ $scheme = "https" }}
|
||||
{{ end }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-console
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.consoleService.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.consoleService.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if (or (eq .Values.consoleService.type "ClusterIP" "") (empty .Values.consoleService.type)) }}
|
||||
type: ClusterIP
|
||||
{{- if not (empty .Values.consoleService.clusterIP) }}
|
||||
clusterIP: {{ .Values.consoleService.clusterIP }}
|
||||
{{end}}
|
||||
{{- else if eq .Values.consoleService.type "LoadBalancer" }}
|
||||
type: {{ .Values.consoleService.type }}
|
||||
loadBalancerIP: {{ default "" .Values.consoleService.loadBalancerIP }}
|
||||
{{- else }}
|
||||
type: {{ .Values.consoleService.type }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ $scheme }}
|
||||
port: {{ .Values.consoleService.port }}
|
||||
protocol: TCP
|
||||
{{- if (and (eq .Values.consoleService.type "NodePort") ( .Values.consoleService.nodePort)) }}
|
||||
nodePort: {{ .Values.consoleService.nodePort }}
|
||||
{{- else }}
|
||||
targetPort: {{ .Values.minioConsolePort }}
|
||||
{{- end}}
|
||||
{{- if .Values.consoleService.externalIPs }}
|
||||
externalIPs:
|
||||
{{- range $i , $ip := .Values.consoleService.externalIPs }}
|
||||
- {{ $ip }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
{{- if eq .Values.mode "standalone" }}
|
||||
{{ $scheme := "http" }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{ $scheme = "https" }}
|
||||
{{ end }}
|
||||
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
|
||||
apiVersion: {{ template "minio.deployment.apiVersion" . }}
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.additionalLabels }}
|
||||
{{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.additionalAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
strategy:
|
||||
type: {{ .Values.DeploymentUpdate.type }}
|
||||
{{- if eq .Values.DeploymentUpdate.type "RollingUpdate" }}
|
||||
rollingUpdate:
|
||||
maxSurge: {{ .Values.DeploymentUpdate.maxSurge }}
|
||||
maxUnavailable: {{ .Values.DeploymentUpdate.maxUnavailable }}
|
||||
{{- end}}
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if not .Values.ignoreChartChecksums }}
|
||||
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.priorityClassName }}"
|
||||
{{- end }}
|
||||
{{- if .Values.runtimeClassName }}
|
||||
runtimeClassName: "{{ .Values.runtimeClassName }}"
|
||||
{{- end }}
|
||||
{{- if and .Values.securityContext.enabled .Values.persistence.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- if and (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "20") }}
|
||||
fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-ce"
|
||||
- "/usr/bin/docker-entrypoint.sh minio server {{ $bucketRoot }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template "minio.extraArgs" . }}"
|
||||
volumeMounts:
|
||||
- name: minio-user
|
||||
mountPath: "/tmp/credentials"
|
||||
readOnly: true
|
||||
- name: export
|
||||
mountPath: {{ .Values.mountPath }}
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.subPath }}
|
||||
subPath: "{{ .Values.persistence.subPath }}"
|
||||
{{- end }}
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: extra-secret
|
||||
mountPath: "/tmp/minio-config-env"
|
||||
{{- end }}
|
||||
{{- include "minio.tlsKeysVolumeMount" . | indent 12 }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ $scheme }}
|
||||
containerPort: {{ .Values.minioAPIPort }}
|
||||
- name: {{ $scheme }}-console
|
||||
containerPort: {{ .Values.minioConsolePort }}
|
||||
env:
|
||||
- name: MINIO_ROOT_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
key: rootUser
|
||||
- name: MINIO_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
key: rootPassword
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: MINIO_CONFIG_ENV_FILE
|
||||
value: "/tmp/minio-config-env/config.env"
|
||||
{{- end}}
|
||||
{{- if .Values.metrics.serviceMonitor.public }}
|
||||
- name: MINIO_PROMETHEUS_AUTH_TYPE
|
||||
value: "public"
|
||||
{{- end}}
|
||||
{{- if .Values.oidc.enabled }}
|
||||
- name: MINIO_IDENTITY_OPENID_CONFIG_URL
|
||||
value: {{ .Values.oidc.configUrl }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLIENT_ID
|
||||
value: {{ .Values.oidc.clientId }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLIENT_SECRET
|
||||
value: {{ .Values.oidc.clientSecret }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
|
||||
value: {{ .Values.oidc.claimName }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX
|
||||
value: {{ .Values.oidc.claimPrefix }}
|
||||
- name: MINIO_IDENTITY_OPENID_SCOPES
|
||||
value: {{ .Values.oidc.scopes }}
|
||||
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
|
||||
value: {{ .Values.oidc.redirectUri }}
|
||||
- name: MINIO_IDENTITY_OPENID_COMMENT
|
||||
value: {{ .Values.oidc.comment }}
|
||||
{{- end}}
|
||||
{{- if .Values.etcd.endpoints }}
|
||||
- name: MINIO_ETCD_ENDPOINTS
|
||||
value: {{ join "," .Values.etcd.endpoints | quote }}
|
||||
{{- if .Values.etcd.clientCert }}
|
||||
- name: MINIO_ETCD_CLIENT_CERT
|
||||
value: "/tmp/credentials/etcd_client_cert.pem"
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.clientCertKey }}
|
||||
- name: MINIO_ETCD_CLIENT_CERT_KEY
|
||||
value: "/tmp/credentials/etcd_client_cert_key.pem"
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.pathPrefix }}
|
||||
- name: MINIO_ETCD_PATH_PREFIX
|
||||
value: {{ .Values.etcd.pathPrefix }}
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.corednsPathPrefix }}
|
||||
- name: MINIO_ETCD_COREDNS_PATH
|
||||
value: {{ .Values.etcd.corednsPathPrefix }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $key, $val := .Values.environment }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end}}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: export
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "minio.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: extra-secret
|
||||
secret:
|
||||
secretName: {{ .Values.extraSecret }}
|
||||
{{- end }}
|
||||
- name: minio-user
|
||||
secret:
|
||||
secretName: {{ template "minio.secretName" . }}
|
||||
{{- include "minio.tlsKeysVolume" . | indent 8 }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{ toYaml .Values.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
{{- if eq .Values.mode "gateway" }}
|
||||
{{ $scheme := "http" }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{ $scheme = "https" }}
|
||||
{{ end }}
|
||||
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
|
||||
apiVersion: {{ template "minio.deployment.apiVersion" . }}
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.additionalLabels }}
|
||||
{{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.additionalAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
strategy:
|
||||
type: {{ .Values.DeploymentUpdate.type }}
|
||||
{{- if eq .Values.DeploymentUpdate.type "RollingUpdate" }}
|
||||
rollingUpdate:
|
||||
maxSurge: {{ .Values.DeploymentUpdate.maxSurge }}
|
||||
maxUnavailable: {{ .Values.DeploymentUpdate.maxUnavailable }}
|
||||
{{- end}}
|
||||
replicas: {{ .Values.gateway.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if not .Values.ignoreChartChecksums }}
|
||||
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.priorityClassName }}"
|
||||
{{- end }}
|
||||
{{- if and .Values.securityContext.enabled .Values.persistence.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{ if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
command:
|
||||
- "/bin/sh"
|
||||
- "-ce"
|
||||
{{- if eq .Values.gateway.type "nas" }}
|
||||
- "/usr/bin/docker-entrypoint.sh minio gateway nas {{ $bucketRoot }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template "minio.extraArgs" . }} "
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: minio-user
|
||||
mountPath: "/tmp/credentials"
|
||||
readOnly: true
|
||||
{{- if .Values.persistence.enabled }}
|
||||
- name: export
|
||||
mountPath: {{ .Values.mountPath }}
|
||||
{{- if .Values.persistence.subPath }}
|
||||
subPath: "{{ .Values.persistence.subPath }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: extra-secret
|
||||
mountPath: "/tmp/minio-config-env"
|
||||
{{- end }}
|
||||
{{- include "minio.tlsKeysVolumeMount" . | indent 12 }}
|
||||
ports:
|
||||
- name: {{ $scheme }}
|
||||
containerPort: {{ .Values.minioAPIPort }}
|
||||
- name: {{ $scheme }}-console
|
||||
containerPort: {{ .Values.minioConsolePort }}
|
||||
env:
|
||||
- name: MINIO_ROOT_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
key: rootUser
|
||||
- name: MINIO_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
key: rootPassword
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: MINIO_CONFIG_ENV_FILE
|
||||
value: "/tmp/minio-config-env/config.env"
|
||||
{{- end}}
|
||||
{{- if .Values.metrics.serviceMonitor.public }}
|
||||
- name: MINIO_PROMETHEUS_AUTH_TYPE
|
||||
value: "public"
|
||||
{{- end}}
|
||||
{{- if .Values.etcd.endpoints }}
|
||||
- name: MINIO_ETCD_ENDPOINTS
|
||||
value: {{ join "," .Values.etcd.endpoints | quote }}
|
||||
{{- if .Values.etcd.clientCert }}
|
||||
- name: MINIO_ETCD_CLIENT_CERT
|
||||
value: "/tmp/credentials/etcd_client.crt"
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.clientCertKey }}
|
||||
- name: MINIO_ETCD_CLIENT_CERT_KEY
|
||||
value: "/tmp/credentials/etcd_client.key"
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.pathPrefix }}
|
||||
- name: MINIO_ETCD_PATH_PREFIX
|
||||
value: {{ .Values.etcd.pathPrefix }}
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.corednsPathPrefix }}
|
||||
- name: MINIO_ETCD_COREDNS_PATH
|
||||
value: {{ .Values.etcd.corednsPathPrefix }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $key, $val := .Values.environment }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end}}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: export
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "minio.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: minio-user
|
||||
secret:
|
||||
secretName: {{ template "minio.secretName" . }}
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: extra-secret
|
||||
secret:
|
||||
secretName: {{ .Values.extraSecret }}
|
||||
{{- end }}
|
||||
{{- include "minio.tlsKeysVolume" . | indent 8 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "minio.fullname" . -}}
|
||||
{{- $servicePort := .Values.service.port -}}
|
||||
{{- $ingressPath := .Values.ingress.path -}}
|
||||
apiVersion: {{ template "minio.ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- with .Values.ingress.labels }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.ingressClassName }}
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- http:
|
||||
paths:
|
||||
- path: {{ $ingressPath }}
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $servicePort }}
|
||||
{{- else }}
|
||||
backend:
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $servicePort }}
|
||||
{{- end }}
|
||||
{{- if . }}
|
||||
host: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{{- if .Values.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
ingress:
|
||||
- ports:
|
||||
- port: {{ .Values.minioAPIPort }}
|
||||
- port: {{ .Values.minioConsolePort }}
|
||||
{{- if not .Values.networkPolicy.allowExternal }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ template "minio.name" . }}-client: "true"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
{{- if .Values.podDisruptionBudget.enabled }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: minio
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
spec:
|
||||
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "minio.name" . }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
{{- if .Values.buckets }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-make-bucket-job
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-make-bucket-job
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
annotations:
|
||||
"helm.sh/hook": post-install,post-upgrade
|
||||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
|
||||
{{- with .Values.makeBucketJob.annotations }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-job
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.makeBucketJob.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.makeBucketJob.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.makeBucketJob.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.makeBucketJob.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.makeBucketJob.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.makeBucketJob.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.makeBucketJob.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.makeBucketJob.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.makeBucketJob.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: minio-configuration
|
||||
projected:
|
||||
sources:
|
||||
- configMap:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
- secret:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
secret:
|
||||
secretName: {{ .Values.tls.certSecret }}
|
||||
items:
|
||||
- key: {{ .Values.tls.publicCrt }}
|
||||
path: CAs/public.crt
|
||||
{{ end }}
|
||||
{{- if .Values.makeBucketJob.extraVolumes }}
|
||||
{{- toYaml .Values.makeBucketJob.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{ if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: minio-mc
|
||||
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
|
||||
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
|
||||
{{- if .Values.makeBucketJob.exitCommand }}
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["/bin/sh /config/initialize; x=$(echo $?); {{ .Values.makeBucketJob.exitCommand }} && exit $x" ]
|
||||
{{- else }}
|
||||
command: ["/bin/sh", "/config/initialize"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: MINIO_ENDPOINT
|
||||
value: {{ template "minio.fullname" . }}
|
||||
- name: MINIO_PORT
|
||||
value: {{ .Values.service.port | quote }}
|
||||
volumeMounts:
|
||||
- name: minio-configuration
|
||||
mountPath: /config
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
mountPath: {{ .Values.configPathmc }}certs
|
||||
{{ end }}
|
||||
{{- if .Values.makeBucketJob.extraVolumeMounts }}
|
||||
{{- toYaml .Values.makeBucketJob.extraVolumeMounts | nindent 10 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{ toYaml .Values.makeBucketJob.resources | indent 10 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
{{- if .Values.policies }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-make-policies-job
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-make-policies-job
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
annotations:
|
||||
"helm.sh/hook": post-install,post-upgrade
|
||||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
|
||||
{{- with .Values.makePolicyJob.annotations }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-job
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.makePolicyJob.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.makePolicyJob.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.makePolicyJob.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.makePolicyJob.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.makePolicyJob.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.makePolicyJob.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.makePolicyJob.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.makePolicyJob.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.makePolicyJob.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: minio-configuration
|
||||
projected:
|
||||
sources:
|
||||
- configMap:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
- secret:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
secret:
|
||||
secretName: {{ .Values.tls.certSecret }}
|
||||
items:
|
||||
- key: {{ .Values.tls.publicCrt }}
|
||||
path: CAs/public.crt
|
||||
{{ end }}
|
||||
{{- if .Values.makePolicyJob.extraVolumes }}
|
||||
{{- toYaml .Values.makePolicyJob.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{ if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: minio-mc
|
||||
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
|
||||
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
|
||||
{{- if .Values.makePolicyJob.exitCommand }}
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["/bin/sh /config/add-policy; x=$(echo $?); {{ .Values.makePolicyJob.exitCommand }} && exit $x" ]
|
||||
{{- else }}
|
||||
command: ["/bin/sh", "/config/add-policy"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: MINIO_ENDPOINT
|
||||
value: {{ template "minio.fullname" . }}
|
||||
- name: MINIO_PORT
|
||||
value: {{ .Values.service.port | quote }}
|
||||
volumeMounts:
|
||||
- name: minio-configuration
|
||||
mountPath: /config
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
mountPath: {{ .Values.configPathmc }}certs
|
||||
{{ end }}
|
||||
{{- if .Values.makePolicyJob.extraVolumeMounts }}
|
||||
{{- toYaml .Values.makePolicyJob.extraVolumeMounts | nindent 10 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{ toYaml .Values.makePolicyJob.resources | indent 10 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
{{- $global := . -}}
|
||||
{{- if .Values.users }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-make-user-job
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-make-user-job
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
annotations:
|
||||
"helm.sh/hook": post-install,post-upgrade
|
||||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
|
||||
{{- with .Values.makeUserJob.annotations }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-job
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.makeUserJob.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.makeUserJob.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.makeUserJob.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.makeUserJob.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.makeUserJob.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.makeUserJob.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.makeUserJob.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.makeUserJob.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.makeUserJob.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: minio-configuration
|
||||
projected:
|
||||
sources:
|
||||
- configMap:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
- secret:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
{{- range .Values.users }}
|
||||
{{- if .existingSecret }}
|
||||
- secret:
|
||||
name: {{ tpl .existingSecret $global }}
|
||||
items:
|
||||
- key: {{ .existingSecretKey }}
|
||||
path: secrets/{{ tpl .existingSecretKey $global }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
secret:
|
||||
secretName: {{ .Values.tls.certSecret }}
|
||||
items:
|
||||
- key: {{ .Values.tls.publicCrt }}
|
||||
path: CAs/public.crt
|
||||
{{ end }}
|
||||
{{- if .Values.makeUserJob.extraVolumes }}
|
||||
{{- toYaml .Values.makeUserJob.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{ if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: minio-mc
|
||||
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
|
||||
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
|
||||
{{- if .Values.makeUserJob.exitCommand }}
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["/bin/sh /config/add-user; x=$(echo $?); {{ .Values.makeUserJob.exitCommand }} && exit $x" ]
|
||||
{{- else }}
|
||||
command: ["/bin/sh", "/config/add-user"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: MINIO_ENDPOINT
|
||||
value: {{ template "minio.fullname" . }}
|
||||
- name: MINIO_PORT
|
||||
value: {{ .Values.service.port | quote }}
|
||||
volumeMounts:
|
||||
- name: minio-configuration
|
||||
mountPath: /config
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
mountPath: {{ .Values.configPathmc }}certs
|
||||
{{ end }}
|
||||
{{- if .Values.makeUserJob.extraVolumeMounts }}
|
||||
{{- toYaml .Values.makeUserJob.extraVolumeMounts | nindent 10 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{ toYaml .Values.makeUserJob.resources | indent 10 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
{{- if .Values.customCommands }}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-custom-command-job
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-custom-command-job
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
annotations:
|
||||
"helm.sh/hook": post-install,post-upgrade
|
||||
"helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation
|
||||
{{- with .Values.customCommandJob.annotations }}
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}-job
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.customCommandJob.podAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.customCommandJob.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.customCommandJob.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.customCommandJob.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.customCommandJob.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.customCommandJob.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.customCommandJob.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.customCommandJob.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.customCommandJob.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: minio-configuration
|
||||
projected:
|
||||
sources:
|
||||
- configMap:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
- secret:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
secret:
|
||||
secretName: {{ .Values.tls.certSecret }}
|
||||
items:
|
||||
- key: {{ .Values.tls.publicCrt }}
|
||||
path: CAs/public.crt
|
||||
{{ end }}
|
||||
containers:
|
||||
- name: minio-mc
|
||||
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
|
||||
imagePullPolicy: {{ .Values.mcImage.pullPolicy }}
|
||||
{{- if .Values.customCommandJob.exitCommand }}
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["/bin/sh /config/custom-command; x=$(echo $?); {{ .Values.customCommandJob.exitCommand }} && exit $x" ]
|
||||
{{- else }}
|
||||
command: ["/bin/sh", "/config/custom-command"]
|
||||
{{- end }}
|
||||
env:
|
||||
- name: MINIO_ENDPOINT
|
||||
value: {{ template "minio.fullname" . }}
|
||||
- name: MINIO_PORT
|
||||
value: {{ .Values.service.port | quote }}
|
||||
volumeMounts:
|
||||
- name: minio-configuration
|
||||
mountPath: /config
|
||||
{{- if .Values.tls.enabled }}
|
||||
- name: cert-secret-volume-mc
|
||||
mountPath: {{ .Values.configPathmc }}certs
|
||||
{{ end }}
|
||||
resources:
|
||||
{{ toYaml .Values.customCommandJob.resources | indent 10 }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
{{- if eq .Values.mode "standalone" }}
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.persistence.annotations | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.persistence.VolumeName }}
|
||||
volumeName: "{{ .Values.persistence.VolumeName }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
{{- if not .Values.existingSecret }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
type: Opaque
|
||||
data:
|
||||
rootUser: {{ include "minio.root.username" . | b64enc | quote }}
|
||||
rootPassword: {{ include "minio.root.password" . | b64enc | quote }}
|
||||
{{- if .Values.etcd.clientCert }}
|
||||
etcd_client.crt: {{ .Values.etcd.clientCert | toString | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.etcd.clientCertKey }}
|
||||
etcd_client.key: {{ .Values.etcd.clientCertKey | toString | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
{{- if and .Values.securityContext.enabled .Values.persistence.enabled (.Capabilities.APIVersions.Has "security.openshift.io/v1") }}
|
||||
apiVersion: security.openshift.io/v1
|
||||
kind: SecurityContextConstraints
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
allowHostDirVolumePlugin: false
|
||||
allowHostIPC: false
|
||||
allowHostNetwork: false
|
||||
allowHostPID: false
|
||||
allowHostPorts: false
|
||||
allowPrivilegeEscalation: true
|
||||
allowPrivilegedContainer: false
|
||||
allowedCapabilities: []
|
||||
readOnlyRootFilesystem: false
|
||||
defaultAddCapabilities: []
|
||||
requiredDropCapabilities:
|
||||
- KILL
|
||||
- MKNOD
|
||||
- SETUID
|
||||
- SETGID
|
||||
fsGroup:
|
||||
type: MustRunAs
|
||||
ranges:
|
||||
- max: {{ .Values.securityContext.fsGroup }}
|
||||
min: {{ .Values.securityContext.fsGroup }}
|
||||
runAsUser:
|
||||
type: MustRunAs
|
||||
uid: {{ .Values.securityContext.runAsUser }}
|
||||
seLinuxContext:
|
||||
type: MustRunAs
|
||||
supplementalGroups:
|
||||
type: RunAsAny
|
||||
volumes:
|
||||
- configMap
|
||||
- downwardAPI
|
||||
- emptyDir
|
||||
- persistentVolumeClaim
|
||||
- projected
|
||||
- secret
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
{{ $scheme := "http" }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{ $scheme = "https" }}
|
||||
{{ end }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
monitoring: "true"
|
||||
{{- if .Values.service.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.service.annotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if (or (eq .Values.service.type "ClusterIP" "") (empty .Values.service.type)) }}
|
||||
type: ClusterIP
|
||||
{{- if not (empty .Values.service.clusterIP) }}
|
||||
clusterIP: {{ .Values.service.clusterIP }}
|
||||
{{end}}
|
||||
{{- else if eq .Values.service.type "LoadBalancer" }}
|
||||
type: {{ .Values.service.type }}
|
||||
loadBalancerIP: {{ default "" .Values.service.loadBalancerIP }}
|
||||
{{- else }}
|
||||
type: {{ .Values.service.type }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ $scheme }}
|
||||
port: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
{{- if (and (eq .Values.service.type "NodePort") ( .Values.service.nodePort)) }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- else }}
|
||||
targetPort: {{ .Values.minioAPIPort }}
|
||||
{{- end}}
|
||||
{{- if .Values.service.externalIPs }}
|
||||
externalIPs:
|
||||
{{- range $i , $ip := .Values.service.externalIPs }}
|
||||
- {{ $ip }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.name | quote }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
{{- end -}}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
{{- if and .Values.metrics.serviceMonitor.enabled .Values.metrics.serviceMonitor.includeNode}}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{ else }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
|
||||
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.annotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.metrics.serviceMonitor.annotations | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
endpoints:
|
||||
{{- if .Values.tls.enabled }}
|
||||
- port: https
|
||||
scheme: https
|
||||
tlsConfig:
|
||||
ca:
|
||||
secret:
|
||||
name: {{ .Values.tls.certSecret }}
|
||||
key: {{ .Values.tls.publicCrt }}
|
||||
serverName: {{ template "minio.fullname" . }}
|
||||
{{ else }}
|
||||
- port: http
|
||||
scheme: http
|
||||
{{- end }}
|
||||
path: /minio/v2/metrics/node
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.relabelConfigs }}
|
||||
{{ toYaml .Values.metrics.serviceMonitor.relabelConfigs | indent 6 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.metrics.serviceMonitor.public }}
|
||||
bearerTokenSecret:
|
||||
name: {{ template "minio.fullname" . }}-prometheus
|
||||
key: token
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace | quote }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ include "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
monitoring: "true"
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.enabled }}
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: Probe
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-cluster
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{ else }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
|
||||
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
jobName: {{ template "minio.fullname" . }}
|
||||
prober:
|
||||
url: {{ template "minio.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}
|
||||
path: /minio/v2/metrics/cluster
|
||||
{{- if .Values.tls.enabled }}
|
||||
scheme: https
|
||||
tlsConfig:
|
||||
ca:
|
||||
secret:
|
||||
name: {{ .Values.tls.certSecret }}
|
||||
key: {{ .Values.tls.publicCrt }}
|
||||
serverName: {{ template "minio.fullname" . }}
|
||||
{{ else }}
|
||||
scheme: http
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.relabelConfigsCluster }}
|
||||
{{ toYaml .Values.metrics.serviceMonitor.relabelConfigsCluster | indent 2 }}
|
||||
{{- end }}
|
||||
targets:
|
||||
staticConfig:
|
||||
static:
|
||||
- {{ template "minio.fullname" . }}.{{ .Release.Namespace }}
|
||||
{{- if not .Values.metrics.serviceMonitor.public }}
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
bearerTokenSecret:
|
||||
name: {{ template "minio.fullname" . }}-prometheus
|
||||
key: token
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
{{- if eq .Values.mode "distributed" }}
|
||||
{{ $poolCount := .Values.pools | int }}
|
||||
{{ $nodeCount := .Values.replicas | int }}
|
||||
{{ $replicas := mul $poolCount $nodeCount }}
|
||||
{{ $drivesPerNode := .Values.drivesPerNode | int }}
|
||||
{{ $scheme := "http" }}
|
||||
{{- if .Values.tls.enabled }}
|
||||
{{ $scheme = "https" }}
|
||||
{{ end }}
|
||||
{{ $mountPath := .Values.mountPath }}
|
||||
{{ $bucketRoot := or ($.Values.bucketRoot) ($.Values.mountPath) }}
|
||||
{{ $subPath := .Values.persistence.subPath }}
|
||||
{{ $penabled := .Values.persistence.enabled }}
|
||||
{{ $accessMode := .Values.persistence.accessMode }}
|
||||
{{ $storageClass := .Values.persistence.storageClass }}
|
||||
{{ $psize := .Values.persistence.size }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}-svc
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: "{{ .Release.Name }}"
|
||||
heritage: "{{ .Release.Service }}"
|
||||
spec:
|
||||
publishNotReadyAddresses: true
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: {{ $scheme }}
|
||||
port: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: {{ .Values.minioAPIPort }}
|
||||
selector:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
---
|
||||
apiVersion: {{ template "minio.statefulset.apiVersion" . }}
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
chart: {{ template "minio.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- if .Values.additionalLabels }}
|
||||
{{ toYaml .Values.additionalLabels | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.additionalAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.additionalAnnotations | trimSuffix "\n" | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
updateStrategy:
|
||||
type: {{ .Values.StatefulSetUpdate.updateStrategy }}
|
||||
podManagementPolicy: "Parallel"
|
||||
serviceName: {{ template "minio.fullname" . }}-svc
|
||||
replicas: {{ $replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "minio.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "minio.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{ toYaml .Values.podLabels | indent 8 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if not .Values.ignoreChartChecksums }}
|
||||
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{ toYaml .Values.podAnnotations | trimSuffix "\n" | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: "{{ .Values.priorityClassName }}"
|
||||
{{- end }}
|
||||
{{- if .Values.runtimeClassName }}
|
||||
runtimeClassName: "{{ .Values.runtimeClassName }}"
|
||||
{{- end }}
|
||||
{{- if and .Values.securityContext.enabled .Values.persistence.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
runAsGroup: {{ .Values.securityContext.runAsGroup }}
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- if and (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "20") }}
|
||||
fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
|
||||
command: [ "/bin/sh",
|
||||
"-ce",
|
||||
"/usr/bin/docker-entrypoint.sh minio server {{- range $i := until $poolCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{else}}{{ $bucketRoot }}{{end}}{{- end}} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template `minio.extraArgs` . }}" ]
|
||||
volumeMounts:
|
||||
{{- if $penabled }}
|
||||
{{- if (gt $drivesPerNode 1) }}
|
||||
{{- range $i := until $drivesPerNode }}
|
||||
- name: export-{{ $i }}
|
||||
mountPath: {{ $mountPath }}-{{ $i }}
|
||||
{{- if and $penabled $subPath }}
|
||||
subPath: {{ $subPath }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: export
|
||||
mountPath: {{ $mountPath }}
|
||||
{{- if and $penabled $subPath }}
|
||||
subPath: {{ $subPath }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: extra-secret
|
||||
mountPath: "/tmp/minio-config-env"
|
||||
{{- end }}
|
||||
{{- include "minio.tlsKeysVolumeMount" . | indent 12 }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ $scheme }}
|
||||
containerPort: {{ .Values.minioAPIPort }}
|
||||
- name: {{ $scheme }}-console
|
||||
containerPort: {{ .Values.minioConsolePort }}
|
||||
env:
|
||||
- name: MINIO_ROOT_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
key: rootUser
|
||||
- name: MINIO_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "minio.secretName" . }}
|
||||
key: rootPassword
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: MINIO_CONFIG_ENV_FILE
|
||||
value: "/tmp/minio-config-env/config.env"
|
||||
{{- end}}
|
||||
{{- if .Values.metrics.serviceMonitor.public }}
|
||||
- name: MINIO_PROMETHEUS_AUTH_TYPE
|
||||
value: "public"
|
||||
{{- end}}
|
||||
{{- if .Values.oidc.enabled }}
|
||||
- name: MINIO_IDENTITY_OPENID_CONFIG_URL
|
||||
value: {{ .Values.oidc.configUrl }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLIENT_ID
|
||||
value: {{ .Values.oidc.clientId }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLIENT_SECRET
|
||||
value: {{ .Values.oidc.clientSecret }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLAIM_NAME
|
||||
value: {{ .Values.oidc.claimName }}
|
||||
- name: MINIO_IDENTITY_OPENID_CLAIM_PREFIX
|
||||
value: {{ .Values.oidc.claimPrefix }}
|
||||
- name: MINIO_IDENTITY_OPENID_SCOPES
|
||||
value: {{ .Values.oidc.scopes }}
|
||||
- name: MINIO_IDENTITY_OPENID_REDIRECT_URI
|
||||
value: {{ .Values.oidc.redirectUri }}
|
||||
- name: MINIO_IDENTITY_OPENID_COMMENT
|
||||
value: {{ .Values.oidc.comment }}
|
||||
{{- end}}
|
||||
{{- range $key, $val := .Values.environment }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end}}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- include "minio.imagePullSecrets" . | indent 6 }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (gt $replicas 1) (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "19") }}
|
||||
{{- with .Values.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: minio-user
|
||||
secret:
|
||||
secretName: {{ template "minio.secretName" . }}
|
||||
{{- if .Values.extraSecret }}
|
||||
- name: extra-secret
|
||||
secret:
|
||||
secretName: {{ .Values.extraSecret }}
|
||||
{{- end }}
|
||||
{{- include "minio.tlsKeysVolume" . | indent 8 }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{ toYaml .Values.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
{{- if gt $drivesPerNode 1 }}
|
||||
{{- range $diskId := until $drivesPerNode}}
|
||||
- metadata:
|
||||
name: export-{{ $diskId }}
|
||||
{{- if $.Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml $.Values.persistence.annotations | trimSuffix "\n" | indent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ {{ $accessMode | quote }} ]
|
||||
{{- if $storageClass }}
|
||||
storageClassName: {{ $storageClass }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $psize }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- metadata:
|
||||
name: export
|
||||
{{- if $.Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml $.Values.persistence.annotations | trimSuffix "\n" | indent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ {{ $accessMode | quote }} ]
|
||||
{{- if $storageClass }}
|
||||
storageClassName: {{ $storageClass }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $psize }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,516 @@
|
|||
## Provide a name in place of minio for `app:` labels
|
||||
##
|
||||
nameOverride: ""
|
||||
|
||||
## Provide a name to substitute for the full names of resources
|
||||
##
|
||||
fullnameOverride: ""
|
||||
|
||||
## set kubernetes cluster domain where minio is running
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Set default image, imageTag, and imagePullPolicy. mode is used to indicate the
|
||||
##
|
||||
image:
|
||||
repository: quay.io/minio/minio
|
||||
tag: RELEASE.2022-09-17T00-09-45Z
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
imagePullSecrets: []
|
||||
# - name: "image-pull-secret"
|
||||
|
||||
## Set default image, imageTag, and imagePullPolicy for the `mc` (the minio
|
||||
## client used to create a default bucket).
|
||||
##
|
||||
mcImage:
|
||||
repository: quay.io/minio/mc
|
||||
tag: RELEASE.2022-09-16T09-16-47Z
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
## minio mode, i.e. standalone or distributed or gateway.
|
||||
mode: distributed ## other supported values are "standalone", "gateway"
|
||||
|
||||
## Additional labels to include with deployment or statefulset
|
||||
additionalLabels: {}
|
||||
|
||||
## Additional annotations to include with deployment or statefulset
|
||||
additionalAnnotations: {}
|
||||
|
||||
## Typically the deployment/statefulset includes checksums of secrets/config,
|
||||
## So that when these change on a subsequent helm install, the deployment/statefulset
|
||||
## is restarted. This can result in unnecessary restarts under GitOps tooling such as
|
||||
## flux, so set to "true" to disable this behaviour.
|
||||
ignoreChartChecksums: false
|
||||
|
||||
## Additional arguments to pass to minio binary
|
||||
extraArgs: []
|
||||
|
||||
## Additional volumes to minio container
|
||||
extraVolumes: []
|
||||
|
||||
## Additional volumeMounts to minio container
|
||||
extraVolumeMounts: []
|
||||
|
||||
## Internal port number for MinIO S3 API container
|
||||
## Change service.port to change external port number
|
||||
minioAPIPort: "9000"
|
||||
|
||||
## Internal port number for MinIO Browser Console container
|
||||
## Change consoleService.port to change external port number
|
||||
minioConsolePort: "9001"
|
||||
|
||||
## Update strategy for Deployments
|
||||
DeploymentUpdate:
|
||||
type: RollingUpdate
|
||||
maxUnavailable: 0
|
||||
maxSurge: 100%
|
||||
|
||||
## Update strategy for StatefulSets
|
||||
StatefulSetUpdate:
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Pod priority settings
|
||||
## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName: ""
|
||||
|
||||
## Pod runtime class name
|
||||
## ref https://kubernetes.io/docs/concepts/containers/runtime-class/
|
||||
##
|
||||
runtimeClassName: ""
|
||||
|
||||
## Set default rootUser, rootPassword
|
||||
## AccessKey and secretKey is generated when not set
|
||||
## Distributed MinIO ref: https://docs.minio.io/docs/distributed-minio-quickstart-guide
|
||||
##
|
||||
rootUser: ""
|
||||
rootPassword: ""
|
||||
|
||||
## Use existing Secret that store following variables:
|
||||
##
|
||||
## | Chart var | .data.<key> in Secret |
|
||||
## |:----------------------|:-------------------------|
|
||||
## | rootUser | rootUser |
|
||||
## | rootPassword | rootPassword |
|
||||
##
|
||||
## All mentioned variables will be ignored in values file.
|
||||
## .data.rootUser and .data.rootPassword are mandatory,
|
||||
## others depend on enabled status of corresponding sections.
|
||||
existingSecret: ""
|
||||
|
||||
## Directory on the MinIO pof
|
||||
certsPath: "/etc/minio/certs/"
|
||||
configPathmc: "/etc/minio/mc/"
|
||||
|
||||
## Path where PV would be mounted on the MinIO Pod
|
||||
mountPath: "/export"
|
||||
## Override the root directory which the minio server should serve from.
|
||||
## If left empty, it defaults to the value of {{ .Values.mountPath }}
|
||||
## If defined, it must be a sub-directory of the path specified in {{ .Values.mountPath }}
|
||||
##
|
||||
bucketRoot: ""
|
||||
|
||||
# Number of drives attached to a node
|
||||
drivesPerNode: 1
|
||||
# Number of MinIO containers running
|
||||
replicas: 16
|
||||
# Number of expanded MinIO clusters
|
||||
pools: 1
|
||||
|
||||
# Deploy if 'mode == gateway' - 4 replicas.
|
||||
gateway:
|
||||
type: "nas" # currently only "nas" are supported.
|
||||
replicas: 4
|
||||
|
||||
## TLS Settings for MinIO
|
||||
tls:
|
||||
enabled: false
|
||||
## Create a secret with private.key and public.crt files and pass that here. Ref: https://github.com/minio/minio/tree/master/docs/tls/kubernetes#2-create-kubernetes-secret
|
||||
certSecret: ""
|
||||
publicCrt: public.crt
|
||||
privateKey: private.key
|
||||
|
||||
## Trusted Certificates Settings for MinIO. Ref: https://docs.minio.io/docs/how-to-secure-access-to-minio-server-with-tls#install-certificates-from-third-party-cas
|
||||
## Bundle multiple trusted certificates into one secret and pass that here. Ref: https://github.com/minio/minio/tree/master/docs/tls/kubernetes#2-create-kubernetes-secret
|
||||
## When using self-signed certificates, remember to include MinIO's own certificate in the bundle with key public.crt.
|
||||
## If certSecret is left empty and tls is enabled, this chart installs the public certificate from .Values.tls.certSecret.
|
||||
trustedCertsSecret: ""
|
||||
|
||||
## Enable persistence using Persistent Volume Claims
|
||||
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
annotations: {}
|
||||
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## Requires persistence.enabled: true
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
existingClaim: ""
|
||||
|
||||
## minio data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
## Storage class of PV to bind. By default it looks for standard storage class.
|
||||
## If the PV uses a different storage class, specify that here.
|
||||
storageClass: ""
|
||||
VolumeName: ""
|
||||
accessMode: ReadWriteOnce
|
||||
size: 500Gi
|
||||
|
||||
## If subPath is set mount a sub folder of a volume instead of the root of the volume.
|
||||
## This is especially handy for volume plugins that don't natively support sub mounting (like glusterfs).
|
||||
##
|
||||
subPath: ""
|
||||
|
||||
## Expose the MinIO service to be accessed from outside the cluster (LoadBalancer service).
|
||||
## or access it from within the cluster (ClusterIP service). Set the service type and the port to serve it.
|
||||
## ref: http://kubernetes.io/docs/user-guide/services/
|
||||
##
|
||||
service:
|
||||
type: ClusterIP
|
||||
clusterIP: ~
|
||||
port: "9000"
|
||||
nodePort: 32000
|
||||
|
||||
## Configure Ingress based on the documentation here: https://kubernetes.io/docs/concepts/services-networking/ingress/
|
||||
##
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
# ingressClassName: ""
|
||||
labels: {}
|
||||
# node-role.kubernetes.io/ingress: platform
|
||||
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
# kubernetes.io/ingress.allow-http: "false"
|
||||
# kubernetes.io/ingress.global-static-ip-name: ""
|
||||
# nginx.ingress.kubernetes.io/secure-backends: "true"
|
||||
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
|
||||
# nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0
|
||||
path: /
|
||||
hosts:
|
||||
- minio-example.local
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
consoleService:
|
||||
type: ClusterIP
|
||||
clusterIP: ~
|
||||
port: "9001"
|
||||
nodePort: 32001
|
||||
|
||||
consoleIngress:
|
||||
enabled: false
|
||||
# ingressClassName: ""
|
||||
labels: {}
|
||||
# node-role.kubernetes.io/ingress: platform
|
||||
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
# kubernetes.io/ingress.allow-http: "false"
|
||||
# kubernetes.io/ingress.global-static-ip-name: ""
|
||||
# nginx.ingress.kubernetes.io/secure-backends: "true"
|
||||
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
|
||||
# nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0
|
||||
path: /
|
||||
hosts:
|
||||
- console.minio-example.local
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
topologySpreadConstraints: []
|
||||
|
||||
## Add stateful containers to have security context, if enabled MinIO will run as this
|
||||
## user and group NOTE: securityContext is only enabled if persistence.enabled=true
|
||||
securityContext:
|
||||
enabled: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
fsGroupChangePolicy: "OnRootMismatch"
|
||||
|
||||
# Additational pod annotations
|
||||
podAnnotations: {}
|
||||
|
||||
# Additional pod labels
|
||||
podLabels: {}
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
requests:
|
||||
memory: 16Gi
|
||||
|
||||
## List of policies to be created after minio install
|
||||
##
|
||||
## In addition to default policies [readonly|readwrite|writeonly|consoleAdmin|diagnostics]
|
||||
## you can define additional policies with custom supported actions and resources
|
||||
policies: []
|
||||
## writeexamplepolicy policy grants creation or deletion of buckets with name
|
||||
## starting with example. In addition, grants objects write permissions on buckets starting with
|
||||
## example.
|
||||
# - name: writeexamplepolicy
|
||||
# statements:
|
||||
# - resources:
|
||||
# - 'arn:aws:s3:::example*/*'
|
||||
# actions:
|
||||
# - "s3:AbortMultipartUpload"
|
||||
# - "s3:GetObject"
|
||||
# - "s3:DeleteObject"
|
||||
# - "s3:PutObject"
|
||||
# - "s3:ListMultipartUploadParts"
|
||||
# - resources:
|
||||
# - 'arn:aws:s3:::example*'
|
||||
# actions:
|
||||
# - "s3:CreateBucket"
|
||||
# - "s3:DeleteBucket"
|
||||
# - "s3:GetBucketLocation"
|
||||
# - "s3:ListBucket"
|
||||
# - "s3:ListBucketMultipartUploads"
|
||||
## readonlyexamplepolicy policy grants access to buckets with name starting with example.
|
||||
## In addition, grants objects read permissions on buckets starting with example.
|
||||
# - name: readonlyexamplepolicy
|
||||
# statements:
|
||||
# - resources:
|
||||
# - 'arn:aws:s3:::example*/*'
|
||||
# actions:
|
||||
# - "s3:GetObject"
|
||||
# - resources:
|
||||
# - 'arn:aws:s3:::example*'
|
||||
# actions:
|
||||
# - "s3:GetBucketLocation"
|
||||
# - "s3:ListBucket"
|
||||
# - "s3:ListBucketMultipartUploads"
|
||||
## conditionsexample policy creates all access to example bucket with aws:username="johndoe" and source ip range 10.0.0.0/8 and 192.168.0.0/24 only
|
||||
# - name: conditionsexample
|
||||
# statements:
|
||||
# - resources:
|
||||
# - 'arn:aws:s3:::example/*'
|
||||
# actions:
|
||||
# - 's3:*'
|
||||
# conditions:
|
||||
# - StringEquals: '"aws:username": "johndoe"'
|
||||
# - IpAddress: |
|
||||
# "aws:SourceIp": [
|
||||
# "10.0.0.0/8",
|
||||
# "192.168.0.0/24"
|
||||
# ]
|
||||
#
|
||||
## Additional Annotations for the Kubernetes Job makePolicyJob
|
||||
makePolicyJob:
|
||||
podAnnotations: {}
|
||||
annotations: {}
|
||||
securityContext:
|
||||
enabled: false
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
resources:
|
||||
requests:
|
||||
memory: 128Mi
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
extraVolumes: []
|
||||
extraVolumeMounts: []
|
||||
# Command to run after the main command on exit
|
||||
exitCommand: ""
|
||||
|
||||
## List of users to be created after minio install
|
||||
##
|
||||
users:
|
||||
## Username, password and policy to be assigned to the user
|
||||
## Default policies are [readonly|readwrite|writeonly|consoleAdmin|diagnostics]
|
||||
## Add new policies as explained here https://docs.min.io/docs/minio-multi-user-quickstart-guide.html
|
||||
## NOTE: this will fail if LDAP is enabled in your MinIO deployment
|
||||
## make sure to disable this if you are using LDAP.
|
||||
- accessKey: console
|
||||
secretKey: console123
|
||||
policy: consoleAdmin
|
||||
# Or you can refer to specific secret
|
||||
#- accessKey: externalSecret
|
||||
# existingSecret: my-secret
|
||||
# existingSecretKey: password
|
||||
# policy: readonly
|
||||
|
||||
|
||||
## Additional Annotations for the Kubernetes Job makeUserJob
|
||||
makeUserJob:
|
||||
podAnnotations: {}
|
||||
annotations: {}
|
||||
securityContext:
|
||||
enabled: false
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
resources:
|
||||
requests:
|
||||
memory: 128Mi
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
extraVolumes: []
|
||||
extraVolumeMounts: []
|
||||
# Command to run after the main command on exit
|
||||
exitCommand: ""
|
||||
|
||||
## List of buckets to be created after minio install
|
||||
##
|
||||
buckets:
|
||||
# # Name of the bucket
|
||||
# - name: bucket1
|
||||
# # Policy to be set on the
|
||||
# # bucket [none|download|upload|public]
|
||||
# policy: none
|
||||
# # Purge if bucket exists already
|
||||
# purge: false
|
||||
# # set versioning for
|
||||
# # bucket [true|false]
|
||||
# versioning: false
|
||||
# # set objectlocking for
|
||||
# # bucket [true|false] NOTE: versioning is enabled by default if you use locking
|
||||
# objectlocking: false
|
||||
# - name: bucket2
|
||||
# policy: none
|
||||
# purge: false
|
||||
# versioning: true
|
||||
# # set objectlocking for
|
||||
# # bucket [true|false] NOTE: versioning is enabled by default if you use locking
|
||||
# objectlocking: false
|
||||
|
||||
## Additional Annotations for the Kubernetes Job makeBucketJob
|
||||
makeBucketJob:
|
||||
podAnnotations: {}
|
||||
annotations: {}
|
||||
securityContext:
|
||||
enabled: false
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
resources:
|
||||
requests:
|
||||
memory: 128Mi
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
extraVolumes: []
|
||||
extraVolumeMounts: []
|
||||
# Command to run after the main command on exit
|
||||
exitCommand: ""
|
||||
|
||||
## List of command to run after minio install
|
||||
## NOTE: the mc command TARGET is always "myminio"
|
||||
customCommands:
|
||||
# - command: "admin policy set myminio consoleAdmin group='cn=ops,cn=groups,dc=example,dc=com'"
|
||||
|
||||
## Additional Annotations for the Kubernetes Job customCommandJob
|
||||
customCommandJob:
|
||||
podAnnotations: {}
|
||||
annotations: {}
|
||||
securityContext:
|
||||
enabled: false
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
resources:
|
||||
requests:
|
||||
memory: 128Mi
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
# Command to run after the main command on exit
|
||||
exitCommand: ""
|
||||
|
||||
## Use this field to add environment variables relevant to MinIO server. These fields will be passed on to MinIO container(s)
|
||||
## when Chart is deployed
|
||||
environment:
|
||||
## Please refer for comprehensive list https://docs.min.io/minio/baremetal/reference/minio-server/minio-server.html
|
||||
## MINIO_SUBNET_LICENSE: "License key obtained from https://subnet.min.io"
|
||||
## MINIO_BROWSER: "off"
|
||||
|
||||
## The name of a secret in the same kubernetes namespace which contain secret values
|
||||
## This can be useful for LDAP password, etc
|
||||
## The key in the secret must be 'config.env'
|
||||
##
|
||||
# extraSecret: minio-extraenv
|
||||
|
||||
## OpenID Identity Management
|
||||
## The following section documents environment variables for enabling external identity management using an OpenID Connect (OIDC)-compatible provider.
|
||||
## See https://docs.min.io/minio/baremetal/security/openid-external-identity-management/external-authentication-with-openid-identity-provider.html#minio-external-identity-management-openid for a tutorial on using these variables.
|
||||
oidc:
|
||||
enabled: false
|
||||
configUrl: "https://identity-provider-url/.well-known/openid-configuration"
|
||||
clientId: "minio"
|
||||
clientSecret: ""
|
||||
claimName: "policy"
|
||||
scopes: "openid,profile,email"
|
||||
redirectUri: "https://console-endpoint-url/oauth_callback"
|
||||
# Can leave empty
|
||||
claimPrefix: ""
|
||||
comment: ""
|
||||
|
||||
networkPolicy:
|
||||
enabled: false
|
||||
allowExternal: true
|
||||
|
||||
## PodDisruptionBudget settings
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
|
||||
##
|
||||
podDisruptionBudget:
|
||||
enabled: false
|
||||
maxUnavailable: 1
|
||||
|
||||
## Specify the service account to use for the MinIO pods. If 'create' is set to 'false'
|
||||
## and 'name' is left unspecified, the account 'default' will be used.
|
||||
serviceAccount:
|
||||
create: true
|
||||
## The name of the service account to use. If 'create' is 'true', a service account with that name
|
||||
## will be created.
|
||||
name: "minio-sa"
|
||||
|
||||
metrics:
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
# scrape each node/pod individually for additional metrics
|
||||
includeNode: false
|
||||
public: true
|
||||
additionalLabels: {}
|
||||
# for node metrics
|
||||
relabelConfigs: {}
|
||||
# for cluster metrics
|
||||
relabelConfigsCluster: {}
|
||||
# metricRelabelings:
|
||||
# - regex: (server|pod)
|
||||
# action: labeldrop
|
||||
# namespace: monitoring
|
||||
# interval: 30s
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ETCD settings: https://github.com/minio/minio/blob/master/docs/sts/etcd.md
|
||||
## Define endpoints to enable this section.
|
||||
etcd:
|
||||
endpoints: []
|
||||
pathPrefix: ""
|
||||
corednsPathPrefix: ""
|
||||
clientCert: ""
|
||||
clientCertKey: ""
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
## Introduction
|
||||
The Helm Charts found under the examples directory are getting started examples which you can use to deploy Loki using the Simple Scalable architecture quickly. Currently, the examples include:
|
||||
- [Deploying Grafana Enterprise Logs (Loki in Enterprise mode)](https://github.com/grafana/loki/tree/main/production/helm/loki/docs/examples/enterprise)
|
||||
- [Deploying Loki OSS](https://github.com/grafana/loki/tree/main/production/helm/loki/docs/examples/oss)
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
## Introduction
|
||||
This example gives you an example or getting started overrides value file for deploying Loki (Enterprise Licensed) using the Simple Scalable architecture in GKE and using GCS.
|
||||
|
||||
## Installation of Helm Chart
|
||||
These instructions assume you already have access to a Kubernetes cluster, GCS Bucket and GCP Service Account which has read/write permissions to that GCS Bucket.
|
||||
|
||||
### Populate Secret Values
|
||||
Populate the [enterprise-secrets.yaml](./enterprise-secrets.yaml) so that:
|
||||
- The `gcp_service_account.json` secret has the contents of your GCP Service Account JSON key.
|
||||
- The `license.jwt` secret has the contents of your Grafana Enterprise Logs license key given to your by Grafana Labs.
|
||||
|
||||
Deploy the secrets file to your k8s cluster with the command:
|
||||
|
||||
`kubectl apply -f enterprise-secrets.yaml`
|
||||
|
||||
### Configure the Helm Chart
|
||||
Open [overrides-enterprise-gcs.yaml](./overrides-enterprise-gcs.yaml) and replace `{YOUR_GCS_BUCKET}` with the name of your GCS bucket. If there are other things you'd like to configure, view the core [Values.yaml file](https://github.com/grafana/helm-charts/blob/main/charts/loki-simple-scalable/values.yaml) and override anything else you need to within the overrides-enterprise-gcs.yaml file.
|
||||
|
||||
### Install the Helm chart
|
||||
|
||||
`helm upgrade --install --values {PATH_TO_YOUR_OVERRIDES_YAML_FILE} {YOUR_RELEASE_NAME} grafana/loki-simple-scalable --namespace {KUBERNETES_NAMESPACE}`
|
||||
|
||||
### Get the Token for Grafana to connect
|
||||
`export POD_NAME=$(kubectl get pods --namespace {KUBERNETES_NAMESPACE} -l "job-name=enterprise-logs-tokengen" -o jsonpath="{.items[0].metadata.name}")`
|
||||
|
||||
`kubectl --namespace {KUBERNETES_NAMESPACE} logs $POD_NAME loki | grep Token`
|
||||
|
||||
Take note of this token, you will need it when connecting Grafana Enterprise Logs to Grafana.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: gel-secrets
|
||||
type: Opaque
|
||||
stringData:
|
||||
gcp_service_account.json: |
|
||||
{
|
||||
GCP_SERVICE_ACCOUNT_JSON_HERE
|
||||
}
|
||||
|
||||
license.jwt: LICENSE_HERE
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
enterprise:
|
||||
enabled: true
|
||||
useExternalLicense: true
|
||||
externalLicenseName: gel-secrets
|
||||
tokengen:
|
||||
env:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/gel_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: gel-secrets
|
||||
mountPath: "/etc/gel_secrets"
|
||||
extraVolumes:
|
||||
- name: gel-secrets
|
||||
secret:
|
||||
secretName: gel-secrets
|
||||
items:
|
||||
- key: license.jwt
|
||||
path: license.jwt
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
loki:
|
||||
auth_enabled: true
|
||||
|
||||
storage:
|
||||
type: gcs
|
||||
bucketNames:
|
||||
chunks: {YOUR_GCS_BUCKET}
|
||||
ruler: {YOUR_GCS_BUCKET}
|
||||
admin: {YOUR_GCS_BUCKET}
|
||||
|
||||
minio:
|
||||
enabled: false
|
||||
|
||||
write:
|
||||
extraEnv:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/gel_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: gel-secrets
|
||||
mountPath: "/etc/gel_secrets"
|
||||
extraVolumes:
|
||||
- name: gel-secrets
|
||||
secret:
|
||||
secretName: gel-secrets
|
||||
items:
|
||||
- key: license.jwt
|
||||
path: license.jwt
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
|
||||
read:
|
||||
extraEnv:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/gel_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: gel-secrets
|
||||
mountPath: "/etc/gel_secrets"
|
||||
extraVolumes:
|
||||
- name: gel-secrets
|
||||
secret:
|
||||
secretName: gel-secrets
|
||||
items:
|
||||
- key: license.jwt
|
||||
path: license.jwt
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
|
||||
gateway:
|
||||
extraEnv:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/gel_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: gel-secrets
|
||||
mountPath: "/etc/gel_secrets"
|
||||
extraVolumes:
|
||||
- name: gel-secrets
|
||||
secret:
|
||||
secretName: gel-secrets
|
||||
items:
|
||||
- key: license.jwt
|
||||
path: license.jwt
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
## Introduction
|
||||
This example gives you an example or getting started overrides value file for deploying Loki (OSS) using the Simple Scalable architecture in GKE and using GCS
|
||||
|
||||
## Installation of Helm Chart
|
||||
These instructions assume you have already have access to a Kubernetes cluster, GCS Bucket and GCP Service Account which has read/write permissions to that GCS Bucket.
|
||||
|
||||
### Populate Secret Values
|
||||
Populate the examples/enterprise/enterprise-secrets.yaml so that:
|
||||
- The gcp_service_account.json secret has the contents of your GCP Service Account JSON key
|
||||
|
||||
Deploy the secrets file to your k8s cluster.
|
||||
|
||||
`kubectl apply -f loki-secrets.yaml`
|
||||
|
||||
### Configure the Helm Chart
|
||||
Open examples/enterprise/overides-oss-gcs.yaml and replace `{YOUR_GCS_BUCKET}` with the name of your GCS bucket. If there are other things you'd like to configure, view the core [Values.yaml file](https://github.com/grafana/helm-charts/blob/main/charts/loki-simple-scalable/values.yaml) and override anything else you need to within the overrides-enterprise-gcs.yaml file.
|
||||
|
||||
### Install the Helm chart
|
||||
|
||||
`helm upgrade --install --values {PATH_TO_YOUR_OVERRIDES_YAML_FILE} {YOUR_RELEASE_NAME} grafana/loki-simple-scalable --namespace {KUBERNETES_NAMESPACE}`
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: loki-secrets
|
||||
type: Opaque
|
||||
stringData:
|
||||
gcp_service_account.json: |
|
||||
{
|
||||
GCP_SERVICE_ACCOUNT_JSON_HERE
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
enterprise:
|
||||
enabled: false
|
||||
adminApi:
|
||||
enabled: false
|
||||
useExternalLicense: false
|
||||
|
||||
config: |
|
||||
admin_client:
|
||||
storage:
|
||||
gcs:
|
||||
bucket_name: {YOUR_GCS_BUCKET}
|
||||
auth:
|
||||
type: trust
|
||||
auth_enabled: false
|
||||
cluster_name: loki-logs
|
||||
|
||||
loki:
|
||||
auth_enabled: false
|
||||
|
||||
commonConfig:
|
||||
path_prefix: /var/loki
|
||||
replication_factor: 3
|
||||
|
||||
storage:
|
||||
type: gcs
|
||||
bucketNames:
|
||||
chunks: {YOUR_GCS_BUCKET}
|
||||
ruler: {YOUR_GCS_BUCKET}
|
||||
admin: {YOUR_GCS_BUCKET}
|
||||
|
||||
minio:
|
||||
enabled: false
|
||||
|
||||
write:
|
||||
extraEnv:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/loki_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: loki-secrets
|
||||
mountPath: "/etc/loki_secrets"
|
||||
extraVolumes:
|
||||
- name: loki-secrets
|
||||
secret:
|
||||
secretName: loki-secrets
|
||||
items:
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
|
||||
read:
|
||||
extraEnv:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/loki_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: loki-secrets
|
||||
mountPath: "/etc/loki_secrets"
|
||||
extraVolumes:
|
||||
- name: loki-secrets
|
||||
secret:
|
||||
secretName: loki-secrets
|
||||
items:
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
|
||||
gateway:
|
||||
extraEnv:
|
||||
- name: GOOGLE_APPLICATION_CREDENTIALS
|
||||
value: "/etc/loki_secrets/gcp_service_account.json"
|
||||
extraVolumeMounts:
|
||||
- name: loki-secrets
|
||||
mountPath: "/etc/loki_secrets"
|
||||
extraVolumes:
|
||||
- name: loki-secrets
|
||||
secret:
|
||||
secretName: loki-secrets
|
||||
items:
|
||||
- key: gcp_service_account.json
|
||||
path: gcp_service_account.json
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
title: Helm Chart Values
|
||||
menuTitle: Helm chart values
|
||||
description: Reference for Helm Chart values.
|
||||
aliases:
|
||||
- ../../../installation/helm/reference/
|
||||
weight: 500
|
||||
keywords: []
|
||||
---
|
||||
|
||||
<!-- Autogenerated. Modify ../production/helm/loki/reference.md.gotmpl -->
|
||||
|
||||
# Helm Chart Values
|
||||
<!-- vale Grafana.Quotes = NO -->
|
||||
<!-- The reference title is required. Use a noun-based title. -->
|
||||
<!-- vale Grafana.Quotes = YES -->
|
||||
|
||||
This is the generated reference for the Loki Helm Chart values.
|
||||
|
||||
> **Note:** This reference is for the Loki Helm chart version 3.0 or greater.
|
||||
> If you are using the `grafana/loki-stack` Helm chart from the community repo,
|
||||
> please refer to the `values.yaml` of the respective Github repository
|
||||
> [grafana/helm-charts](https://github.com/grafana/helm-charts/tree/main/charts/loki-stack).
|
||||
|
||||
<!-- Override default values table from helm-docs. See https://github.com/norwoodj/helm-docs/tree/master#advanced-table-rendering -->
|
||||
{{ define "chart.valuesTableHtml" }}
|
||||
{{ `{{< responsive-table >}}` }}
|
||||
<table>
|
||||
<thead>
|
||||
<th>Key</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Default</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{- range .Values }}
|
||||
<tr>
|
||||
<td>{{ .Key }}</td>
|
||||
<td>{{ .Type }}</td>
|
||||
<td>{{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }}</td>
|
||||
<td>{{ template "chart.valueDefaultColumnRender" . }}</td>
|
||||
</tr>
|
||||
{{- end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ `{{< /responsive-table >}}` }}
|
||||
{{ end }}
|
||||
|
||||
{{ template "chart.valuesTableHtml" . }}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
rules:
|
||||
quoted-strings:
|
||||
required: true
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
groups:
|
||||
- name: "loki_alerts"
|
||||
rules:
|
||||
{{- if not (.Values.monitoring.rules.disabled.LokiRequestErrors | default false) }}
|
||||
- alert: "LokiRequestErrors"
|
||||
annotations:
|
||||
message: |
|
||||
{{`{{`}} $labels.job {{`}}`}} {{`{{`}} $labels.route {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}% errors.
|
||||
expr: |
|
||||
100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[2m])) by (namespace, job, route)
|
||||
/
|
||||
sum(rate(loki_request_duration_seconds_count[2m])) by (namespace, job, route)
|
||||
> 10
|
||||
for: "15m"
|
||||
labels:
|
||||
severity: "critical"
|
||||
{{- if .Values.monitoring.rules.additionalRuleLabels }}
|
||||
{{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not (.Values.monitoring.rules.disabled.LokiRequestPanics | default false) }}
|
||||
- alert: "LokiRequestPanics"
|
||||
annotations:
|
||||
message: |
|
||||
{{`{{`}} $labels.job {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}% increase of panics.
|
||||
expr: |
|
||||
sum(increase(loki_panic_total[10m])) by (namespace, job) > 0
|
||||
labels:
|
||||
severity: "critical"
|
||||
{{- if .Values.monitoring.rules.additionalRuleLabels }}
|
||||
{{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not (.Values.monitoring.rules.disabled.LokiRequestLatency | default false) }}
|
||||
- alert: "LokiRequestLatency"
|
||||
annotations:
|
||||
message: |
|
||||
{{`{{`}} $labels.job {{`}}`}} {{`{{`}} $labels.route {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}s 99th percentile latency.
|
||||
expr: |
|
||||
namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*"} > 1
|
||||
for: "15m"
|
||||
labels:
|
||||
severity: "critical"
|
||||
{{- if .Values.monitoring.rules.additionalRuleLabels }}
|
||||
{{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not (.Values.monitoring.rules.disabled.LokiTooManyCompactorsRunning | default false) }}
|
||||
- alert: "LokiTooManyCompactorsRunning"
|
||||
annotations:
|
||||
message: |
|
||||
{{`{{`}} $labels.cluster {{`}}`}} {{`{{`}} $labels.namespace {{`}}`}} has had {{`{{`}} printf "%.0f" $value {{`}}`}} compactors running for more than 5m. Only one compactor should run at a time.
|
||||
expr: |
|
||||
sum(loki_boltdb_shipper_compactor_running) by (namespace, cluster) > 1
|
||||
for: "5m"
|
||||
labels:
|
||||
severity: "warning"
|
||||
{{- if .Values.monitoring.rules.additionalRuleLabels }}
|
||||
{{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not (.Values.monitoring.rules.disabled.LokiCanaryLatency | default false) }}
|
||||
- name: "loki_canaries_alerts"
|
||||
rules:
|
||||
- alert: "LokiCanaryLatency"
|
||||
annotations:
|
||||
message: |
|
||||
{{`{{`}} $labels.job {{`}}`}} is experiencing {{`{{`}} printf "%.2f" $value {{`}}`}}s 99th percentile latency.
|
||||
expr: |
|
||||
histogram_quantile(0.99, sum(rate(loki_canary_response_latency_seconds_bucket[5m])) by (le, namespace, job)) > 5
|
||||
for: "15m"
|
||||
labels:
|
||||
severity: "warning"
|
||||
{{- if .Values.monitoring.rules.additionalRuleLabels }}
|
||||
{{ toYaml .Values.monitoring.rules.additionalRuleLabels | indent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,632 @@
|
|||
{
|
||||
"annotations": {
|
||||
"list": [ ]
|
||||
},
|
||||
"editable": true,
|
||||
"gnetId": null,
|
||||
"graphTooltip": 0,
|
||||
"hideControls": false,
|
||||
"links": [
|
||||
{
|
||||
"asDropdown": true,
|
||||
"icon": "external link",
|
||||
"includeVars": true,
|
||||
"keepTime": true,
|
||||
"tags": [
|
||||
"loki"
|
||||
],
|
||||
"targetBlank": false,
|
||||
"title": "Loki Dashboards",
|
||||
"type": "dashboards"
|
||||
}
|
||||
],
|
||||
"refresh": "10s",
|
||||
"rows": [
|
||||
{
|
||||
"collapse": false,
|
||||
"height": "100px",
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": { },
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "$datasource",
|
||||
"fill": 1,
|
||||
"format": "none",
|
||||
"id": 1,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"links": [ ],
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [ ],
|
||||
"spaceLength": 10,
|
||||
"span": 6,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "sum(loki_compactor_pending_delete_requests_count{cluster=~\"$cluster\", namespace=~\"$namespace\"})",
|
||||
"format": "time_series",
|
||||
"instant": true,
|
||||
"intervalFactor": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"thresholds": "70,80",
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Number of Pending Requests",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "singlestat",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": [ ]
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"aliasColors": { },
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "$datasource",
|
||||
"fill": 1,
|
||||
"format": "dtdurations",
|
||||
"id": 2,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"links": [ ],
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [ ],
|
||||
"spaceLength": 10,
|
||||
"span": 6,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "max(loki_compactor_oldest_pending_delete_request_age_seconds{cluster=~\"$cluster\", namespace=~\"$namespace\"})",
|
||||
"format": "time_series",
|
||||
"instant": true,
|
||||
"intervalFactor": 2,
|
||||
"refId": "A"
|
||||
}
|
||||
],
|
||||
"thresholds": "70,80",
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Oldest Pending Request Age",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "singlestat",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": [ ]
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repeat": null,
|
||||
"repeatIteration": null,
|
||||
"repeatRowId": null,
|
||||
"showTitle": false,
|
||||
"title": "Headlines",
|
||||
"titleSize": "h6"
|
||||
},
|
||||
{
|
||||
"collapse": false,
|
||||
"height": "250px",
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": { },
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "$datasource",
|
||||
"fill": 1,
|
||||
"id": 3,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"links": [ ],
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [ ],
|
||||
"spaceLength": 10,
|
||||
"span": 6,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "sum(increase(loki_compactor_delete_requests_received_total{cluster=~\"$cluster\", namespace=~\"$namespace\"}[1d]))",
|
||||
"format": "time_series",
|
||||
"intervalFactor": 2,
|
||||
"legendFormat": "received",
|
||||
"legendLink": null,
|
||||
"step": 10
|
||||
}
|
||||
],
|
||||
"thresholds": [ ],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Delete Requests Received / Day",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": [ ]
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"aliasColors": { },
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "$datasource",
|
||||
"fill": 1,
|
||||
"id": 4,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"links": [ ],
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [ ],
|
||||
"spaceLength": 10,
|
||||
"span": 6,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "sum(increase(loki_compactor_delete_requests_processed_total{cluster=~\"$cluster\", namespace=~\"$namespace\"}[1d]))",
|
||||
"format": "time_series",
|
||||
"intervalFactor": 2,
|
||||
"legendFormat": "processed",
|
||||
"legendLink": null,
|
||||
"step": 10
|
||||
}
|
||||
],
|
||||
"thresholds": [ ],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Delete Requests Processed / Day",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": [ ]
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repeat": null,
|
||||
"repeatIteration": null,
|
||||
"repeatRowId": null,
|
||||
"showTitle": true,
|
||||
"title": "Churn",
|
||||
"titleSize": "h6"
|
||||
},
|
||||
{
|
||||
"collapse": false,
|
||||
"height": "250px",
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": { },
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "$datasource",
|
||||
"fill": 1,
|
||||
"id": 5,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"links": [ ],
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [ ],
|
||||
"spaceLength": 10,
|
||||
"span": 12,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "sum(increase(loki_compactor_load_pending_requests_attempts_total{status=\"fail\", cluster=~\"$cluster\", namespace=~\"$namespace\"}[1h]))",
|
||||
"format": "time_series",
|
||||
"intervalFactor": 2,
|
||||
"legendFormat": "failures",
|
||||
"legendLink": null,
|
||||
"step": 10
|
||||
}
|
||||
],
|
||||
"thresholds": [ ],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Failures in Loading Delete Requests / Hour",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": [ ]
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repeat": null,
|
||||
"repeatIteration": null,
|
||||
"repeatRowId": null,
|
||||
"showTitle": true,
|
||||
"title": "Failures",
|
||||
"titleSize": "h6"
|
||||
},
|
||||
{
|
||||
"collapse": false,
|
||||
"height": "250px",
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": { },
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "$datasource",
|
||||
"fill": 1,
|
||||
"id": 6,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"links": [ ],
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [ ],
|
||||
"spaceLength": 10,
|
||||
"span": 12,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"expr": "sum(rate(loki_compactor_deleted_lines{cluster=~\"$cluster\",job=~\"$namespace/(loki|enterprise-logs)-read\"}[$__rate_interval])) by (user)",
|
||||
"format": "time_series",
|
||||
"intervalFactor": 2,
|
||||
"legendFormat": "{{user}}",
|
||||
"legendLink": null,
|
||||
"step": 10
|
||||
}
|
||||
],
|
||||
"thresholds": [ ],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Lines Deleted / Sec",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 2,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": [ ]
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repeat": null,
|
||||
"repeatIteration": null,
|
||||
"repeatRowId": null,
|
||||
"showTitle": true,
|
||||
"title": "Deleted lines",
|
||||
"titleSize": "h6"
|
||||
}
|
||||
],
|
||||
"schemaVersion": 14,
|
||||
"style": "dark",
|
||||
"tags": [
|
||||
"loki"
|
||||
],
|
||||
"templating": {
|
||||
"list": [
|
||||
{
|
||||
"current": {
|
||||
"text": "default",
|
||||
"value": "default"
|
||||
},
|
||||
"hide": 0,
|
||||
"label": "Data Source",
|
||||
"name": "datasource",
|
||||
"options": [ ],
|
||||
"query": "prometheus",
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"type": "datasource"
|
||||
},
|
||||
{
|
||||
"allValue": null,
|
||||
"current": {
|
||||
"text": "prod",
|
||||
"value": "prod"
|
||||
},
|
||||
"datasource": "$datasource",
|
||||
"hide": 0,
|
||||
"includeAll": false,
|
||||
"label": "cluster",
|
||||
"multi": false,
|
||||
"name": "cluster",
|
||||
"options": [ ],
|
||||
"query": "label_values(loki_build_info, cluster)",
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"sort": 2,
|
||||
"tagValuesQuery": "",
|
||||
"tags": [ ],
|
||||
"tagsQuery": "",
|
||||
"type": "query",
|
||||
"useTags": false
|
||||
},
|
||||
{
|
||||
"allValue": null,
|
||||
"current": {
|
||||
"text": "prod",
|
||||
"value": "prod"
|
||||
},
|
||||
"datasource": "$datasource",
|
||||
"hide": 0,
|
||||
"includeAll": false,
|
||||
"label": "namespace",
|
||||
"multi": false,
|
||||
"name": "namespace",
|
||||
"options": [ ],
|
||||
"query": "label_values(loki_build_info{cluster=~\"$cluster\"}, namespace)",
|
||||
"refresh": 1,
|
||||
"regex": "",
|
||||
"sort": 2,
|
||||
"tagValuesQuery": "",
|
||||
"tags": [ ],
|
||||
"tagsQuery": "",
|
||||
"type": "query",
|
||||
"useTags": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"time": {
|
||||
"from": "now-1h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"refresh_intervals": [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
],
|
||||
"time_options": [
|
||||
"5m",
|
||||
"15m",
|
||||
"1h",
|
||||
"6h",
|
||||
"12h",
|
||||
"24h",
|
||||
"2d",
|
||||
"7d",
|
||||
"30d"
|
||||
]
|
||||
},
|
||||
"timezone": "utc",
|
||||
"title": "Loki / Deletion",
|
||||
"uid": "deletion",
|
||||
"version": 0
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue