Skip to content

Commit

Permalink
[DPE-4859] Make cloud-init optional
Browse files Browse the repository at this point in the history
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
  • Loading branch information
phvalguima authored Aug 15, 2024
1 parent 949f578 commit 44a8a4b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<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
sudo tee -a /etc/sysctl.conf > /dev/null <<EOT
vm.max_map_count=262144
vm.swappiness=0
Expand All @@ -48,8 +37,6 @@ fs.file-max=1048576
EOT
sudo sysctl -p
juju model-config --file=./cloudinit-userdata.yaml
```

### Basic Usage
Expand Down Expand Up @@ -111,6 +98,23 @@ juju remove-relation opensearch 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

### 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.
```
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
```

## 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.
Expand Down

0 comments on commit 44a8a4b

Please sign in to comment.