Skip to content

Commit

Permalink
feat(helm): add extra environment variables and datadog tracing to ch…
Browse files Browse the repository at this point in the history
…arts (#212)

Closes #211
  • Loading branch information
christian-roggia authored Jan 1, 2021
1 parent b6f198f commit a79e8a0
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 21 deletions.
24 changes: 20 additions & 4 deletions helm/charts/hydra/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ spec:
secretKeyRef:
name: {{ include "hydra.secretname" . }}
key: dsn
{{- if .Values.hydra.env }}
{{- toYaml .Values.hydra.env | nindent 12 }}
{{- with .Values.deployment.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end}}
volumes:
Expand Down Expand Up @@ -118,6 +118,22 @@ spec:
periodSeconds: 10
failureThreshold: 5
env:
{{- if .Values.deployment.tracing.datadog.enabled }}
- name: TRACING_PROVIDER
value: datadog
- name: DD_ENV
value: {{ .Values.deployment.tracing.datadog.env | default "none" | quote }}
- name: DD_VERSION
value: {{ .Values.deployment.tracing.datadog.version | default .Values.image.tag | quote }}
- name: DD_SERVICE
value: {{ .Values.deployment.tracing.datadog.service | default "ory/hydra" | quote }}
{{- if .Values.deployment.tracing.datadog.useHostIP }}
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- end }}
{{- end }}
{{- $issuer := include "hydra.config.urls.issuer" . -}}
{{- if $issuer }}
- name: URLS_SELF_ISSUER
Expand All @@ -138,8 +154,8 @@ spec:
secretKeyRef:
name: {{ include "hydra.secretname" . }}
key: secretsCookie
{{- if .Values.hydra.env }}
{{- toYaml .Values.hydra.env | nindent 12 }}
{{- with .Values.deployment.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
Expand Down
55 changes: 40 additions & 15 deletions helm/charts/hydra/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ image:
# ORY Hydra image
repository: oryd/hydra
# ORY Hydra version
tag: v1.4.6
tag: v1.8.5
# Image pull policy
pullPolicy: IfNotPresent

Expand Down Expand Up @@ -108,20 +108,6 @@ hydra:
urls:
self: {}

# If you want to use Jaeger with agents being deployed in a daemonset, you can
# use the following ENV vars to configure the right endpoints using the IP
# address of the node the pod has been deployed to.
#
# env:
# - name: JAEGER_AGENT_HOST
# valueFrom:
# fieldRef:
# fieldPath: status.hostIP
# - name: TRACING_PROVIDERS_JAEGER_LOCAL_AGENT_ADDRESS
# value: $(JAEGER_AGENT_HOST):6831
# - name: TRACING_PROVIDERS_JAEGER_SAMPLING_SERVER_URL
# value: http://$(JAEGER_AGENT_HOST):5778

autoMigrate: false
dangerousForceHttp: false
dangerousAllowInsecureRedirectUrls: false
Expand Down Expand Up @@ -155,6 +141,45 @@ deployment:
# lines, adjust them as necessary, and remove the curly braces after 'nodeSelector:'.
# foo: bar

# If you want to use Jaeger with agents being deployed in a daemonset, you can
# use the following ENV vars to configure the right endpoints using the IP
# address of the node the pod has been deployed to.
#
# extraEnv:
# - name: JAEGER_AGENT_HOST
# valueFrom:
# fieldRef:
# fieldPath: status.hostIP
# - name: TRACING_PROVIDERS_JAEGER_LOCAL_AGENT_ADDRESS
# value: $(JAEGER_AGENT_HOST):6831
# - name: TRACING_PROVIDERS_JAEGER_SAMPLING_SERVER_URL
# value: http://$(JAEGER_AGENT_HOST):5778
extraEnv: []

# Configuration for tracing providers. Only datadog is currently supported through this block.
# If you need to use a different tracing provider, please manually set the configuration values
# via "hydra.config" or via "deployment.extraEnv".
tracing:
datadog:
enabled: false

# Sets the datadog DD_ENV environment variable. This value indicates the environment where hydra is running.
# Default value: "none".
# env: production

# Sets the datadog DD_VERSION environment variable. This value indicates the version that hydra is running.
# Default value: .Values.image.tag (i.e. the tag used for the docker image).
# version: X.Y.Z

# Sets the datadog DD_SERVICE environment variable. This value indicates the name of the service running.
# Default value: "ory/hydra".
# service: ory/hydra

# Sets the datadog DD_AGENT_HOST environment variable. This value indicates the host address of the datadog agent.
# If set to true, this configuration will automatically set DD_AGENT_HOST to the field "status.hostIP" of the pod.
# Default value: false.
# useHostIP: true

# Configure node tolerations.
tolerations: []

Expand Down
24 changes: 24 additions & 0 deletions helm/charts/kratos/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,27 @@ spec:
mountPath: /etc/config
readOnly: true
env:
{{- if .Values.deployment.tracing.datadog.enabled }}
-
name: TRACING_PROVIDER
value: datadog
-
name: DD_ENV
value: {{ .Values.deployment.tracing.datadog.env | default "none" | quote }}
-
name: DD_VERSION
value: {{ .Values.deployment.tracing.datadog.version | default .Values.image.tag | quote }}
-
name: DD_SERVICE
value: {{ .Values.deployment.tracing.datadog.service | default "ory/kratos" | quote }}
{{- if .Values.deployment.tracing.datadog.useHostIP }}
-
name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- end }}
{{- end }}
-
name: DSN
valueFrom:
Expand All @@ -76,6 +97,9 @@ spec:
name: {{ include "kratos.secretname" . }}
key: smtpConnectionURI
{{- end}}
{{- with .Values.deployment.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.deployment.environmentSecretsName }}
envFrom:
- secretRef:
Expand Down
28 changes: 27 additions & 1 deletion helm/charts/kratos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replicaCount: 1

