mirror of
https://github.com/helm/charts.git
synced 2026-08-20 12:57:55 +00:00
This commit fixes an issue where the chart woud not install for
instances that had a name longer than the current max length of port
names that k8s allows, which is 15 characters [1]. We allow users of the
chart to override the default configuration for this shortened port name
for cases where the prefix on the instance names may not be unique.
[1] The field is defined as an IANA_SVC_NAME, which is at most 15 chars:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#serviceport-v1-core
20 lines
555 B
YAML
20 lines
555 B
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "gcloud-sqlproxy.fullname" . }}
|
|
labels:
|
|
app: {{ template "gcloud-sqlproxy.fullname" . }}
|
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
release: "{{ .Release.Name }}"
|
|
heritage: "{{ .Release.Service }}"
|
|
spec:
|
|
ports:
|
|
{{- range .Values.cloudsql.instances }}
|
|
- name: {{ .instance }}
|
|
protocol: TCP
|
|
port: {{ .port }}
|
|
targetPort: {{ .instanceShortName | default (.instance | trunc 15) }}
|
|
{{- end }}
|
|
selector:
|
|
app: {{ template "gcloud-sqlproxy.fullname" . }}
|