From 44a8a4bc37267889de0049078ab3d039bdac7307 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Thu, 15 Aug 2024 14:38:54 +0200 Subject: [PATCH 01/13] [DPE-4859] Make cloud-init optional Originally, cloud-init was mandatory to be set in order for OpenSearch to work. This PR updates the README and integration tests to remove this dependency, following recent charm changes. Closes #359 --- README.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ab7d3a879..91b8436c6 100644 --- a/README.md +++ b/README.md @@ -27,19 +27,8 @@ juju add-model opensearch ``` Configure the system settings required by [OpenSearch](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/), -we'll do that by creating and setting a [`cloudinit-userdata.yaml` file](https://juju.is/docs/olm/juju-model-config) on the model. As well as setting some kernel settings on the host machine. ``` -cat < cloudinit-userdata.yaml -cloudinit-userdata: | - postruncmd: - - [ 'echo', 'vm.max_map_count=262144', '>>', '/etc/sysctl.conf' ] - - [ 'echo', 'vm.swappiness=0', '>>', '/etc/sysctl.conf' ] - - [ 'echo', 'net.ipv4.tcp_retries2=5', '>>', '/etc/sysctl.conf' ] - - [ 'echo', 'fs.file-max=1048576', '>>', '/etc/sysctl.conf' ] - - [ 'sysctl', '-p' ] -EOF - sudo tee -a /etc/sysctl.conf > /dev/null < cloudinit-userdata.yaml +cloudinit-userdata: | + postruncmd: + - [ 'echo', 'net.ipv4.tcp_retries2=2', '>>', '/etc/sysctl.conf' ] + - [ 'sysctl', '-p' ] +EOF + +juju model-config --file=./cloudinit-userdata.yaml +``` + ## Contributing Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on enhancements to this charm following best practice guidelines, and [CONTRIBUTING.md](https://github.com/canonical/opensearch-operator/blob/main/CONTRIBUTING.md) for developer guidance. From ce22d3bf9ac40dcb36de722a03dd805d5c95c8b4 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Thu, 15 Aug 2024 14:40:58 +0200 Subject: [PATCH 02/13] Update README.md --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 91b8436c6..82cbf3628 100644 --- a/README.md +++ b/README.md @@ -27,25 +27,27 @@ juju add-model opensearch ``` Configure the system settings required by [OpenSearch](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/), -As well as setting some kernel settings on the host machine. + +### Basic Usage +To deploy a single unit of OpenSearch using its default configuration. + +```shell +juju deploy opensearch --channel=2/edge +``` + +### LXD Setup + +If you are using LXD as the backend for Juju, then most of the sysctl parameters need to be set manually on the host: ``` sudo tee -a /etc/sysctl.conf > /dev/null < Date: Thu, 15 Aug 2024 14:41:29 +0200 Subject: [PATCH 03/13] Update helpers.py --- tests/integration/helpers.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 4733605c2..3840ff4b5 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -39,12 +39,6 @@ MODEL_CONFIG = { "logging-config": "=INFO;unit=DEBUG", "update-status-hook-interval": "5m", - "cloudinit-userdata": """postruncmd: - - [ 'sysctl', '-w', 'vm.max_map_count=262144' ] - - [ 'sysctl', '-w', 'fs.file-max=1048576' ] - - [ 'sysctl', '-w', 'vm.swappiness=0' ] - - [ 'sysctl', '-w', 'net.ipv4.tcp_retries2=5' ] - """, } From 25f963f77929363cce4c665a3acfb51364bd8316 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:14:19 +0200 Subject: [PATCH 04/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82cbf3628..589d02e92 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ juju add-model opensearch Configure the system settings required by [OpenSearch](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/), -### Basic Usage +### Basic usage + To deploy a single unit of OpenSearch using its default configuration. ```shell From a327443d634c54dfbec9112febf49b66cdddcc21 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:14:32 +0200 Subject: [PATCH 05/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 589d02e92..564a25ca0 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Configure the system settings required by [OpenSearch](https://opensearch.org/do ### Basic usage -To deploy a single unit of OpenSearch using its default configuration. +To deploy a single unit of OpenSearch with default configuration, use: ```shell juju deploy opensearch --channel=2/edge From 5910e7d47ff027ffe6e4e7201549a55947f6f3eb Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:14:38 +0200 Subject: [PATCH 06/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 564a25ca0..8c50b4110 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ juju deploy opensearch --channel=2/edge ### LXD Setup If you are using LXD as the backend for Juju, then most of the sysctl parameters need to be set manually on the host: -``` + +```shell sudo tee -a /etc/sysctl.conf > /dev/null < Date: Wed, 4 Sep 2024 16:14:52 +0200 Subject: [PATCH 07/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8c50b4110..c0ed78a8d 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ juju remove-relation opensearch self-signed-certificates **Note:** The TLS settings shown here are for self-signed-certificates, which are not recommended for production clusters. The Self Signed Certificates Operator offers a variety of configuration options. Read more on the TLS Certificates Operator [here](https://charmhub.io/self-signed-certificates). ## Security + Security issues in the Charmed OpenSearch Operator can be reported through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File). Please do not file GitHub issues about security issues. ## Customizing From eebcafe00185c6f9c6018dc9c1cf49ed2fb41383 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:14:58 +0200 Subject: [PATCH 08/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0ed78a8d..136eaa9a6 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Security issues in the Charmed OpenSearch Operator can be reported through [Laun ## Customizing -### Update Sysctl via ' clout-init` +### Update Sysctl via clout-init Certain values can be configured with different cloud-init values. We'll do that by creating and setting a [`cloudinit-userdata.yaml` file](https://juju.is/docs/olm/juju-model-config) on the model. From ccb01848e62f25f42521d0838d973630087312e6 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:15:04 +0200 Subject: [PATCH 09/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 136eaa9a6..75012fcf8 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,8 @@ Security issues in the Charmed OpenSearch Operator can be reported through [Laun Certain values can be configured with different cloud-init values. We'll do that by creating and setting a [`cloudinit-userdata.yaml` file](https://juju.is/docs/olm/juju-model-config) on the model. -``` + +```shell cat < cloudinit-userdata.yaml cloudinit-userdata: | postruncmd: From 3e81c2640419a054b72b52bc1334afa550f08be9 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:15:09 +0200 Subject: [PATCH 10/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75012fcf8..77a09ba7d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ To deploy a single unit of OpenSearch with default configuration, use: juju deploy opensearch --channel=2/edge ``` -### LXD Setup +### LXD setup If you are using LXD as the backend for Juju, then most of the sysctl parameters need to be set manually on the host: From 15dba2a657a7a8915250d2be6b316b3c6abfabbc Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:15:17 +0200 Subject: [PATCH 11/13] Update README.md Co-authored-by: Vladimir Izmalkov <48120135+izmalk@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77a09ba7d..d7f0c2f46 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Bootstrap a [lxd controller](https://juju.is/docs/olm/lxd#heading--create-a-cont juju add-model opensearch ``` -Configure the system settings required by [OpenSearch](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/), +Configure the system settings required by [OpenSearch](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/). ### Basic usage From 599f7e2cba0e6adb20af7d5b7fa0d429221257b5 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 16:41:17 +0200 Subject: [PATCH 12/13] Update README.md --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index d7f0c2f46..733d0a748 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ juju deploy opensearch --channel=2/edge ### LXD setup -If you are using LXD as the backend for Juju, then most of the sysctl parameters need to be set manually on the host: +If you are using LXD as the backend for Juju, then most of the sysctl parameters need to be set manually on the hypervisor: ```shell sudo tee -a /etc/sysctl.conf > /dev/null < cloudinit-userdata.yaml +cloudinit-userdata: | + postruncmd: + - [ 'echo', 'net.ipv4.tcp_retries2=2', '>>', '/etc/sysctl.conf' ] + - [ 'sysctl', '-p' ] +EOF + +juju model-config --file=./cloudinit-userdata.yaml +``` + ## Relations / Integrations The relevant provided [relations](https://juju.is/docs/olm/relations) of Charmed OpenSearch are: @@ -64,6 +80,7 @@ juju integrate opensearch data-integrator ``` ### Large deployments: + Charmed OpenSearch also allows to form large clusters or join an existing deployment, through the relations: - `peer-cluster` - `peer-cluster-orchestrator` @@ -103,27 +120,10 @@ juju remove-relation opensearch self-signed-certificates Security issues in the Charmed OpenSearch Operator can be reported through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File). Please do not file GitHub issues about security issues. -## Customizing - -### Update Sysctl via clout-init - -Certain values can be configured with different cloud-init values. -We'll do that by creating and setting a [`cloudinit-userdata.yaml` file](https://juju.is/docs/olm/juju-model-config) on the model. - -```shell -cat < cloudinit-userdata.yaml -cloudinit-userdata: | - postruncmd: - - [ 'echo', 'net.ipv4.tcp_retries2=2', '>>', '/etc/sysctl.conf' ] - - [ 'sysctl', '-p' ] -EOF - -juju model-config --file=./cloudinit-userdata.yaml -``` - ## Contributing Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on enhancements to this charm following best practice guidelines, and [CONTRIBUTING.md](https://github.com/canonical/opensearch-operator/blob/main/CONTRIBUTING.md) for developer guidance. ## License + The Charmed OpenSearch Operator is free software, distributed under the Apache Software License, version 2.0. See [LICENSE](https://github.com/canonical/opensearch-operator/blob/main/LICENSE) for more information. From 97cb8e1ee4ed373e4c6587be3ff470d444b18960 Mon Sep 17 00:00:00 2001 From: phvalguima Date: Wed, 4 Sep 2024 17:14:21 +0200 Subject: [PATCH 13/13] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 733d0a748..2f0a95147 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,9 @@ EOT sudo sysctl -p ``` -### (Optional) customising: update sysctl via clout-init +### Customise system settings with cloud-init -Certain values can be configured with different cloud-init values. +Optionally, system can be configured with different cloud-init values than set by default. We'll do that by creating and setting a [`cloudinit-userdata.yaml` file](https://juju.is/docs/olm/juju-model-config) on the model. ```shell