Skip to content

Commit

Permalink
Helm and error message fixes (#17)
Browse files Browse the repository at this point in the history
* fix serviceaccountname
* fix log typo
* typo
* bump chart and app version so that correct image is used. fix podMonitor
  • Loading branch information
afirth authored Nov 27, 2023
1 parent d9fb8a4 commit 33de622
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions charts/kubelet-stats-metrics/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: kubelet-stats-metrics
version: 0.1.0
appVersion: "0.1.0"
version: 0.1.1
appVersion: "0.6.0"
kubeVersion: ">=1.21.0-0"
description: Expose kubelet stats metrics to prometheus
home: https://github.com/GDATASoftwareAG/kubelet-stats-metrics
Expand Down
2 changes: 1 addition & 1 deletion charts/kubelet-stats-metrics/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
labels:
{{- include "kubelet-stats-metrics.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: kubelet-stats-metrics
serviceAccountName: {{ include "kubelet-stats-metrics.fullname" . }}
containers:
- name: metrics
image: {{ .Values.image }}
Expand Down
4 changes: 2 additions & 2 deletions charts/kubelet-stats-metrics/templates/pod-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
- {{ .Release.Namespace }}
selector:
matchLabels:
k8s-app: {{ .Release.Name }}
{{- include "kubelet-stats-metrics.selectorLabels" . | nindent 8 }}
podMetricsEndpoints:
- port: http
interval: 30s
Expand All @@ -22,4 +22,4 @@ spec:
# - action: replace
# sourceLabels:
# - __meta_kubernetes_pod_host_ip
# targetLabel: instance
# targetLabel: instance
4 changes: 2 additions & 2 deletions charts/kubelet-stats-metrics/values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
image: ghcr.io/gdatasoftwareag/kubelet-stats-metrics:v0.1.0
logLevel: info
image: ghcr.io/gdatasoftwareag/kubelet-stats-metrics:v0.6.0
logLevel: info
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func metricsLoop(interval time.Duration, cs *kubernetes.Clientset) {
ctx := context.Background()
err := singleRun(ctx, cs)
if err != nil {
log.Errorf("ErrorBadRequst : %s", err.Error())
log.Errorf("ErrorBadRequest : %s", err.Error())
}
time.Sleep(interval)
}
Expand All @@ -149,7 +149,7 @@ func singleRun(ctx context.Context, cs *kubernetes.Clientset) error {
currentNode := nodes.Items[i].Name
node, err := scrapeSingleNode(ctx, cs, currentNode)
if err != nil {
log.Errorf("ErrorBadRequst : %s", err.Error())
log.Errorf("ErrorBadRequest : %s", err.Error())
continue
}
pods = append(pods, node...)
Expand Down Expand Up @@ -309,6 +309,6 @@ func main() {
http.Handle("/metrics", promhttp.Handler())

if err := http.ListenAndServe(fmt.Sprintf(":%d", cfg.metricsPort), nil); err != nil {
log.Fatalf("Listener Falied : %s\n", err.Error())
log.Fatalf("Listener Failed : %s\n", err.Error())
}
}

0 comments on commit 33de622

Please sign in to comment.