Fix Observability Issues and Startup Probe Failure #70
@@ -62,6 +62,10 @@ spec:
|
|||||||
{{- if .Values.observability.enabled }}
|
{{- if .Values.observability.enabled }}
|
||||||
- name: MANAGEMENT_METRICS_TAGS_APPLICATION
|
- name: MANAGEMENT_METRICS_TAGS_APPLICATION
|
||||||
value: {{ .Values.observability.metrics.applicationTag | quote }}
|
value: {{ .Values.observability.metrics.applicationTag | quote }}
|
||||||
|
{{- if .Values.observability.jsonLogging }}
|
||||||
|
- name: SPRING_PROFILES_ACTIVE
|
||||||
|
value: json-logging
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if $postgresEnv }}
|
{{- if $postgresEnv }}
|
||||||
{{- $postgresEnv | nindent 12 }}
|
{{- $postgresEnv | nindent 12 }}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{{- if and .Values.observability.enabled .Values.observability.vmagent.enabled (not .Values.observability.victoriaMetrics.operator.enabled) }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: {{ include "movienight.vmagentName" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "movienight.componentLabels" (dict "root" . "component" "vmagent") | nindent 4 }}
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["pods", "nodes", "nodes/proxy", "services", "endpoints"]
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: {{ include "movienight.vmagentName" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "movienight.componentLabels" (dict "root" . "component" "vmagent") | nindent 4 }}
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: {{ include "movienight.vmagentName" . }}
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ include "movienight.serviceAccountName" . }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- if and .Values.observability.enabled .Values.observability.victoriaMetrics.enabled }}
|
{{- if and .Values.observability.enabled .Values.observability.victoriaMetrics.enabled (not .Values.observability.victoriaMetrics.operator.enabled) }}
|
||||||
{{- if .Values.observability.victoriaMetrics.persistence.enabled }}
|
{{- if .Values.observability.victoriaMetrics.persistence.enabled }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{{- if and .Values.observability.enabled .Values.observability.vmagent.enabled .Values.observability.victoriaMetrics.operator.enabled }}
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMAgent
|
||||||
|
metadata:
|
||||||
|
name: {{ include "movienight.vmagentName" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "movienight.componentLabels" (dict "root" . "component" "vmagent") | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
scrapeInterval: {{ .Values.observability.vmagent.scrapeInterval }}
|
||||||
|
remoteWrite:
|
||||||
|
- url: {{ include "movienight.vmagentRemoteWriteURL" . }}
|
||||||
|
{{- with .Values.observability.vmagent.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
serviceScrapeSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "movienight.labels" . | nindent 6 }}
|
||||||
|
podScrapeSelector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "movienight.labels" . | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- if and .Values.observability.enabled .Values.observability.vmagent.enabled }}
|
{{- if and .Values.observability.enabled .Values.observability.vmagent.enabled (not .Values.observability.victoriaMetrics.operator.enabled) }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
@@ -19,13 +19,26 @@ data:
|
|||||||
{{- if .Values.backend.enabled }}
|
{{- if .Values.backend.enabled }}
|
||||||
- job_name: {{ .Values.observability.vmagent.backendJobName | quote }}
|
- job_name: {{ .Values.observability.vmagent.backendJobName | quote }}
|
||||||
metrics_path: /actuator/prometheus
|
metrics_path: /actuator/prometheus
|
||||||
static_configs:
|
kubernetes_sd_configs:
|
||||||
- targets:
|
- role: pod
|
||||||
- {{ include "movienight.backendMetricsTarget" . | quote }}
|
relabel_configs:
|
||||||
labels:
|
- source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_component]
|
||||||
app: {{ include "movienight.name" . | quote }}
|
action: keep
|
||||||
release: {{ .Release.Name | quote }}
|
regex: backend
|
||||||
namespace: {{ .Release.Namespace | quote }}
|
- source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance]
|
||||||
|
action: keep
|
||||||
|
regex: {{ .Release.Name | quote }}
|
||||||
|
- source_labels: [__meta_kubernetes_pod_container_port_name]
|
||||||
|
action: keep
|
||||||
|
regex: management
|
||||||
|
- action: labelmap
|
||||||
|
regex: __meta_kubernetes_pod_label_(.+)
|
||||||
|
- source_labels: [__meta_kubernetes_namespace]
|
||||||
|
action: replace
|
||||||
|
target_label: namespace
|
||||||
|
- source_labels: [__meta_kubernetes_pod_name]
|
||||||
|
action: replace
|
||||||
|
target_label: pod
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- job_name: {{ printf "%s-vmagent" (include "movienight.name" .) | quote }}
|
- job_name: {{ printf "%s-vmagent" (include "movienight.name" .) | quote }}
|
||||||
static_configs:
|
static_configs:
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
{{- if and .Values.observability.enabled .Values.observability.victoriaMetrics.enabled .Values.observability.victoriaMetrics.operator.enabled }}
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMPodScrape
|
||||||
|
metadata:
|
||||||
|
name: {{ include "movienight.fullname" . }}-backend
|
||||||
|
labels:
|
||||||
|
{{- include "movienight.componentLabels" (dict "root" . "component" "backend") | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
podMetricsEndpoints:
|
||||||
|
- port: management
|
||||||
|
path: /actuator/prometheus
|
||||||
|
{{- if .Values.observability.metrics.httpServerRequestsHistogram }}
|
||||||
|
relabelConfigs:
|
||||||
|
- targetLabel: application
|
||||||
|
replacement: {{ .Values.observability.metrics.applicationTag | quote }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "movienight.componentSelectorLabels" (dict "root" . "component" "backend") | nindent 6 }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{{- if and .Values.observability.enabled .Values.observability.victoriaMetrics.enabled .Values.observability.victoriaMetrics.operator.enabled }}
|
||||||
|
apiVersion: operator.victoriametrics.com/v1beta1
|
||||||
|
kind: VMSingle
|
||||||
|
metadata:
|
||||||
|
name: {{ include "movienight.victoriaMetricsName" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "movienight.componentLabels" (dict "root" . "component" "victoriametrics") | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
retentionPeriod: {{ .Values.observability.victoriaMetrics.retentionPeriod }}
|
||||||
|
{{- if .Values.observability.victoriaMetrics.persistence.enabled }}
|
||||||
|
storage:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.observability.victoriaMetrics.persistence.size }}
|
||||||
|
{{- with .Values.observability.victoriaMetrics.persistence.storageClass }}
|
||||||
|
storageClassName: {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.observability.victoriaMetrics.resources }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -93,10 +93,10 @@ backend:
|
|||||||
httpGet:
|
httpGet:
|
||||||
path: /actuator/health
|
path: /actuator/health
|
||||||
port: management
|
port: management
|
||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
timeoutSeconds: 5
|
timeoutSeconds: 5
|
||||||
failureThreshold: 24
|
failureThreshold: 12
|
||||||
|
|
||||||
gateway:
|
gateway:
|
||||||
enabled: false
|
enabled: false
|
||||||
@@ -125,8 +125,11 @@ observability:
|
|||||||
metrics:
|
metrics:
|
||||||
applicationTag: movienight
|
applicationTag: movienight
|
||||||
httpServerRequestsHistogram: true
|
httpServerRequestsHistogram: true
|
||||||
|
jsonLogging: true
|
||||||
victoriaMetrics:
|
victoriaMetrics:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
operator:
|
||||||
|
enabled: false
|
||||||
image:
|
image:
|
||||||
repository: docker.io/victoriametrics/victoria-metrics
|
repository: docker.io/victoriametrics/victoria-metrics
|
||||||
tag: v1.134.0
|
tag: v1.134.0
|
||||||
|
|||||||
@@ -58,9 +58,12 @@ spring:
|
|||||||
user-name-attribute: response
|
user-name-attribute: response
|
||||||
|
|
||||||
server:
|
server:
|
||||||
|
port: ${SERVER_PORT:8080}
|
||||||
shutdown: graceful
|
shutdown: graceful
|
||||||
|
|
||||||
management:
|
management:
|
||||||
|
server:
|
||||||
|
port: ${MANAGEMENT_SERVER_PORT:8081}
|
||||||
endpoints:
|
endpoints:
|
||||||
web:
|
web:
|
||||||
base-path: /actuator
|
base-path: /actuator
|
||||||
|
|||||||
@@ -5,12 +5,22 @@
|
|||||||
</encoder>
|
</encoder>
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<springProfile name="!file-logging">
|
<appender name="JSON_CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<springProfile name="!file-logging & !json-logging">
|
||||||
<root level="INFO">
|
<root level="INFO">
|
||||||
<appender-ref ref="CONSOLE"/>
|
<appender-ref ref="CONSOLE"/>
|
||||||
</root>
|
</root>
|
||||||
</springProfile>
|
</springProfile>
|
||||||
|
|
||||||
|
<springProfile name="json-logging">
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="JSON_CONSOLE"/>
|
||||||
|
</root>
|
||||||
|
</springProfile>
|
||||||
|
|
||||||
<springProfile name="file-logging">
|
<springProfile name="file-logging">
|
||||||
<appender name="JSON_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="JSON_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>logs/app.json</file>
|
<file>logs/app.json</file>
|
||||||
|
|||||||
Reference in New Issue
Block a user