Skip to content

Commit

Permalink
feat: add newrelic manifests for tutor13 installation (eduNEXT#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariajgrimaldi authored Aug 8, 2022
1 parent 2b93163 commit 8990e08
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
1 change: 1 addition & 0 deletions drydock/templates/kustomized/tutor13/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ DRYDOCK_LMS_WORKER_LIMIT_CPU: 1
DRYDOCK_LMS_WORKER_LIMIT_MEMORY: "2Gi"
DRYDOCK_LMS_WORKER_REQUEST_CPU: "600m"
DRYDOCK_LMS_WORKER_REQUEST_MEMORY: "1Gi"
DRYDOCK_NEWRELIC: False
10 changes: 10 additions & 0 deletions drydock/templates/kustomized/tutor13/extensions/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ resources:
{% if DRYDOCK_HPA|default(false) and DRYDOCK_ENABLE_OVERRIDES|default(false) -%}
- hpa.yml
{% endif -%}

{% if DRYDOCK_NEWRELIC -%}
configMapGenerator:
- name: newrelic-cm
files:
- newrelic.ini
options:
labels:
app.kubernetes.io/name: openedx
{% endif -%}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ DRYDOCK_NEWRELIC_CONFIG }}
33 changes: 33 additions & 0 deletions drydock/templates/kustomized/tutor13/extensions/overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,37 @@ spec:
memory: "{{ DRYDOCK_CMS_WORKER_REQUEST_MEMORY }}"
---
{% endif -%}
{%- if DRYDOCK_NEWRELIC -%}
apiVersion: apps/v1
kind: Deployment
metadata:
name: lms
spec:
template:
spec:
containers:
- name: lms
args:
- |
newrelic-admin run-program uwsgi \
--static-map /static=/openedx/staticfiles/ \
--static-map /media=/openedx/media/ \
--http 0.0.0.0:8000 --thunder-lock \
--single-interpreter --enable-threads \
--processes=${UWSGI_WORKERS:-2} \
--buffer-size=8192 \
--wsgi-file $SERVICE_VARIANT/wsgi.py
command: ["/bin/bash", "-c"]
env:
- name: NEW_RELIC_CONFIG_FILE
value: /openedx/newrelic/newrelic.ini
volumeMounts:
- mountPath: /openedx/newrelic/
name: newrelic-ini
volumes:
- configMap:
name: newrelic-cm
name: newrelic-ini
---
{% endif -%}
{{ patch("drydock-overrides") }}
4 changes: 3 additions & 1 deletion drydock/templates/kustomized/tutor13/kustomization.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: {{ K8S_NAMESPACE }}

resources:
- base
- extensions
{{ patch("drydock-kustomization-resources") }}

{%- if DRYDOCK_ENABLE_OVERRIDES %}
patchesStrategicMerge:
{%- if DRYDOCK_ENABLE_RESOURCE_MANAGEMENT or patch("drydock-overrides") %}
{%- if DRYDOCK_ENABLE_RESOURCE_MANAGEMENT or patch("drydock-overrides") or DRYDOCK_NEWRELIC %}
- extensions/overrides.yml
{%- endif %}
{{ patch("drydock-kustomization-patches") }}
Expand Down

0 comments on commit 8990e08

Please sign in to comment.