Files
Aaron Taylorandk8s-ci-robot 0978b8bc6c stable/gcloud-sqlproxy: handle longer instance names (#5664)
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
2018-05-25 05:00:53 -07:00

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" . }}