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

[DPE-4859] Make cloud-init optional #398

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,44 @@ 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/),
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.
Configure the system settings required by [OpenSearch](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/).

### Basic usage

To deploy a single unit of OpenSearch with default configuration, use:

```shell
juju deploy opensearch --channel=2/edge
```
cat <<EOF > 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

### 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 hypervisor:

```shell
sudo tee -a /etc/sysctl.conf > /dev/null <<EOT
vm.max_map_count=262144
vm.swappiness=0
net.ipv4.tcp_retries2=5
fs.file-max=1048576
EOT

sudo sysctl -p

juju model-config --file=./cloudinit-userdata.yaml
```

### Basic Usage
To deploy a single unit of OpenSearch using its default configuration.
### Customise system settings with cloud-init

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
juju deploy opensearch --channel=2/edge
cat <<EOF > 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
Expand All @@ -73,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`
Expand Down Expand Up @@ -109,11 +117,13 @@ 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.

## 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.
6 changes: 0 additions & 6 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
MODEL_CONFIG = {
"logging-config": "<root>=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' ]
""",
}


Expand Down
Loading