Skip to content

Commit 9ffc6aa

Browse files
tamalsahaEmruz Hossain
andauthored
Add stash-metrics chart (#202)
* Add stash-metrics chart Signed-off-by: Tamal Saha <tamal@appscode.com> * Update metricsconfig-backupconfiguration.yaml Signed-off-by: Tamal Saha <tamal@appscode.com> Co-authored-by: Emruz Hossain <emruz@appscode.com>
1 parent 0610818 commit 9ffc6aa

17 files changed

+658
-3
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ jobs:
4040
run: |
4141
make ci
4242
43+
- name: Check metrics configuration
44+
run: |
45+
# install metrics-configuration-checker
46+
curl -fsSL -o metrics-configuration-checker https://github.com/kmodules/metrics-configuration-checker/releases/download/v0.0.1/metrics-configuration-checker-linux-amd64
47+
chmod +x metrics-configuration-checker
48+
sudo mv metrics-configuration-checker /usr/local/bin/metrics-configuration-checker
49+
# check stash-metrics chart
50+
metrics-configuration-checker --content=./charts/stash-metrics/templates/
51+
4352
kubernetes:
4453
name: Kubernetes
4554
runs-on: ubuntu-latest

charts/stash-crds/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Get the KubeDB crds by running the following command:
1+
Get the Stash crds by running the following command:
22

33
kubectl get crds --selector=app.kubernetes.io/name=stash

charts/stash-metrics/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/stash-metrics/Chart.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v2
2+
name: stash-metrics
3+
description: Stash State Metrics
4+
type: application
5+
version: v2021.08.02
6+
appVersion: v2021.08.02
7+
home: https://stash.run
8+
icon: https://cdn.appscode.com/images/products/stash/stash-community-icon.png
9+
sources:
10+
- https://github.com/stashed
11+
maintainers:
12+
- name: appscode
13+
email: support@appscode.com

charts/stash-metrics/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Stash Metrics
2+
3+
[Stash Metrics](https://github.com/stashed) - Stash State Metrics
4+
5+
## TL;DR;
6+
7+
```console
8+
$ helm repo add appscode https://charts.appscode.com/stable/
9+
$ helm repo update
10+
$ helm install stash-metrics appscode/stash-metrics -n kube-system
11+
```
12+
13+
## Introduction
14+
15+
This chart deploys Stash metrics configurations on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
16+
17+
## Prerequisites
18+
19+
- Kubernetes 1.16+
20+
21+
## Installing the Chart
22+
23+
To install the chart with the release name `stash-metrics`:
24+
25+
```console
26+
$ helm install stash-metrics appscode/stash-metrics -n kube-system
27+
```
28+
29+
The command deploys Stash metrics configurations on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
30+
31+
> **Tip**: List all releases using `helm list`
32+
33+
## Uninstalling the Chart
34+
35+
To uninstall/delete the `stash-metrics`:
36+
37+
```console
38+
$ helm delete stash-metrics -n kube-system
39+
```
40+
41+
The command removes all the Kubernetes components associated with the chart and deletes the release.
42+
43+

charts/stash-metrics/crds/metrics.appscode.com_metricsconfigurations.yaml

Lines changed: 338 additions & 0 deletions
Large diffs are not rendered by default.

charts/stash-metrics/doc.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
project:
2+
name: Stash Metrics
3+
shortName: Stash Metrics
4+
url: https://github.com/stashed
5+
description: Stash State Metrics
6+
app: Stash metrics configurations
7+
repository:
8+
url: https://charts.appscode.com/stable/
9+
name: appscode
10+
chart:
11+
name: stash-metrics
12+
values: -- generate from values file --
13+
valuesExample: -- generate from values file --
14+
prerequisites:
15+
- Kubernetes 1.16+
16+
release:
17+
name: stash-metrics
18+
namespace: kube-system
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Get the Stash crds by running the following command:
2+
3+
kubectl get crds --selector=app.kubernetes.io/name=stash
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: appscode:metrics:edit
5+
labels:
6+
rbac.authorization.k8s.io/aggregate-to-admin: "true"
7+
rbac.authorization.k8s.io/aggregate-to-edit: "true"
8+
annotations:
9+
"helm.sh/hook": pre-install,pre-upgrade
10+
"helm.sh/hook-delete-policy": before-hook-creation
11+
rules:
12+
- apiGroups:
13+
- metrics.appscode.com
14+
resources:
15+
- "*"
16+
verbs: ["*"]
17+
---
18+
kind: ClusterRole
19+
apiVersion: rbac.authorization.k8s.io/v1
20+
metadata:
21+
name: appscode:metrics:view
22+
labels:
23+
rbac.authorization.k8s.io/aggregate-to-view: "true"
24+
annotations:
25+
"helm.sh/hook": pre-install,pre-upgrade
26+
"helm.sh/hook-delete-policy": before-hook-creation
27+
rules:
28+
- apiGroups:
29+
- metrics.appscode.com
30+
resources:
31+
- "*"
32+
verbs: ["get", "list", "watch"]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
apiVersion: metrics.appscode.com/v1alpha1
2+
kind: MetricsConfiguration
3+
metadata:
4+
name: stash-appscode-com-backupconfiguration
5+
spec:
6+
targetRef:
7+
apiVersion: stash.appscode.com/v1beta1
8+
kind: BackupConfiguration
9+
metrics:
10+
- name: stash_backupconfiguration_created
11+
help: "Unix creation timestamp of this BackupConfiguration object"
12+
type: gauge
13+
field:
14+
path: .metadata.creationTimestamp
15+
type: DateTime
16+
metricValue:
17+
valueFromPath: .metadata.creationTimestamp
18+
- name: stash_backupconfiguration_info
19+
help: "General information about this BackupConfiguration"
20+
type: gauge
21+
labels:
22+
- key: driver
23+
valuePath: .spec.driver
24+
- key: repository
25+
valuePath: .spec.repository.name
26+
- key: schedule
27+
valuePath: .spec.schedule
28+
- key: target_api_version
29+
valuePath: .spec.target.ref.apiVersion
30+
- key: target_kind
31+
valuePath: .spec.target.ref.kind
32+
- key: target_name
33+
valuePath: .spec.target.ref.name
34+
- key: invoker_kind
35+
value: "BackupConfiguration"
36+
- key: invoker_name
37+
valuePath: .metadata.name
38+
metricValue:
39+
value: 1
40+
- name: stash_backupconfiguration_conditions
41+
help: "Current conditions of this BackupConfiguration"
42+
type: gauge
43+
field:
44+
path: .status.conditions
45+
type: Array
46+
labels:
47+
- key: invoker_kind
48+
value: "BackupConfiguration"
49+
- key: invoker_name
50+
valuePath: .metadata.name
51+
- key: condition
52+
valuePath: .status.conditions[*].type
53+
- key: status
54+
valuePath: .status.conditions[*].status
55+
metricValue:
56+
value: 1

0 commit comments

Comments
 (0)