diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 905828f..a242dca 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -47,11 +47,11 @@ jobs: fi - name: Run chart-testing (lint) - run: ct lint --config ct.yaml + run: ct lint --validate-maintainers=false --config ct.yaml - name: Create kind cluster uses: helm/kind-action@v1.2.0 if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) - run: ct install --config ct.yaml \ No newline at end of file + run: ct install --config ct.yaml diff --git a/charts/mongoshake-prometheus-exporter-1.0.0.tgz b/charts/mongoshake-prometheus-exporter-1.0.0.tgz new file mode 100644 index 0000000..02d6646 Binary files /dev/null and b/charts/mongoshake-prometheus-exporter-1.0.0.tgz differ diff --git a/charts/mongoshake-prometheus-exporter/.helmignore b/charts/mongoshake-prometheus-exporter/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/.helmignore @@ -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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/mongoshake-prometheus-exporter/Chart.yaml b/charts/mongoshake-prometheus-exporter/Chart.yaml new file mode 100644 index 0000000..46ef4d2 --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: mongoshake-prometheus-exporter +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 1.0.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: "1.0.0" diff --git a/charts/mongoshake-prometheus-exporter/README.md b/charts/mongoshake-prometheus-exporter/README.md new file mode 100644 index 0000000..6e23bdb --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/README.md @@ -0,0 +1,176 @@ +# MongoShake Prometheus Exporter Helm Chart + +* MongoShake Prometheus Exporter is an exporter that adapts MongoShake metrics to the Prometheus format, making it easier for administrators to monitor resources.. +* Reference: [MongoShake Prometheus Exporter](https://github.com/osgurisdosre/mongoshake-prometheus-exporter) + +## Get Repo Info + +```console +helm repo add mongoshake-prometheus-exporter https://osgurisdosre.github.io/helm-charts +helm repo update +``` +* You can then run `helm search repo mongoshake-prometheus-exporter` to see the charts. + +_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 mongoshake-prometheus-exporter mongoshake-prometheus-exporter/mongoshake-prometheus-exporter +``` + +## Uninstalling the Chart + +To uninstall/delete the my-release deployment: + +```console +helm delete mongoshake-prometheus-exporter +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + + +## Configuration + +| Parameter | Description | Default | +|-------------------------------------------|-----------------------------------------------|---------------------------------------------------------| +| `image.repository` | Image repository | `sergiitk/pagerbeauty` | +| `image.tag` | Overrides the PagerBeauty image tag whose default is the chart appVersion | `latest` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `service.type` | Kubernetes service type | `ClusterIP` | +| `service.port` | Kubernetes port where service is exposed | `8000` | +| `ingress.enabled` | Enables Ingress | `false` | +| `ingress.annotations` | Ingress annotations (values are templated) | `{}` | +| `ingress.path` | Ingress accepted path | `/` | +| `ingress.hosts` | Ingress accepted hostnames | `["chart-example.local"]` | +| `ingress.tls` | Ingress TLS configuration | `[]` | +| `ingress.className` | Ingress Class Name. MAY be required for Kubernetes versions >= 1.18 | `""` | +| `resources` | CPU/Memory resource requests/limits | `{}` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Toleration labels for pod assignment | `[]` | +| `affinity` | Affinity settings for pod assignment | `{}` | +| `env` | Extra environment variables passed to pods | `{}` | +| `envFromSecret` | Name of a Kubernetes secret (must be manually created in the same namespace) containing values to be added to the environment. Can be templated | `""` | +| `envFromSecrets` | List of Kubernetes secrets (must be manually created in the same namespace) containing values to be added to the environment. Can be templated | `[]` | +| `envFromConfigMaps` | List of Kubernetes ConfigMaps (must be manually created in the same namespace) containing values to be added to the environment. Can be templated | `[]` | +| `podAnnotations` | Pod annotations | `{}` | +| `serviceAccount.annotations` | ServiceAccount annotations | | +| `serviceAccount.create` | Create service account | `true` | +| `serviceAccount.name` | Service account name to use, when empty will be set to created account if `serviceAccount.create` is set else to `default` | `` | +| `serviceMonitor.enabled` | Enables the creation of a service monitor used later for Prometheus discovery. When empty, it will be set to `false`. | `false` | + + +### Example + +For a demonstration, we used a MongoShake instance operating in Kubernetes. + +```bash +curl http://mongoshake.monitoring.svc.cluster.local:9100/repl | jq +``` + +We get the following response: + +```json +{ + "who": "mongoshake", + "tag": "", + "replset": "mongoshake-shard-0", + "logs_get": 786, + "logs_repl": 62, + "logs_success": 62, + "tps": 0, + "lsn": { + "unix": 1707334793, + "time": "2024-02-07 19:39:53", + "ts": "7332947099257929731" + }, + "lsn_ack": { + "unix": 1707334793, + "time": "2024-02-07 19:39:53", + "ts": "7332947099257929731" + }, + "lsn_ckpt": { + "unix": 1707334656, + "time": "2024-02-07 19:37:36", + "ts": "7332946510847410178" + }, + "now": { + "unix": 1707334864, + "time": "2024-02-07 19:41:04" + }, + "log_size_avg": "503.00B", + "log_size_max": "12.29KB" +} +``` + +Installing the Chart +```bash +helm repo add mongoshake-prometheus-exporter https://osgurisdosre.github.io/helm-charts +helm repo update +helm install my-release mongoshake-prometheus-exporter/mongoshake-prometheus-exporter -f values -n monitoring +``` +In the values file we used the following settings: +```yaml +image: + repository: ghcr.io/osgurisdosre/mongoshake-prometheus-exporter + pullPolicy: IfNotPresent + tag: "latest" + +env: + URL_LIST: "http://mongoshake.monitoring.svc.cluster.local:9100/repl" + SCRAPE_INTERVAL: 5 + +service: + type: ClusterIP + port: 8000 + labels: + release: prometheus + +serviceMonitor: + enabled: true + path: /metrics + interval: 10s + namespace: monitoring + labels: + release: prometheus + +``` +Now we can check the output by the service created + +```bash +curl http://mongoshake-prometheus-exporter.monitoring.svc.cluster.local:8000/metrics/ +``` + +The following response is obtained: +```bash +# HELP mongoshake_logs_get Number of logs (get) +# TYPE mongoshake_logs_get gauge +mongoshake_logs_get{replset="Release-shard-0",url="http://mongoshake.monitoring.svc.cluster.local:9100/repl"} 44736.0 +# HELP mongoshake_logs_repl Number of logs (repl) +# TYPE mongoshake_logs_repl gauge +mongoshake_logs_repl{replset="Release-shard-0",url="http://mongoshake.monitoring.svc.cluster.local:9100/repl"} 1109.0 +# HELP mongoshake_logs_success Number of successful logs +# TYPE mongoshake_logs_success gauge +mongoshake_logs_success{replset="Release-shard-0",url="http://mongoshake.monitoring.svc.cluster.local:9100/repl"} 1109.0 +# HELP mongoshake_tps Transactions per second +# TYPE mongoshake_tps gauge +mongoshake_tps{replset="Release-shard-0",url="http://mongoshake.monitoring.svc.cluster.local:9100/repl"} 0.0 +# HELP mongoshake_replication_latency Replication_latency in MS +# TYPE mongoshake_replication_latency gauge +mongoshake_replication_latency{replset="Release-shard-0",url="http://mongoshake.monitoring.svc.cluster.local:9100/repl"} 0.0 +``` + +Note that the metrics are now being exported in Prometheus format. + +### Contributions + +Contributions are welcome! If you wish to contribute, please: +- Fork the repository; + +- Create a new branch for your feature or fix; + +- Send a pull request with your proposal. + +To report bugs or request new features, use the issues section of the repository. diff --git a/charts/mongoshake-prometheus-exporter/templates/NOTES.txt b/charts/mongoshake-prometheus-exporter/templates/NOTES.txt new file mode 100644 index 0000000..8662d45 --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "mongoshake-prometheus-exporter.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "mongoshake-prometheus-exporter.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mongoshake-prometheus-exporter.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mongoshake-prometheus-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/mongoshake-prometheus-exporter/templates/_helpers.tpl b/charts/mongoshake-prometheus-exporter/templates/_helpers.tpl new file mode 100644 index 0000000..d7e94bf --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/_helpers.tpl @@ -0,0 +1,66 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "mongoshake-prometheus-exporter.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 "mongoshake-prometheus-exporter.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 "mongoshake-prometheus-exporter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "mongoshake-prometheus-exporter.labels" -}} +helm.sh/chart: {{ include "mongoshake-prometheus-exporter.chart" . }} +{{ include "mongoshake-prometheus-exporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "mongoshake-prometheus-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "mongoshake-prometheus-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "mongoshake-prometheus-exporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "mongoshake-prometheus-exporter.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +# {{- define "mongoshake-prometheus-exporter.namespace" }} +# {{ .Release.Namespace }} +# {{- end }} \ No newline at end of file diff --git a/charts/mongoshake-prometheus-exporter/templates/deployment.yaml b/charts/mongoshake-prometheus-exporter/templates/deployment.yaml new file mode 100644 index 0000000..c035eef --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mongoshake-prometheus-exporter.fullname" . }} + labels: + {{- include "mongoshake-prometheus-exporter.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "mongoshake-prometheus-exporter.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "mongoshake-prometheus-exporter.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "mongoshake-prometheus-exporter.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + {{- range $key, $value := .Values.env }} + - name: "{{ $key }}" + value: "{{ $value }}" + {{- end }} + {{- if or .Values.envFromSecret (or .Values.envFromSecrets) .Values.envFromConfigMaps }} + envFrom: + {{- if .Values.envFromSecret }} + - secretRef: + name: {{ .Values.envFromSecret }} + {{- end }} + {{- range .Values.envFromSecrets }} + - secretRef: + name: {{ tpl .name $ }} + optional: {{ .optional | default false }} + {{- end }} + {{- range .Values.envFromConfigMaps }} + - configMapRef: + name: {{ tpl .name $ }} + optional: {{ .optional | default false }} + {{- end }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: /metrics + port: http + readinessProbe: + httpGet: + path: /metrics + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/mongoshake-prometheus-exporter/templates/ingress.yaml b/charts/mongoshake-prometheus-exporter/templates/ingress.yaml new file mode 100644 index 0000000..7e9a178 --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "mongoshake-prometheus-exporter.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "mongoshake-prometheus-exporter.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/mongoshake-prometheus-exporter/templates/service.yaml b/charts/mongoshake-prometheus-exporter/templates/service.yaml new file mode 100644 index 0000000..c289db1 --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mongoshake-prometheus-exporter.fullname" . }} + labels: + {{- include "mongoshake-prometheus-exporter.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "mongoshake-prometheus-exporter.selectorLabels" . | nindent 4 }} diff --git a/charts/mongoshake-prometheus-exporter/templates/serviceaccount.yaml b/charts/mongoshake-prometheus-exporter/templates/serviceaccount.yaml new file mode 100644 index 0000000..d7ca901 --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "mongoshake-prometheus-exporter.serviceAccountName" . }} + labels: + {{- include "mongoshake-prometheus-exporter.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/mongoshake-prometheus-exporter/templates/servicemonitor.yaml b/charts/mongoshake-prometheus-exporter/templates/servicemonitor.yaml new file mode 100644 index 0000000..ecf0b55 --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/servicemonitor.yaml @@ -0,0 +1,54 @@ +{{- if .Values.serviceMonitor.enabled }} +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "mongoshake-prometheus-exporter.fullname" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ tpl .Values.serviceMonitor.namespace . }} + {{- else }} + namespace: {{ include "mongoshake-prometheus-exporter.namespace" . }} + {{- end }} + labels: + {{- include "mongoshake-prometheus-exporter.labels" . | nindent 4 }} + {{- with .Values.serviceMonitor.labels }} + {{- tpl (toYaml . | nindent 4) $ }} + {{- end }} +spec: + endpoints: + - port: {{ .Values.service.portName }} + {{- 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 }} + jobLabel: "{{ .Release.Name }}" + selector: + matchLabels: + {{- include "mongoshake-prometheus-exporter.selectorLabels" . | nindent 6 }} + {{- with .Values.serviceMonitor.namespaceSelector }} + namespaceSelector: + matchNames: + - {{ include "mongoshake-prometheus-exporter.namespace" . }} + {{- end }} + {{- with .Values.serviceMonitor.targetLabels }} + targetLabels: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/mongoshake-prometheus-exporter/templates/tests/test-connection.yaml b/charts/mongoshake-prometheus-exporter/templates/tests/test-connection.yaml new file mode 100644 index 0000000..74c3eba --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "mongoshake-prometheus-exporter.fullname" . }}-test-connection" + labels: + {{- include "mongoshake-prometheus-exporter.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "mongoshake-prometheus-exporter.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/mongoshake-prometheus-exporter/values.yaml b/charts/mongoshake-prometheus-exporter/values.yaml new file mode 100644 index 0000000..55f98ad --- /dev/null +++ b/charts/mongoshake-prometheus-exporter/values.yaml @@ -0,0 +1,112 @@ +# Default values for mongoshake-prometheus-exporter. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: ghcr.io/osgurisdosre/mongoshake-prometheus-exporter + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +env: + # Comma-separated list of MongoShake Prometheus Exporter endpoint list + # For example, URL_LIST="http://host.docker.internal:9100/repl,http://host.docker.internal:9200/repl" + URL_LIST: "" + # The time interval at which the MongoShake Prometheus Exporter will query the URLs. + SCRAPE_INTERVAL: 5 + +# You can pass the access key by envFromSecret, envFromSecrets or envFromConfigMaps +envFromSecret: "" + +envFromSecrets: [] + # - name: secret-name + # optional: true + +envFromConfigMaps: [] + # - name: configmap-name + # optional: true + # - name: configmap2-name + # optional: true + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # 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 + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +serviceMonitor: + ## If true, a ServiceMonitor CRD is created for a prometheus operator + ## https://github.com/coreos/prometheus-operator + ## + enabled: false + path: /metrics + namespace: monitoring + labels: {} + interval: 10s + scheme: http + tlsConfig: {} + scrapeTimeout: 10s + relabelings: [] + metricRelabelings: [] + targetLabels: [] + selector: [] + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/old_mongoshake-prometheus-exporter-1.0.0.tgz b/charts/old_mongoshake-prometheus-exporter-1.0.0.tgz new file mode 100644 index 0000000..7cc4887 Binary files /dev/null and b/charts/old_mongoshake-prometheus-exporter-1.0.0.tgz differ