Adding dependencies, binary autostart

This commit is contained in:
plm
2024-12-16 14:55:43 +01:00
parent 5e1503f0bc
commit 10b01fdc40
318 changed files with 47355 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
{{/*
table-manager fullname
*/}}
{{- define "loki.tableManagerFullname" -}}
{{ include "loki.fullname" . }}-table-manager
{{- end }}
{{/*
table-manager common labels
*/}}
{{- define "loki.tableManagerLabels" -}}
{{ include "loki.labels" . }}
app.kubernetes.io/component: table-manager
{{- end }}
{{/*
table-manager selector labels
*/}}
{{- define "loki.tableManagerSelectorLabels" -}}
{{ include "loki.selectorLabels" . }}
app.kubernetes.io/component: table-manager
{{- end }}
{{/*
table-manager priority class name
*/}}
{{- define "loki.tableManagerPriorityClassName" -}}
{{- $pcn := coalesce .Values.global.priorityClassName .Values.tableManager.priorityClassName -}}
{{- if $pcn }}
priorityClassName: {{ $pcn }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,126 @@
{{- if .Values.tableManager.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "loki.tableManagerFullname" . }}
labels:
{{- include "loki.tableManagerLabels" . | nindent 4 }}
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.tableManager.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: 1
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "loki.tableManagerSelectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include "loki.configMapOrSecretContentHash" (dict "ctx" . "name" "/config.yaml") }}
{{- with .Values.loki.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tableManager.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.tableManagerSelectorLabels" . | nindent 8 }}
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tableManager.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "loki.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "loki.tableManagerPriorityClassName" . | nindent 6 }}
securityContext:
{{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.tableManager.terminationGracePeriodSeconds }}
containers:
- name: table-manager
image: {{ include "loki.image" . }}
imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
args:
- -config.file=/etc/loki/config/config.yaml
- -target=table-manager
{{- with .Values.tableManager.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http-metrics
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
{{- with .Values.tableManager.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tableManager.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
readinessProbe:
{{- toYaml .Values.loki.readinessProbe | nindent 12 }}
livenessProbe:
{{- toYaml .Values.loki.livenessProbe | nindent 12 }}
volumeMounts:
- name: config
mountPath: /etc/loki/config
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /etc/loki/license
{{- end }}
{{- with .Values.tableManager.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.tableManager.resources | nindent 12 }}
{{- if .Values.tableManager.extraContainers }}
{{- toYaml .Values.tableManager.extraContainers | nindent 8}}
{{- end }}
{{- with .Values.tableManager.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tableManager.dnsConfig }}
dnsConfig:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.tableManager.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tableManager.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "loki.configVolume" . | nindent 10 }}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
{{- if .Values.enterprise.useExternalLicense }}
secretName: {{ .Values.enterprise.externalLicenseName }}
{{- else }}
secretName: enterprise-logs-license
{{- end }}
{{- end }}
{{- with .Values.tableManager.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,36 @@
{{- if .Values.tableManager.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "loki.fullname" . }}-table-manager
labels:
{{- include "loki.labels" . | nindent 4 }}
{{- with .Values.loki.serviceLabels }}
{{- toYaml . | nindent 4}}
{{- end }}
{{- with .Values.tableManager.service.labels }}
{{- toYaml . | nindent 4}}
{{- end }}
app.kubernetes.io/component: table-manager
annotations:
{{- with .Values.loki.serviceAnnotations }}
{{- toYaml . | nindent 4}}
{{- end }}
{{- with .Values.tableManager.service.annotations }}
{{- toYaml . | nindent 4}}
{{- end }}
spec:
type: ClusterIP
ports:
- name: http-metrics
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
{{- include "loki.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: table-manager
{{- end }}

View File

@@ -0,0 +1,57 @@
{{- if .Values.tableManager.enabled }}
{{- with .Values.serviceMonitor }}
{{- if .enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "loki.tableManagerFullname" $ }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "loki.tableManagerLabels" $ | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .namespaceSelector }}
namespaceSelector:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "loki.tableManagerSelectorLabels" $ | nindent 6 }}
endpoints:
- port: http-metrics
{{- with .interval }}
interval: {{ . }}
{{- end }}
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with .relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .scheme }}
scheme: {{ . }}
{{- end }}
{{- with .tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .targetLabels }}
targetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}