Skip to content
Open
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
26 changes: 24 additions & 2 deletions charts/scalardb-cluster/templates/scalardb-cluster/service.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
{{- if not .Values.envoy.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "scalardb-cluster.fullname" . }}-headless
name: {{ include "scalardb-cluster.fullname" . }}-endpoint
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a newly added service resource to provide the endpoint to access ScalarDB Cluster directly without Envoy.

namespace: {{ .Release.Namespace }}
labels:
{{- include "scalardb-cluster.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.scalardbCluster.service.annotations | nindent 4 }}
spec:
type: {{ .Values.scalardbCluster.service.type }}
sessionAffinity: None
ports:
{{- range $key, $value := .Values.scalardbCluster.service.ports }}
- name: {{ $key }}
{{- toYaml $value | nindent 6 }}
{{- end }}
selector:
{{- include "scalardb-cluster.selectorLabels" . | nindent 4 }}
{{- end }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "scalardb-cluster.fullname" . }}-headless
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This headless service is used not only for the service discovery of Envoy but also for pod detection of Scalar Admin for Kubernetes. Therefore, we need to deploy this headless service always, even if we don't deploy Envoy.

namespace: {{ .Release.Namespace }}
labels:
{{- include "scalardb-cluster.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.scalardbCluster.service.annotations | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
sessionAffinity: None
ports:
{{- range $key, $value := .Values.scalardbCluster.service.ports }}
- name: {{ $key }}
{{ toYaml $value | indent 6 }}
{{- toYaml $value | nindent 6 }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a minor refactoring. This does not change any behaviors.

{{- end }}
selector:
{{- include "scalardb-cluster.selectorLabels" . | nindent 4 }}
Expand Down