image:
repository: oryd/kratos
tag: v0.5.2-alpha.1-sqlite
tag: v0.5.5-alpha.1-sqlite
pullPolicy: IfNotPresent

imagePullSecrets: []
Expand Down Expand Up @@ -116,6 +116,32 @@ deployment:
# lines, adjust them as necessary, and remove the curly braces after 'annotations:'.
# foo: bar

extraEnv: []

# Configuration for tracing providers. Only datadog is currently supported through this block.
# If you need to use a different tracing provider, please manually set the configuration values
# via "kratos.config" or via "deployment.extraEnv".
tracing:
datadog:
enabled: false

# Sets the datadog DD_ENV environment variable. This value indicates the environment where kratos is running.
# Default value: "none".
# env: production

# Sets the datadog DD_VERSION environment variable. This value indicates the version that kratos is running.
# Default value: .Values.image.tag (i.e. the tag used for the docker image).
# version: X.Y.Z

# Sets the datadog DD_SERVICE environment variable. This value indicates the name of the service running.
# Default value: "ory/kratos".
# service: ory/kratos

# Sets the datadog DD_AGENT_HOST environment variable. This value indicates the host address of the datadog agent.
# If set to true, this configuration will automatically set DD_AGENT_HOST to the field "status.hostIP" of the pod.
# Default value: false.
# useHostIP: true

# Configure node tolerations.
tolerations: []

Expand Down
19 changes: 19 additions & 0 deletions helm/charts/oathkeeper/templates/deployment-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ spec:
- name: MUTATORS_ID_TOKEN_CONFIG_JWKS_URL
value: "file:///etc/secrets/mutator.id_token.jwks.json"
{{- end }}
{{- if .Values.deployment.tracing.datadog.enabled }}
- name: TRACING_PROVIDER
value: datadog
- name: DD_ENV
value: {{ .Values.deployment.tracing.datadog.env | default "none" | quote }}
- name: DD_VERSION
value: {{ .Values.deployment.tracing.datadog.version | default .Values.image.tag | quote }}
- name: DD_SERVICE
value: {{ .Values.deployment.tracing.datadog.service | default "ory/oathkeeper" | quote }}
{{- if .Values.deployment.tracing.datadog.useHostIP }}
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
{{- end }}
{{- end }}
{{- with .Values.deployment.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: {{ include "oathkeeper.name" . }}-config-volume
mountPath: /etc/config
Expand Down
28 changes: 27 additions & 1 deletion helm/charts/oathkeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ image:
# ORY Oathkeeper image
repository: oryd/oathkeeper
# ORY Oathkeeper version
tag: v0.38.4-beta.1
tag: v0.38.5
# Image pull policy
pullPolicy: IfNotPresent

Expand Down Expand Up @@ -135,6 +135,32 @@ deployment:
# lines, adjust them as necessary, and remove the curly braces after 'annotations:'.
# foo: bar

extraEnv: []

# Configuration for tracing providers. Only datadog is currently supported through this block.
# If you need to use a different tracing provider, please manually set the configuration values
# via "oathkeeper.config" or via "deployment.extraEnv".
tracing:
datadog:
enabled: false

# Sets the datadog DD_ENV environment variable. This value indicates the environment where oathkeeper is running.
# Default value: "none".
# env: production

# Sets the datadog DD_VERSION environment variable. This value indicates the version that oathkeeper is running.
# Default value: .Values.image.tag (i.e. the tag used for the docker image).
# version: X.Y.Z

# Sets the datadog DD_SERVICE environment variable. This value indicates the name of the service running.
# Default value: "ory/oathkeeper".
# service: ory/oathkeeper

# Sets the datadog DD_AGENT_HOST environment variable. This value indicates the host address of the datadog agent.
# If set to true, this configuration will automatically set DD_AGENT_HOST to the field "status.hostIP" of the pod.
# Default value: false.
# useHostIP: true

# Configure node tolerations.
tolerations: []

Expand Down

0 comments on commit a79e8a0

Please sign in to comment.