Skip to content

Commit

Permalink
feat(aws-eks-asg-rolling-update-handler): Add option to create PodMon…
Browse files Browse the repository at this point in the history
…itor
  • Loading branch information
kilitr committed Mar 26, 2024
1 parent 68e1aad commit 9e36a00
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/aws-eks-asg-rolling-update-handler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: aws-eks-asg-rolling-update-handler
version: 1.5.0
version: 1.6.0
description: Handles rolling upgrades for AWS ASGs for EKS by replacing outdated nodes by new nodes.
home: https://github.com/TwiN/aws-eks-asg-rolling-update-handler
maintainers:
Expand Down
1 change: 1 addition & 0 deletions charts/aws-eks-asg-rolling-update-handler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ The following table lists the configurable parameters of the aws-eks-asg-rolling
| podLabels | Labels to add to the aws-eks-asg-rolling-update-handler pod configuration | no | `{}` |
| securityContext | Pod security context | no | `{}` |
| containerSecurityContext | Container security context | no | `{}` |
| podmonitor | Create a PodMonitor | no | `{"create": false, "labels": {}}` |
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ spec:
securityContext:
{{ toYaml .Values.containerSecurityContext | nindent 12 | trim }}
{{- end }}
{{- range .Values.environmentVars }}
{{- if eq .name "METRICS_PORT" }}
ports:
- name: metrics
containerPort: {{ .value }}
protocol: TCP
{{- end }}
{{- end }}
env:
{{- toYaml .Values.environmentVars | nindent 12 }}
{{- with .Values.resources }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.podmonitor.create }}
{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ template "aws-eks-asg-rolling-update-handler.name" . }}-metrics
namespace: {{ template "aws-eks-asg-rolling-update-handler.namespace" . }}
{{- with .Values.podmonitor.labels }}
labels: {{ . | toYaml | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{ template "aws-eks-asg-rolling-update-handler.labels" . }}
podMetricsEndpoints:
- port: metrics
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/aws-eks-asg-rolling-update-handler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ containerSecurityContext: {}
# capabilities:
# drop:
# - ALL

podmonitor:
create: false
labels: {}
# prometheus: core

0 comments on commit 9e36a00

Please sign in to comment.