blob: 8574151978a21cabc4c6f34021c469ac137c4839 [file] [log] [blame]
Mohammed Naser65cda132024-05-02 14:34:08 -04001{{/*
2memcached Service
3Params:
4 ctx = . context
5 valuesSection = name of the section in values.yaml
6 component = name of the component
7valuesSection and component are specified separately because helm prefers camelcase for naming convetion and k8s components are named with snake case.
8*/}}
9{{- define "loki.memcached.service" -}}
10{{ with (index $.ctx.Values $.valuesSection) }}
11{{- if .enabled -}}
12apiVersion: v1
13kind: Service
14metadata:
15 name: {{ include "loki.resourceName" (dict "ctx" $.ctx "component" $.component) }}
16 labels:
17 {{- include "loki.labels" $.ctx | nindent 4 }}
18 app.kubernetes.io/component: "memcached-{{ $.component }}"
19 {{- with .service.labels }}
20 {{- toYaml . | nindent 4 }}
21 {{- end }}
22 annotations:
23 {{- toYaml .service.annotations | nindent 4 }}
24 namespace: {{ $.ctx.Release.Namespace | quote }}
25spec:
26 type: ClusterIP
27 clusterIP: None
28 ports:
29 - name: memcached-client
30 port: {{ .port }}
31 targetPort: {{ .port }}
32 {{ if $.ctx.Values.memcachedExporter.enabled -}}
33 - name: http-metrics
34 port: 9150
35 targetPort: 9150
36 {{ end }}
37 selector:
38 {{- include "loki.selectorLabels" $.ctx | nindent 4 }}
39 app.kubernetes.io/component: "memcached-{{ $.component }}"
40{{- end -}}
41{{- end -}}
42{{- end -}}