Skip to content

Commit 29a44ff

Browse files
authored
Shorten metric service name (#195)
Issue #, if available: aws-controllers-k8s/community#956 Description of changes: * Previous metric service name for applicationautoscaling-controller was going over 63 characters and failing k8s validation * Other resources are not at risk because they use template from helpers.tpl which restricts the name to 63 chars * The issue occurred for this service because we were adding a suffix('-metrics') * It is important to distinguish metrics service because in future controller can have other kinds of service as well. * With the proposed solution, the metrics service name looks like `applicationautoscaling-controller-metrics` and is also truncated to never cross 63 chars(max 44 chars from service name + '-controller-metrics') Tested locally that this works accurately and helm test passes. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5a4809a commit 29a44ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/helm/templates/metrics-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: Service
44
metadata:
5-
name: {{ include "app.fullname" . }}-metrics
5+
name: {{ .Chart.Name | trimSuffix "-chart" | trunc 44 }}-controller-metrics
66
namespace: {{ .Release.Namespace }}
77
labels:
88
app.kubernetes.io/name: {{ include "app.name" . }}

0 commit comments

Comments
 (0)