{{- if .Values.controlPlane.service.enabled }} apiVersion: v1 kind: Service metadata: name: {{ .Release.Name }} namespace: {{ .Release.Namespace }} labels: app: vcluster chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" {{- if .Values.controlPlane.service.labels }} {{ toYaml .Values.controlPlane.service.labels | indent 4 }} {{- end }} {{- $annotations := merge dict .Values.controlPlane.advanced.globalMetadata.annotations .Values.controlPlane.service.annotations }} {{- if $annotations }} annotations: {{ toYaml $annotations | indent 4 }} {{- end }} spec: {{ toYaml .Values.controlPlane.service.spec | indent 2 }} {{- if not .Values.controlPlane.service.spec.ports }} ports: - name: https port: 443 {{- if not .Values.experimental.isolatedControlPlane.headless }} targetPort: 8443 {{- end }} nodePort: {{ .Values.controlPlane.service.httpsNodePort }} protocol: TCP {{- if and .Values.networking.advanced.proxyKubelets.byHostname (not (eq .Values.controlPlane.service.spec.type "LoadBalancer")) }} - name: kubelet port: 10250 {{- if not .Values.experimental.isolatedControlPlane.headless }} targetPort: 8443 {{- end }} nodePort: {{ .Values.controlPlane.service.kubeletNodePort }} protocol: TCP {{- end }} {{- end }} {{- if and (not .Values.controlPlane.service.spec.selector) (not .Values.experimental.isolatedControlPlane.headless) }} selector: app: vcluster release: {{ .Release.Name }} {{- end }} {{- end }}