Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
{{- if and .Values.enableSqsTerminationDraining .Values.enablePrometheusServer -}}
{{- if and .Values.enablePrometheusServer (or .Values.enableSqsTerminationDraining .Values.service.create) -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "aws-node-termination-handler.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- if .Values.enableSqsTerminationDraining }}
{{- include "aws-node-termination-handler.labelsDeployment" . | nindent 4 }}
{{- else }}
{{- include "aws-node-termination-handler.labelsDaemonset" . | nindent 4 }}
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
{{- if not .Values.enableSqsTerminationDraining }}
clusterIP: None
{{- end }}
selector:
{{- if .Values.enableSqsTerminationDraining }}
{{- include "aws-node-termination-handler.selectorLabelsDeployment" . | nindent 4 }}
{{- else }}
{{- include "aws-node-termination-handler.selectorLabelsDaemonset" . | nindent 4 }}
{{- end }}
ports:
- name: http-metrics
port: {{ .Values.prometheusServerPort }}
Expand Down
14 changes: 14 additions & 0 deletions config/helm/aws-node-termination-handler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ strategy: {}
podDisruptionBudget: {}
# maxUnavailable: 1

service:
# Controls Service creation for the metrics server.
# - In SQS mode (enableSqsTerminationDraining=true): a Service is auto-created
# when enablePrometheusServer=true (legacy behavior, unchanged by this value).
# - In IMDS mode (enableSqsTerminationDraining=false): opt in by setting
# service.create=true. Creates a headless Service (clusterIP: None) pointing
# at DaemonSet pods, for Prometheus scrape discovery via Kubernetes endpoint
# slices.
# When enablePrometheusServer=false, no Service is created regardless.
create: false
# Annotations to add to the Service metadata. Useful for attaching
# prometheus.io/* annotations for endpoint-based scrape discovery.
annotations: {}

serviceMonitor:
# Specifies whether ServiceMonitor should be created
# this needs enableSqsTerminationDraining: true
Expand Down