Initial commit
This commit is contained in:
38
charts/alloy/templates/cluster_service.yaml
Normal file
38
charts/alloy/templates/cluster_service.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
{{- $values := (mustMergeOverwrite .Values.alloy (or .Values.agent dict)) -}}
|
||||
{{- if $values.clustering.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "alloy.fullname" . }}-cluster
|
||||
namespace: {{ include "alloy.namespace" . }}
|
||||
labels:
|
||||
{{- include "alloy.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: networking
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: 'None'
|
||||
publishNotReadyAddresses: true
|
||||
selector:
|
||||
{{- include "alloy.selectorLabels" . | nindent 4 }}
|
||||
ports:
|
||||
# Do not include the -metrics suffix in the port name, otherwise metrics
|
||||
# can be double-collected with the non-headless Service if it's also
|
||||
# enabled.
|
||||
#
|
||||
# This service should only be used for clustering, and not metric
|
||||
# collection.
|
||||
- name: {{ $values.clustering.portName }}
|
||||
port: {{ $values.listenPort }}
|
||||
targetPort: {{ $values.listenPort }}
|
||||
protocol: "TCP"
|
||||
{{- range $portMap := $values.extraPorts }}
|
||||
- name: {{ $portMap.name }}
|
||||
port: {{ $portMap.port }}
|
||||
targetPort: {{ $portMap.targetPort }}
|
||||
protocol: {{ coalesce $portMap.protocol "TCP" }}
|
||||
{{- if not (empty $portMap.appProtocol) }}
|
||||
# Useful for OpenShift clusters that want to expose Alloy ports externally
|
||||
appProtocol: {{ $portMap.appProtocol }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user