Adding dependencies, binary autostart
This commit is contained in:
40
opencloud/charts/loki/templates/loki-canary/_helpers.tpl
Normal file
40
opencloud/charts/loki/templates/loki-canary/_helpers.tpl
Normal file
@@ -0,0 +1,40 @@
|
||||
{{/*
|
||||
canary fullname
|
||||
*/}}
|
||||
{{- define "loki-canary.fullname" -}}
|
||||
{{ include "loki.name" . }}-canary
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
canary common labels
|
||||
*/}}
|
||||
{{- define "loki-canary.labels" -}}
|
||||
{{ include "loki.labels" . }}
|
||||
app.kubernetes.io/component: canary
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
canary selector labels
|
||||
*/}}
|
||||
{{- define "loki-canary.selectorLabels" -}}
|
||||
{{ include "loki.selectorLabels" . }}
|
||||
app.kubernetes.io/component: canary
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Docker image name for loki-canary
|
||||
*/}}
|
||||
{{- define "loki-canary.image" -}}
|
||||
{{- $dict := dict "service" .Values.lokiCanary.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion -}}
|
||||
{{- include "loki.baseImage" $dict -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
canary priority class name
|
||||
*/}}
|
||||
{{- define "loki-canary.priorityClassName" -}}
|
||||
{{- $pcn := coalesce .Values.global.priorityClassName .Values.lokiCanary.priorityClassName .Values.read.priorityClassName -}}
|
||||
{{- if $pcn }}
|
||||
priorityClassName: {{ $pcn }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
123
opencloud/charts/loki/templates/loki-canary/daemonset.yaml
Normal file
123
opencloud/charts/loki/templates/loki-canary/daemonset.yaml
Normal file
@@ -0,0 +1,123 @@
|
||||
{{- with .Values.lokiCanary -}}
|
||||
{{- if .enabled -}}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: {{ include "loki-canary.fullname" $ }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
labels:
|
||||
{{- include "loki-canary.labels" $ | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "loki-canary.selectorLabels" $ | nindent 6 }}
|
||||
{{- with .updateStrategy }}
|
||||
updateStrategy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "loki-canary.selectorLabels" $ | nindent 8 }}
|
||||
{{- with .podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "loki-canary.fullname" $ }}
|
||||
{{- with $.Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- include "loki-canary.priorityClassName" $ | nindent 6 }}
|
||||
securityContext:
|
||||
{{- toYaml $.Values.loki.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: loki-canary
|
||||
image: {{ include "loki-canary.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.loki.image.pullPolicy }}
|
||||
args:
|
||||
- -addr={{- include "loki.host" $ }}
|
||||
- -labelname={{ .labelname }}
|
||||
- -labelvalue=$(POD_NAME)
|
||||
{{- if $.Values.enterprise.enabled }}
|
||||
- -user=$(USER)
|
||||
- -tenant-id=$(USER)
|
||||
- -pass=$(PASS)
|
||||
{{- else if $.Values.loki.auth_enabled }}
|
||||
- -user={{ $.Values.monitoring.selfMonitoring.tenant.name }}
|
||||
- -tenant-id={{ $.Values.monitoring.selfMonitoring.tenant.name }}
|
||||
- -pass={{ $.Values.monitoring.selfMonitoring.tenant.password }}
|
||||
{{- end }}
|
||||
{{- if .push }}
|
||||
- -push=true
|
||||
{{- end }}
|
||||
{{- with .extraArgs }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml $.Values.loki.containerSecurityContext | nindent 12 }}
|
||||
volumeMounts:
|
||||
{{- with $.Values.lokiCanary.extraVolumeMounts }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
containerPort: 3500
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
{{ if $.Values.enterprise.enabled }}
|
||||
- name: USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "enterprise-logs.selfMonitoringTenantSecret" $ }}
|
||||
key: username
|
||||
- name: PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "enterprise-logs.selfMonitoringTenantSecret" $ }}
|
||||
key: password
|
||||
{{- end -}}
|
||||
{{- with .extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .extraEnvFrom }}
|
||||
envFrom:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: http-metrics
|
||||
initialDelaySeconds: 15
|
||||
timeoutSeconds: 1
|
||||
{{- with .resources}}
|
||||
resources:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .dnsConfig }}
|
||||
dnsConfig:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- with $.Values.lokiCanary.extraVolumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
34
opencloud/charts/loki/templates/loki-canary/service.yaml
Normal file
34
opencloud/charts/loki/templates/loki-canary/service.yaml
Normal file
@@ -0,0 +1,34 @@
|
||||
{{- with .Values.lokiCanary -}}
|
||||
{{- if .enabled -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "loki-canary.fullname" $ }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
labels:
|
||||
{{- include "loki-canary.labels" $ | nindent 4 }}
|
||||
{{- with $.Values.loki.serviceLabels }}
|
||||
{{- toYaml . | nindent 4}}
|
||||
{{- end }}
|
||||
{{- with .service.labels }}
|
||||
{{- toYaml . | nindent 4}}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- with $.Values.loki.serviceAnnotations }}
|
||||
{{- toYaml . | nindent 4}}
|
||||
{{- end }}
|
||||
{{- with .service.annotations }}
|
||||
{{- toYaml . | nindent 4}}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: 3500
|
||||
targetPort: http-metrics
|
||||
protocol: TCP
|
||||
selector:
|
||||
{{- include "loki-canary.selectorLabels" $ | nindent 4 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- with .Values.lokiCanary -}}
|
||||
{{- if .enabled -}}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "loki-canary.fullname" $ }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
labels:
|
||||
{{- include "loki-canary.labels" $ | nindent 4 }}
|
||||
{{- with .annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
automountServiceAccountToken: {{ $.Values.serviceAccount.automountServiceAccountToken }}
|
||||
{{- with $.Values.serviceAccount.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user