Skip to content

Commit

Permalink
fix(#95): improve rundeck-exporter helm charts
Browse files Browse the repository at this point in the history
- Added minor doc updates
- Added servicMonitor.yaml template
- Fixed services.yaml targetPort
  • Loading branch information
phsmith committed Jul 29, 2024
1 parent b23dff9 commit b78cde8
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 120 deletions.
4 changes: 3 additions & 1 deletion charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ keywords:
maintainers:
- email: [email protected]
name: Natália Granato
- email: [email protected]
name: Phillipe Smith
name: rundeck-exporter
type: application
version: 0.2.0
version: 0.3.0
6 changes: 4 additions & 2 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ git clone https://github.com/phsmith/rundeck_exporter.git
2. Access the charts directory

```
cd charts
cd charts
```

3. Create namespace (if no):
Expand All @@ -35,7 +35,7 @@ kubectl create namespace my-namespace
4. Install the Rundeck Exporter:

```
helm install rundeck-exporter -n your-namespace .
helm install rundeck-exporter -n my-namespace .
```

## Configuration
Expand All @@ -52,6 +52,8 @@ Here are some common settings:

See the `values.yaml` file for all available configuration options.

> **Note**: [prometheus-operator](https://github.com/prometheus-operator/kube-prometheus) is required if `serviceMonitor.enabled`.
## Customization

You can further customize the Rundeck Exporter deployment by editing the `deployment.yaml` file in the templates directory. Here you can add volumes, define resources, configure readiness and vitality probes, among other options.
Expand Down
86 changes: 0 additions & 86 deletions charts/manifests/README.md

This file was deleted.

15 changes: 0 additions & 15 deletions charts/manifests/serviceMonitor.yaml

This file was deleted.

10 changes: 3 additions & 7 deletions charts/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
1. Get the application URL by running these commands:
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 "rundeck-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 "rundeck-exporter.fullname" . }}'
Expand All @@ -17,6 +13,6 @@
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "rundeck-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
echo "Visit http://127.0.0.1:9620 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 9620:$CONTAINER_PORT
{{- end }}
4 changes: 2 additions & 2 deletions charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ Create the name of the service account to use
# helpers.tpl

{{- define "rundeck-exporter.volumeMounts" -}}
# Defina os volumeMounts do seu aplicativo aqui, se necessário
# Define volumeMounts for your app here, if needed
{{- end -}}

{{- define "rundeck-exporter.volumes" -}}
# Defina os volumes do seu aplicativo aqui, se necessário
# Define volumes for your app here, if needed
{{- end -}}
4 changes: 2 additions & 2 deletions charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
targetPort: {{ .Values.service.port }}
protocol: TCP
name: http
name: metrics
selector:
{{- include "rundeck-exporter.selectorLabels" . | nindent 4 }}
27 changes: 27 additions & 0 deletions charts/templates/serviceMonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.serviceMonitor.enabled -}}
# service-monitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.serviceMonitor.name -}}
name: {{ .Values.serviceMonitor.name }}
{{- else }}
name: rundeck-exporter-monitor
{{- end }}
{{- if .Values.serviceMonitor.namespace -}}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- else }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "rundeck-exporter.selectorLabels" . | nindent 4 }}
spec:
endpoints:
- interval: {{ .Values.serviceMonitor.interval }}
path: {{ .Values.serviceMonitor.path }}
port: metrics
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
selector:
matchLabels:
{{- include "rundeck-exporter.selectorLabels" . | nindent 8 }}
{{- end }}
17 changes: 12 additions & 5 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ replicaCount: 1
image:
repository: phsmith/rundeck-exporter
pullPolicy: IfNotPresent
tag: 2.6.1
tag: 2.7.1

env:
RUNDECK_EXPORTER_DEBUG: true
RUNDECK_EXPORTER_HOST: 0.0.0.0
RUNDECK_EXPORTER_PORT: 9620
RUNDECK_TOKEN: "your-rundeck-token"
RUNDECK_URL: "your-rundeck-url"
RUNDECK_USERNAME: "your-rundeck-username"
RUNDECK_USERPASSWORD: "your-rundeck-password"
RUNDECK_TOKEN: "your-rundeck-token"
# RUNDECK_USERNAME: "your-rundeck-username"
# RUNDECK_USERPASSWORD: "your-rundeck-password"
RUNDECK_API_VERSION: 40
RUNDECK_SKIP_SSL: true
RUNDECK_PROJECTS_EXECUTIONS: true
RUNDECK_PROJECTS_EXECUTIONS_CACHE: true
RUNDECK_PROJECTS_EXECUTIONS_CACHE: false
RUNDECK_CPU_STATS: true
RUNDECK_MEMORY_STATS: true

Expand Down Expand Up @@ -76,7 +76,14 @@ probe:
periodSeconds: 10

serviceMonitor:
# Whether a serviceMonitor should be created or not
enabled: true
# name: <defaults to rundeck-exporter-monitor>
# namespace: <defaults to helm release namespace>
interval: 30s

path: /
scrapeTimeout: 10s

resources: {}

Expand Down

0 comments on commit b78cde8

Please sign in to comment.