Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: k8s horizontal pod autoscaling #677

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Every user-facing change should have an entry in this changelog. Please respect

## Unreleased
- [Improvement] Make it possible to override k8s resources in plugins using `k8s-override` patch. (by @foadlind)
- [Improvement] Add patches for integrating with Horizontal Pod Autoscaler. (by @gabor-boros)

## v14.0.2 (2022-06-27)

Expand Down
33 changes: 19 additions & 14 deletions tutor/templates/config/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@
# This must be defined early
CADDY_HTTP_PORT: 80
CMS_HOST: "studio.{{ LMS_HOST }}"
CMS_MEMORY_REQUEST: 2Gi
CMS_OAUTH2_KEY_SSO: "cms-sso"
CMS_OAUTH2_KEY_SSO_DEV: "cms-sso-dev"
CONTACT_EMAIL: "contact@{{ LMS_HOST }}"
DEV_PROJECT_NAME: "{{ TUTOR_APP }}_dev"
DOCKER_COMPOSE_VERSION: "3.7"
DOCKER_REGISTRY: "docker.io/"
DOCKER_IMAGE_OPENEDX: "{{ DOCKER_REGISTRY }}overhangio/openedx:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_OPENEDX_DEV: "openedx-dev"
DOCKER_IMAGE_CADDY: "docker.io/caddy:2.4.6"
DOCKER_IMAGE_ELASTICSEARCH: "docker.io/elasticsearch:7.10.1"
DOCKER_IMAGE_MONGODB: "docker.io/mongo:4.2.17"
DOCKER_IMAGE_MYSQL: "docker.io/mysql:5.7.35"
DOCKER_IMAGE_OPENEDX: "{{ DOCKER_REGISTRY }}overhangio/openedx:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_OPENEDX_DEV: "openedx-dev"
DOCKER_IMAGE_PERMISSIONS: "{{ DOCKER_REGISTRY }}overhangio/openedx-permissions:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_REDIS: "docker.io/redis:6.2.6"
DOCKER_IMAGE_SMTP: "docker.io/devture/exim-relay:4.95-r0-2"
DOCKER_REGISTRY: "docker.io/"
EDX_PLATFORM_REPOSITORY: "https://github.com/openedx/edx-platform.git"
EDX_PLATFORM_VERSION: "{{ OPENEDX_COMMON_VERSION }}"
ELASTICSEARCH_HEAP_SIZE: 1g
ELASTICSEARCH_HOST: "elasticsearch"
ELASTICSEARCH_PORT: 9200
ELASTICSEARCH_SCHEME: "http"
ELASTICSEARCH_HEAP_SIZE: 1g
ENABLE_HTTPS: false
ENABLE_WEB_PROXY: true
JWT_COMMON_AUDIENCE: "openedx"
Expand All @@ -33,12 +34,17 @@ JWT_COMMON_SECRET_KEY: "{{ OPENEDX_SECRET_KEY }}"
K8S_NAMESPACE: "openedx"
LANGUAGE_CODE: "en"
LMS_HOST: "www.myopenedx.com"
LMS_MEMORY_REQUEST: 2Gi
LOCAL_PROJECT_NAME: "{{ TUTOR_APP }}_local"
MONGODB_HOST: "mongodb"
MONGODB_DATABASE: "openedx"
MONGODB_HOST: "mongodb"
MONGODB_PASSWORD: ""
MONGODB_PORT: 27017
MONGODB_USERNAME: ""
MONGODB_PASSWORD: ""
MYSQL_HOST: "mysql"
MYSQL_PORT: 3306
MYSQL_ROOT_USERNAME: "root"
NPM_REGISTRY: "https://registry.npmjs.org/"
OPENEDX_AWS_ACCESS_KEY: ""
OPENEDX_AWS_SECRET_ACCESS_KEY: ""
OPENEDX_CACHE_REDIS_DB: 1
Expand All @@ -51,16 +57,15 @@ OPENEDX_MYSQL_USERNAME: "openedx"
OPENEDX_COMMON_VERSION: "open-release/nutmeg.1"
OPENEDX_EXTRA_PIP_REQUIREMENTS:
- "openedx-scorm-xblock<14.0.0,>=13.0.0"
MYSQL_HOST: "mysql"
MYSQL_PORT: 3306
MYSQL_ROOT_USERNAME: "root"
NPM_REGISTRY: "https://registry.npmjs.org/"
OPENEDX_LMS_UWSGI_WORKERS: 2
OPENEDX_MYSQL_DATABASE: "openedx"
OPENEDX_MYSQL_USERNAME: "openedx"
PLATFORM_NAME: "My Open edX"
PREVIEW_LMS_HOST: "preview.{{ LMS_HOST }}"
REDIS_HOST: "redis"
REDIS_PASSWORD: ""
REDIS_PORT: 6379
REDIS_USERNAME: ""
REDIS_PASSWORD: ""
RUN_CMS: true
RUN_ELASTICSEARCH: true
RUN_LMS: true
Expand All @@ -69,8 +74,8 @@ RUN_MYSQL: true
RUN_REDIS: true
RUN_SMTP: true
SMTP_HOST: "smtp"
SMTP_PORT: 8025
SMTP_USERNAME: ""
SMTP_PASSWORD: ""
SMTP_USE_TLS: false
SMTP_PORT: 8025
SMTP_USE_SSL: false
SMTP_USE_TLS: false
SMTP_USERNAME: ""
10 changes: 8 additions & 2 deletions tutor/templates/k8s/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ spec:
name: config
resources:
requests:
memory: 2Gi
memory: {{ CMS_MEMORY_REQUEST }}
{{ patch("k8s-cms-deployment-resources")|indent(12) }}
securityContext:
allowPrivilegeEscalation: false
volumes:
Expand Down Expand Up @@ -144,6 +145,8 @@ spec:
name: settings-cms
- mountPath: /openedx/config
name: config
resources: {% if not patch("k8s-cms-worker-deployment-resources") %}{}{% endif %}
{{ patch("k8s-cms-worker-deployment-resources")|indent(14) }}
securityContext:
allowPrivilegeEscalation: false
volumes:
Expand Down Expand Up @@ -196,7 +199,8 @@ spec:
name: config
resources:
requests:
memory: 2Gi
memory: {{ LMS_MEMORY_REQUEST }}
{{ patch("k8s-lms-deployment-resources")|indent(12) }}
securityContext:
allowPrivilegeEscalation: false
volumes:
Expand Down Expand Up @@ -244,6 +248,8 @@ spec:
name: settings-cms
- mountPath: /openedx/config
name: config
resources: {% if not patch("k8s-lms-worker-deployment-resources") %}{}{% endif %}
{{ patch("k8s-lms-worker-deployment-resources")|indent(14) }}
securityContext:
allowPrivilegeEscalation: false
volumes:
Expand Down