-
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.
* feat: add OpenSearch * feat: unify ElasticSearch and OpenSearch configuration Changes: - set the same cluster and service name - unify tutor plugin configuration variables
- Loading branch information
Showing
16 changed files
with
277 additions
and
36 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
{{- $ca := genCA "opensearchca" 1825 }} | ||
{{- $cn := printf "opensearch-master.%s.local" .Release.Namespace }} | ||
{{- $cert := genSignedCert $cn nil (list $cn) 1825 $ca }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: opensearch-certificates | ||
type: Opaque | ||
data: | ||
"ca.crt": {{ $ca.Cert | b64enc | toYaml | indent 4}} | ||
"tls.key": {{ $cert.Key | b64enc | toYaml | indent 4}} | ||
"tls.crt": {{ print $cert.Cert $ca.Cert | b64enc | toYaml | indent 4}} | ||
--- | ||
{{- $password := randAlphaNum 32 }} | ||
{{- $password_bcrypt := $password | bcrypt }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: opensearch-credentials | ||
type: Opaque | ||
data: | ||
harmony_password: {{ $password | b64enc | quote }} | ||
internal_users.yml: {{ printf "---\n_meta:\n type: \"internalusers\"\n config_version: 2\n\nharmony:\n hash: \"%s\"\n reserved: true\n backend_roles:\n - \"admin\"\n description: \"Harmony admin user\"\n" $password_bcrypt | b64enc | quote }} |
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
Binary file not shown.
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
12 changes: 12 additions & 0 deletions
12
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/harmony_search/elasticsearch.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .base import BaseSearchAPI | ||
|
||
|
||
class ElasticSearchAPI(BaseSearchAPI): | ||
""" | ||
Helper class to interact with the ElasticSearch | ||
API on the deployed cluster. | ||
""" | ||
|
||
def __init__(self, namespace): | ||
super().__init__(namespace) | ||
self._curl_base = ["curl", "--insecure", "-u", "elastic:${ELASTIC_PASSWORD}"] |
13 changes: 13 additions & 0 deletions
13
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/harmony_search/opensearch.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from .base import BaseSearchAPI | ||
|
||
|
||
class OpenSearchAPI(BaseSearchAPI): | ||
""" | ||
Helper class to interact with the OpenSearch | ||
API on the deployed cluster. | ||
""" | ||
|
||
def __init__(self, namespace): | ||
super().__init__(namespace) | ||
# TODO: Make this configurable | ||
self._curl_base = ["curl", "--insecure", "-u", "harmony:${HARMONY_PASSWORD}"] |
Oops, something went wrong.