Skip to content

Commit

Permalink
feat: add serviceMonitor to as212510-net
Browse files Browse the repository at this point in the history
  • Loading branch information
M0NsTeRRR committed Jan 11, 2024
1 parent d37da97 commit 354bd72
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 32 deletions.
11 changes: 3 additions & 8 deletions charts/as212510-net/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ apiVersion: v2
name: as212510-net
description: as212510.net helm chart for Kubernetes
type: application
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "2.0.0"
version: 0.3.0
appVersion: "2.1.0"
sources:
- https://github.com/M0NsTeRRR/helm-charts/charts/as212510-net
- https://github.com/M0NsTeRRR/helm-charts/tree/main/charts/as212510-net
home: https://github.com/M0NsTeRRR/as212510.net
34 changes: 24 additions & 10 deletions charts/as212510-net/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
# as212510-net

![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.1.0](https://img.shields.io/badge/AppVersion-2.1.0-informational?style=flat-square)

as212510.net helm chart for Kubernetes

**Homepage:** <https://github.com/M0NsTeRRR/as212510.net>

## Source Code

* <https://github.com/M0NsTeRRR/helm-charts/charts/as212510-net>
* <https://github.com/M0NsTeRRR/helm-charts/tree/main/charts/as212510-net>

## Chart Repo

Add the following repo to use the chart:

```console
helm repo add grafana https://helm-charts.adminafk.fr
helm repo add adminafk https://helm-charts.adminafk.fr
```

## Values
Expand All @@ -32,7 +34,7 @@ helm repo add grafana https://helm-charts.adminafk.fr
| image.registry | string | `"ghcr.io"` | |
| image.repository | string | `"m0nsterrr/as212510.net"` | |
| image.sha | string | `""` | |
| image.tag | string | `""` | |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.enabled | bool | `false` | |
Expand All @@ -51,10 +53,22 @@ helm repo add grafana https://helm-charts.adminafk.fr
| securityContext | object | `{}` | |
| service.port | int | `80` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.automount | bool | `true` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
| serviceAccount.automount | bool | `true` | Automatically mount a ServiceAccount's API credentials? |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `""` | If not set and create is true, a name is generated using the fullname template |
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator |
| serviceMonitor.interval | string | `"30s"` | |
| serviceMonitor.labels | object | `{}` | |
| serviceMonitor.metricRelabelings | list | `[]` | |
| serviceMonitor.namespace | string | `nil` | If set create the `ServiceMonitor` in an alternate namespace. |
| serviceMonitor.path | string | `"/metrics"` | |
| serviceMonitor.relabelings | list | `[]` | |
| serviceMonitor.scheme | string | `"http"` | |
| serviceMonitor.scrapeTimeout | string | `"30s"` | |
| serviceMonitor.service.port | int | `10241` | Metrics service port to scrape |
| serviceMonitor.targetLabels | list | `[]` | |
| serviceMonitor.tlsConfig | object | `{}` | |
| tolerations | list | `[]` | |
| volumeMounts | list | `[]` | |
| volumes | list | `[]` | |
| volumeMounts | list | `[]` | Additional volumeMounts on the output Deployment definition. |
| volumes | list | `[]` | Additional volumes on the output Deployment definition. |
10 changes: 8 additions & 2 deletions charts/as212510-net/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{{ template "chart.header" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}
Expand All @@ -13,7 +19,7 @@
Add the following repo to use the chart:

```console
helm repo add grafana https://helm-charts.adminafk.fr
helm repo add adminafk https://helm-charts.adminafk.fr
```

{{ template "chart.valuesSection" . }}
63 changes: 63 additions & 0 deletions charts/as212510-net/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{{- if .Values.serviceMonitor.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "as212510-net.fullname" . }}-metrics
namespace: {{ .Release.Namespace | quote }}
labels:
{{- include "as212510-net.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: {{ .Values.serviceMonitor.service.port }}
protocol: TCP
name: metrics
selector:
{{- include "as212510-net.selectorLabels" . | nindent 4 }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "as212510-net.fullname" . }}
namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }}
labels:
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
jobLabel: {{ .Release.Name }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "as212510-net.selectorLabels" . | nindent 6 }}
{{- with .Values.serviceMonitor.targetLabels }}
targetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
endpoints:
- port: metrics
{{- with .Values.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
honorLabels: true
path: {{ .Values.serviceMonitor.path }}
scheme: {{ .Values.serviceMonitor.scheme }}
{{- with .Values.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
38 changes: 26 additions & 12 deletions charts/as212510-net/values.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Default values for as212510-net.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
registry: ghcr.io
repository: m0nsterrr/as212510.net
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
# -- Overrides the image tag whose default is the chart appVersion.
tag: ""
sha: ""

Expand All @@ -22,14 +18,14 @@ extraEnv: []
extraEnvFrom: []

serviceAccount:
# Specifies whether a service account should be created
# -- Specifies whether a service account should be created
create: true
# Automatically mount a ServiceAccount's API credentials?
# -- Automatically mount a ServiceAccount's API credentials?
automount: true
# Annotations to add to the service account
# -- Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
# -- The name of the service account to use.
# -- If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}
Expand All @@ -50,6 +46,24 @@ service:
type: ClusterIP
port: 80

serviceMonitor:
# -- If true, a ServiceMonitor CRD is created for a prometheus operator
enabled: false
path: /metrics
# -- If set create the `ServiceMonitor` in an alternate namespace.
namespace:
labels: {}
interval: 30s
scheme: http
tlsConfig: {}
scrapeTimeout: 30s
relabelings: []
metricRelabelings: []
targetLabels: []
service:
# -- Metrics service port to scrape
port: 10241

ingress:
enabled: false
ingressClassName: ""
Expand Down Expand Up @@ -85,14 +99,14 @@ autoscaling:
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# Additional volumes on the output Deployment definition.
# -- Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false

# Additional volumeMounts on the output Deployment definition.
# -- Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
Expand Down

0 comments on commit 354bd72

Please sign in to comment.