Skip to content

Commit

Permalink
Merge pull request #39 from hazelops/CORE-721-web-chart-datadog-is-in…
Browse files Browse the repository at this point in the history
…tegrated

Datadog options integrated
  • Loading branch information
kobrikx authored Sep 10, 2024
2 parents 764aa5c + 3086052 commit d79bb35
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 91 deletions.
24 changes: 24 additions & 0 deletions charts/web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ metadata:
namespace: {{ .Values.global.env}}-{{ .Values.global.app.name}}
annotations:
link.argocd.argoproj.io/external-link: https://{{ .Values.global.app.name}}.{{ .Values.global.env}}.{{.Values.global.app.domain}}
{{- if .Values.global.datadog.enabled }}
ad.datadoghq.com/{{ .Values.global.app.name}}-deployment.logs: >-
[{
"source": {{ .Values.global.datadog.app_type}},
"service": "{{.Values.global.app.name}}-service",
{{- if .Values.global.datadog.log_multiline_detection }}
"auto_multi_line_detection": true,
"pattern" : {{ .Values.global.datadog.log_multiline_pattern}}
{{- end }}
}]
labels:
tags.datadoghq.com/env: {{ .Values.global.env}}
tags.datadoghq.com/service: {{ .Values.global.datadog.service }}
tags.datadoghq.com/version: {{ .Values.global.datadog.agent_version}}
{{- end }}
spec:
{{- if not .Values.global.hpa.enabled }}
# Replicas count
Expand All @@ -20,6 +35,15 @@ spec:
metadata:
labels:
app: {{ .Values.global.app.name}}
app.kubernetes.io/name: {{ .Values.global.app.name}}
{{- if .Values.global.datadog.enabled }}
tags.datadoghq.com/env: {{ .Values.global.env}}
tags.datadoghq.com/service: {{ .Values.global.app.name}}
tags.datadoghq.com/version: {{ .Values.global.datadog.version }}
admission.datadoghq.com/enabled: "true"
annotations:
admission.datadoghq.com/ruby-lib.version: {{ .Values.global.datadog.ruby_lib_version }}
{{- end }}
spec:
containers:
- name: container
Expand Down
237 changes: 146 additions & 91 deletions charts/web/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"required": [
"global"
],
"additionalProperties": true,
"properties": {
"global": {
"type": "object",
Expand All @@ -12,12 +13,14 @@
"istio",
"ingress",
"app",
"hpa",
"secrets",
"service",
"gateway",
"iam_roles"
"iam_roles",
"hpa",
"datadog"
],
"additionalProperties": true,
"properties": {
"env": {
"type": "string"
Expand All @@ -31,6 +34,7 @@
"domain",
"port"
],
"additionalProperties": true,
"properties": {
"enabled": {
"type": "boolean"
Expand Down Expand Up @@ -58,6 +62,7 @@
"domain",
"port"
],
"additionalProperties": true,
"properties": {
"enabled": {
"type": "boolean"
Expand All @@ -83,8 +88,12 @@
"region",
"containerName",
"domain",
"replicas"
"replicas",
"command",
"image",
"variables"
],
"additionalProperties": true,
"properties": {
"name": {
"type": "string"
Expand All @@ -100,6 +109,115 @@
},
"replicas": {
"type": "integer"
},
"command": {
"type": "string"
},
"image": {
"type": "object",
"required": [
"repository",
"tag",
"imagePullPolicy"
],
"additionalProperties": true,
"properties": {
"repository": {
"type": "string"
},
"tag": {
"type": "string"
},
"imagePullPolicy": {
"type": "string"
}
}
},
"variables": {
"type": "object",
"required": [
"list"
],
"additionalProperties": true,
"properties": {
"list": {
"type": "object",
"required": [
"APP_NAME"
],
"additionalProperties": true,
"properties": {
"APP_NAME": {
"type": "string"
}
}
}
}
}
}
},
"secrets": {
"type": "object",
"required": [
"app",
"list"
],
"additionalProperties": true,
"properties": {
"app": {
"type": "string"
},
"list": {
"type": "array",
"additionalItems": true,
"items": {
"type": "string"
},
"uniqueItems": false
}
}
},
"service": {
"type": "object",
"required": [
"port",
"targetPort"
],
"additionalProperties": true,
"properties": {
"port": {
"type": "integer"
},
"targetPort": {
"type": "integer"
}
}
},
"gateway": {
"type": "object",
"required": [
"tlsIssuer"
],
"additionalProperties": true,
"properties": {
"tlsIssuer": {
"type": "string"
}
}
},
"iam_roles": {
"type": "object",
"required": [
"r53",
"ssm"
],
"additionalProperties": true,
"properties": {
"r53": {
"type": "string"
},
"ssm": {
"type": "string"
}
}
},
Expand All @@ -112,6 +230,7 @@
"behavior",
"metrics"
],
"additionalProperties": true,
"properties": {
"enabled": {
"type": "boolean"
Expand All @@ -128,6 +247,7 @@
"scaleUp",
"scaleDown"
],
"additionalProperties": true,
"properties": {
"scaleUp": {
"type": "object",
Expand All @@ -139,6 +259,7 @@
"podsPeriodSeconds",
"selectPolicy"
],
"additionalProperties": true,
"properties": {
"stabilizationWindowSeconds": {
"type": "integer"
Expand Down Expand Up @@ -170,6 +291,7 @@
"podsPeriodSeconds",
"selectPolicy"
],
"additionalProperties": true,
"properties": {
"stabilizationWindowSeconds": {
"type": "integer"
Expand Down Expand Up @@ -199,6 +321,7 @@
"cpuUtilization",
"memoryUtilization"
],
"additionalProperties": true,
"properties": {
"cpuUtilization": {
"type": "integer"
Expand All @@ -207,110 +330,42 @@
"type": "string"
}
}
},
"command": {
"type": "string"
},
"image": {
"type": "object",
"required": [
"repository",
"tag",
"imagePullPolicy"
],
"properties": {
"repository": {
"type": "string"
},
"tag": {
"type": "string"
},
"imagePullPolicy": {
"type": "string"
}
}
},
"variables": {
"type": "object",
"required": [
"list"
],
"properties": {
"list": {
"type": "object",
"required": [
"APP_NAME"
],
"properties": {
"APP_NAME": {
"type": "string"
}
}
}
}
}
}
},
"secrets": {
"datadog": {
"type": "object",
"required": [
"app",
"list"
"enabled",
"agent_version",
"ruby_lib_version",
"app_type",
"log_multiline_detection",
"log_multiline_pattern"
],
"additionalProperties": true,
"properties": {
"app": {
"type": "string"
"enabled": {
"type": "boolean"
},
"list": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"service": {
"type": "object",
"required": [
"port",
"targetPort"
],
"properties": {
"port": {
"type": "integer"
"agent_version": {
"type": "string"
},
"targetPort": {
"type": "integer"
}
}
},
"gateway": {
"type": "object",
"required": [
"tlsIssuer"
],
"properties": {
"tlsIssuer": {
"ruby_lib_version": {
"type": "string"
}
}
},
"iam_roles": {
"type": "object",
"required": [
"r53",
"ssm"
],
"properties": {
"r53": {
},
"app_type": {
"type": "string"
},
"ssm": {
"log_multiline_detection": {
"type": "boolean"
},
"log_multiline_pattern": {
"type": "string"
}
}
}
}
}
}
}
}
14 changes: 14 additions & 0 deletions charts/web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@ global:
cpuUtilization: 50
# When the memory utilization in the pod is greater than 3Gi (could be changed)
memoryUtilization: 3Gi
# Datadog options:
datadog:
enabled: false
# For more information about agent_version, ruby_lib_version and other options, please refer:
# https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=traces# and https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=kubernetes#partial-configuration
agent_version: 'v7.54'
# Version of Ruby library for Datadog tracing
ruby_lib_version: 'v1.23.1'
# Set the app type here https://docs.datadoghq.com/containers/kubernetes/log/?tab=helm#configure-a-single-container
app_type: "ruby"
# Enable this to make Datadog detect multilined logs
log_multiline_detection: false
# If log_multiline_detection is true, then pattern should be set. For more info:
log_multiline_pattern: '^[A-Z],.\[.*'

0 comments on commit d79bb35

Please sign in to comment.