diff --git a/charts/Chart.yaml b/charts/Chart.yaml index d37a235..9e4b073 100644 --- a/charts/Chart.yaml +++ b/charts/Chart.yaml @@ -7,6 +7,8 @@ keywords: maintainers: - email: natalia.granato@jackexperts.com name: Natália Granato +- email: phsmithcc@gmail.com + name: Phillipe Smith name: rundeck-exporter type: application -version: 0.2.0 +version: 0.3.0 diff --git a/charts/README.md b/charts/README.md index 0c0f56b..cc3550a 100644 --- a/charts/README.md +++ b/charts/README.md @@ -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): @@ -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 @@ -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. diff --git a/charts/manifests/README.md b/charts/manifests/README.md deleted file mode 100644 index 2cf09f3..0000000 --- a/charts/manifests/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# ServiceMonitor for Rundeck Exporter - -The ServiceMonitor is a resource used by the Prometheus Operator to discover service endpoints in Kubernetes. In this case, we will create a ServiceMonitor to control the Rundeck exporter. - -## Pre-element - -Prometheus Operator install in the Kubernetes cluster. The Prometheus Operator is help you create monitoring resources, such as ServiceMonitor. ServiceMonitor. - -## Go to ServiceMonitor - -1. Create a YAML file for the ServiceMonitor. For example, service-monitor.yaml. - -2. Open the service-monitor.yaml file in a text editor and hints as information: - -``` -apiVersion: monitoring.coreos.com/v1 -type: ServiceMonitor -metadata: - name: my-service-monitor -labels: - app: rundeck-exporter -spec: - selector: - matchLabels: - application: reporter's endpoint -: - - port: 9620 - range: 30s - path: /metrics -``` - -Get started with my service-monitor by name for ServiceMonitor. You can also get port value if Rundeck Exporter nations on a different port. - -3. Save the file service - monitor.yaml with the information. - -4. Use the kubectl command to sign the ServiceMonitor file: - -``` -kubectl apply -f service-monitor.yaml -n your-namespace-rundeck -``` - -## Verifying the ServiceMonitor - -After setting the ServiceMonitor, you can verify that it is being displayed, prohibited, and monitored by the Prometheus Operator. - -1. - -`` -kubectl get my-service-monitor servicemonitor - -``` - - tap on the fun ServiceMonitor including name, labels and other details. - -2. Vulnerability if the Prometheus Operator detected the ServiceMonitor: - -``` - -kubectl get promisedheusrules --all-namespaces -`` - -This shows how monitoring rules by the Prometheus Operator. You should see a post to ServiceMonitor create. - -3. ← if Rundeck Exporter skills are related to Prometheus: - -* Access the Prometheus UI using a Browser: - -``` -http:// -``` - -Replace with the Prometheus service target in your Kubernetes cluster. - -* to the "Status" section in the Prometheus UI and details if the Rundeck Exporter is a scrape hope reason (detail collection). - -* You can also check if Prometheus is being approved for Rundeck Exporter national authorities. - -## Final Considerations - -With the past ServiceMonitor, the Prometheus Operator will now be considered the Rundeck Exporter and details for analysis and visualization in Prometheus. - -Remember that Rundeck Exporter must be referenced, such as a port and the path to skills, for ServiceMonitor to work. - -The name of the ServiceMonitor name and other details, according to your specific configuration. - -ServiceMonitor for Rundeck Exporter. If you have more information about the subject. I'm here to help! diff --git a/charts/manifests/serviceMonitor.yaml b/charts/manifests/serviceMonitor.yaml deleted file mode 100644 index 51dd27b..0000000 --- a/charts/manifests/serviceMonitor.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# service-monitor.yaml -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: rundeck-exporter-monitor - namespace: your-namespace-name -spec: - endpoints: - - interval: 30s - path: / - port: your-rundeck-exporter-port - scrapeTimeout: 10s - selector: - matchLabels: - instance: your-rundeck-exporter-name diff --git a/charts/templates/NOTES.txt b/charts/templates/NOTES.txt index 2f6b9fa..6d00bab 100644 --- a/charts/templates/NOTES.txt +++ b/charts/templates/NOTES.txt @@ -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" . }}' @@ -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 }} diff --git a/charts/templates/_helpers.tpl b/charts/templates/_helpers.tpl index 8ec20e7..b15659e 100644 --- a/charts/templates/_helpers.tpl +++ b/charts/templates/_helpers.tpl @@ -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 -}} diff --git a/charts/templates/service.yaml b/charts/templates/service.yaml index 8259e08..d3d1a33 100644 --- a/charts/templates/service.yaml +++ b/charts/templates/service.yaml @@ -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 }} diff --git a/charts/templates/serviceMonitor.yaml b/charts/templates/serviceMonitor.yaml new file mode 100644 index 0000000..a712c97 --- /dev/null +++ b/charts/templates/serviceMonitor.yaml @@ -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 }} diff --git a/charts/values.yaml b/charts/values.yaml index 13d4e6a..20e0c10 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -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 @@ -76,7 +76,14 @@ probe: periodSeconds: 10 serviceMonitor: + # Whether a serviceMonitor should be created or not enabled: true + # name: + # namespace: + interval: 30s + + path: / + scrapeTimeout: 10s resources: {}