-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure ES/OS cluster setup for shared usage (#73)
Signed-off-by: Gabor Boros <[email protected]> Co-authored-by: Matjaz Gregoric <[email protected]> Co-authored-by: Max Sokolski <[email protected]>
- Loading branch information
1 parent
92f7a0e
commit 8767df2
Showing
18 changed files
with
274 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/__about__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "17.0.0" | ||
__version__ = "18.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/patches/discovery-common-settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{%- if is_plugin_loaded("discovery") and K8S_HARMONY_ENABLE_SHARED_SEARCH_CLUSTER %} | ||
import os | ||
import ssl | ||
|
||
with open(os.getenv("ELASTICSEARCH_CA_PATH")) as ca_cert: | ||
ELASTICSEARCH_CA_CERT = ca_cert.read() | ||
|
||
ELASTICSEARCH_DSL['default'].update({ | ||
"use_ssl": True, | ||
"hosts": "{{ ELASTICSEARCH_HOST }}", | ||
"http_auth": "{{ K8S_HARMONY_SEARCH_CLUSTER_HTTP_AUTH }}", | ||
"ssl_context": ssl.create_default_context(cadata=ELASTICSEARCH_CA_CERT), | ||
}) | ||
{% endif %} |
33 changes: 33 additions & 0 deletions
33
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/patches/kustomization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Most of the open edX resources have volumes and volumeMounts, which means that | ||
# we can add an extra volume to their volume list. However, in some cases, like | ||
# the forum and forum-job, the resource does not define any volumes. This means, | ||
# we cannot have a common solution as adding extra volumes to non-existing list | ||
# breaks, while adding a volume definition to existing volumes replaces the | ||
# original set of volumes. We have to manually distinguish between resources. | ||
{%- set HAS_VOLUME = ["lms", "cms", "lms-job", "cms-job"] %} | ||
{%- set VOLUMELESS = [] %} | ||
|
||
{%- if is_plugin_loaded("discovery") %} | ||
{%- set HAS_VOLUME = HAS_VOLUME + ["discovery", "discovery-job"] %} | ||
{% endif %} | ||
|
||
{%- if is_plugin_loaded("forum") %} | ||
{%- set VOLUMELESS = VOLUMELESS + ["forum", "forum-job"] %} | ||
{% endif %} | ||
|
||
patches: | ||
- path: plugins/k8s_harmony/k8s/deployment-revision-history.yaml | ||
target: | ||
kind: Deployment | ||
{%- for res in HAS_VOLUME %} | ||
- path: plugins/k8s_harmony/k8s/shared-search-cert-patch.yaml | ||
target: | ||
kind: {% if "-job" in res %}Job{% else %}Deployment{% endif %} | ||
name: {{ res }}.* | ||
{%- endfor %} | ||
{%- for res in VOLUMELESS %} | ||
- path: plugins/k8s_harmony/k8s/shared-search-cert-patch-volumeless.yaml | ||
target: | ||
kind: {% if "-job" in res %}Job{% else %}Deployment{% endif %} | ||
name: {{ res }}.* | ||
{%- endfor %} |
Oops, something went wrong.