Skip to content

Commit

Permalink
env lables annotations resources added (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
EliMoshkovich authored Nov 28, 2024
1 parent 0f8e388 commit 45147fd
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
44 changes: 43 additions & 1 deletion charts/pdp/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ spec:
metadata:
labels:
app: permitio-pdp
{{- if .Values.labels }}
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
annotations:
{{- if .Values.annotations }}
{{- range $key, $value := .Values.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
containers:
- name: permitio-pdp
Expand All @@ -26,6 +37,12 @@ spec:
secretKeyRef:
name: permitio-pdp-secret
key: ApiKey
{{- if .Values.pdp.pdpEnvs }}
{{- range .Values.pdp.pdpEnvs }}
- name: {{ .name }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
{{- if .Values.pdp.logs_forwarder.enabled }}
- name: PDP_OPA_DECISION_LOG_CONSOLE
value: "true"
Expand All @@ -38,6 +55,32 @@ spec:
- name: PDP_DEBUG
value: "true"
{{- end }}
{{- if hasKey .Values "dd_agent_envref_enabled" }}
{{- if .Values.dd_agent_envref_enabled }}
- name: DD_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: DD_ENV
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/env']
- name: DD_SERVICE
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/service']
- name: DD_VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['tags.datadoghq.com/version']
{{- end }}
{{- end }}
resources:
requests:
cpu: "{{ .Values.resources.requests.cpu }}"
memory: "{{ .Values.resources.requests.memory }}"
limits:
memory: "{{ .Values.resources.limits.memory }}"
livenessProbe:
httpGet:
path: /health
Expand All @@ -55,7 +98,6 @@ spec:
- name: logs
mountPath: /tmp/
{{- end }}
resources: {}
{{- if .Values.pdp.logs_forwarder.enabled }}
- name: fluentbit
image: fluent/fluent-bit:3.1.4
Expand Down
10 changes: 10 additions & 0 deletions charts/pdp/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
pdp:
pdpEnvs: []
# - name: custom_env
# value: "custom_env"
ApiKey: "<your PDP API Key>"
port: 7766
replicas: 1
Expand All @@ -16,3 +19,10 @@ pdp:
port: 443
index: "<elasticsearch index>"
debug_mode: false

resources:
requests:
cpu: "256m"
memory: "512Mi"
limits:
memory: "1Gi"

0 comments on commit 45147fd

Please sign in to comment.