From 9c0c93f9887fad55aaaed45e3ea5d1668768f330 Mon Sep 17 00:00:00 2001 From: Matthieu Huguet Date: Tue, 14 Jan 2020 14:54:43 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(forum)=20add=20static=20service=20for?= =?UTF-8?q?=20elastic=20search?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a static service for the forum elasticsearch, to be used easily by other applications. --- CHANGELOG.md | 1 + .../services/elasticsearch/static-svc.yml.j2 | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 apps/forum/templates/services/elasticsearch/static-svc.yml.j2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dff469e0..1bd6bb023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Versioning](http://semver.org/spec/v2.0.0.html). - `edxec` - `edxapp` - Introduce static services to expose services to other apps with a fixed name +- Add a static service for the elasticsearch forum ### Changed diff --git a/apps/forum/templates/services/elasticsearch/static-svc.yml.j2 b/apps/forum/templates/services/elasticsearch/static-svc.yml.j2 new file mode 100644 index 000000000..26f07483c --- /dev/null +++ b/apps/forum/templates/services/elasticsearch/static-svc.yml.j2 @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: forum + service: elasticsearch + version: "{{ forum_elasticsearch_image_tag }}" + deployment_stamp: "{{ deployment_stamp }}" + service_prefix: "{{ prefix }}" + type: static-service + removable: "no" + # name of the service should be database host name in settings + name: "{{ forum_elasticsearch_host }}-{{ prefix }}" + namespace: "{{ project_name }}" +spec: + ports: + - name: {{ forum_elasticsearch_port }}-tcp + port: {{ forum_elasticsearch_port }} + protocol: TCP + targetPort: {{ forum_elasticsearch_port }} + selector: + app: forum + deploymentconfig: "forum-elasticsearch-{{ deployment_stamp | default('undefined', true) }}" + type: ClusterIP