Skip to content

Commit

Permalink
Configure DataDog Injection
Browse files Browse the repository at this point in the history
* Bump `bitnami/common@2.10.0` -> `bitnami/common@2.11.1`
* Bump `bitnami/mongodb@13.18.1` -> `bitnami/mongodb@13.18.4`
* Add ability to toggle DataDog APM Injection
  * Disabled for now
* `yarn global add node-gyp` in Dockerfile build stage
  • Loading branch information
rblaine95 committed Sep 22, 2023
1 parent 9c52534 commit f5bd696
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 21 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \
gcc \
make \
python3
RUN yarn global add node-gyp

WORKDIR /app
COPY yarn.lock package.json ./
Expand Down
12 changes: 12 additions & 0 deletions helm/trust-registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ environments:
dev:
values:
- namespace: trust-registry-dev
ddInjectEnabled: false
ddProfilingEnabled: false
prod:
values:
- namespace: trust-registry-prod
ddInjectEnabled: false
ddProfilingEnabled: false
---
repositories:
- name: bitnami
Expand All @@ -17,6 +21,14 @@ releases:
chart: ./trust-registry
values:
- ./trust-registry/conf/{{ .Environment.Name }}/values.yaml
- deploymentLabels:
tags.datadoghq.com/env: {{ .Environment.Name }}
podLabels:
tags.datadoghq.com/env: {{ .Environment.Name }}
admission.datadoghq.com/enabled: {{ quote .Values.ddInjectEnabled }}
set:
- name: extraEnvVars.ddProfilingEnabled
value: {{ .Values.ddProfilingEnabled }}
---
helmDefaults:
timeout: 300
Expand Down
8 changes: 4 additions & 4 deletions helm/trust-registry/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.10.0
version: 2.11.1
- name: mongodb
repository: oci://registry-1.docker.io/bitnamicharts
version: 13.18.1
digest: sha256:b054b97b15b33e681fb1c108d17312f802f6b5aa10a105c971bd0d83dafd687c
generated: "2023-09-06T13:44:52.210352+02:00"
version: 13.18.4
digest: sha256:a5807bbdb24b5c04f12046462e5893450b2ada35cb5f80014606475df3740091
generated: "2023-09-21T15:54:30.24679+02:00"
6 changes: 3 additions & 3 deletions helm/trust-registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: trust-registry
description: A Helm chart to deploy the SSI Trust Registry in Kubernetes
type: application
version: 0.1.2
version: 0.1.3

keywords:
- ssi
Expand All @@ -17,11 +17,11 @@ maintainers:
dependencies:
# https://github.com/bitnami/charts/tree/main/bitnami/common
- name: common
version: 2.10.0
version: 2.11.1
repository: oci://registry-1.docker.io/bitnamicharts
# https://github.com/bitnami/charts/tree/main/bitnami/mongodb
- name: mongodb
version: 13.18.1
version: 13.18.4
repository: oci://registry-1.docker.io/bitnamicharts
alias: mongodb
condition: mongodb.enabled
25 changes: 16 additions & 9 deletions helm/trust-registry/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ metadata:
name: {{ include "trust-registry.fullname" . }}
labels:
{{- include "trust-registry.labels" . | nindent 4 }}
{{- with .Values.deploymentLabels }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
Expand All @@ -16,14 +19,17 @@ spec:
annotations:
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
{{- end }}
labels:
{{- include "trust-registry.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
{{- end }}
spec:
{{- with .Values.initContainers }}
initContainers:
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -47,15 +53,16 @@ spec:
name: {{ include "trust-registry.fullname" . }}
{{- with .Values.extraEnvVars }}
env:
{{- range $k,$v := . }}
{{- range $k,$v := . }}
- name: {{ upper (snakecase $k) }}
{{- if typeIs "string" $v }}
value: {{ tpl $v $ }}
{{- else }}
{{- $type := printf "%s" (typeOf $v) }}
{{- if or (eq $type "string") (eq $type "float64") (eq $type "bool") }}
value: {{ tpl (toString $v) $ | quote }}
{{- else }}
{{- tpl (toYaml $v) $ | nindent 14 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: /health
Expand All @@ -74,7 +81,7 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.extraVolumeMounts }}
volumeMounts:
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 12 }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand All @@ -90,5 +97,5 @@ spec:
{{- end }}
{{- with .Values.extraVolumes }}
volumes:
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }}
{{- end }}
4 changes: 2 additions & 2 deletions helm/trust-registry/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
{{- range .tls }}
- hosts:
{{- range .hosts }}
- {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | quote }}
- {{ tpl . $ | quote }}
{{- end }}
secretName: {{ include "common.tplvalues.render" ( dict "value" .secretName "context" $ ) }}
{{- end }}
Expand Down Expand Up @@ -60,7 +60,7 @@ spec:
service:
name: {{ include "trust-registry.fullname" $ }}
port:
number: {{ $.Values.service.port }}
number: {{ default $.Values.service.port $paths.port }}
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion helm/trust-registry/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ metadata:
{{- include "trust-registry.labels" . | nindent 4 }}
stringData:
{{- range $k,$v := .Values.config }}
{{ upper (snakecase $k) }}: {{ tpl (toString .) $ | quote }}
{{ upper (snakecase $k) }}: {{ tpl (toString $v) $ | quote }}
{{- end }}
18 changes: 16 additions & 2 deletions helm/trust-registry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}
deploymentLabels:
# tags.datadoghq.com/env: <env>
tags.datadoghq.com/service: '{{ include "trust-registry.fullname" . }}'
tags.datadoghq.com/version: '{{ .Values.image.tag }}'
podAnnotations:
admission.datadoghq.com/js-lib.version: v4.15.0
podLabels:
# tags.datadoghq.com/env: <env>
tags.datadoghq.com/service: '{{ include "trust-registry.fullname" . }}'
tags.datadoghq.com/version: '{{ .Values.image.tag }}'
admission.datadoghq.com/enabled: 'false'

podSecurityContext:
fsGroup: 1000
Expand All @@ -45,7 +55,11 @@ db:
port: 27017
opts: ""

extraEnvVars: {}
extraEnvVars:
ddLogsInjection: true
# ddTraceSampleRate: 1
ddProfilingEnabled: false
ddRuntimeMetricsEnabled: true
# foo: bar # -> FOO
# fooBaz: baz # -> FOO_BAZ
# dbConnectionString: # -> DB_CONNECTION_STRING
Expand Down

0 comments on commit f5bd696

Please sign in to comment.