Skip to content

Commit

Permalink
[DPE-5764] Add basic functionality (#3)
Browse files Browse the repository at this point in the history
This PR adds basic functionality to the etcd operator charm. It installs
the snap, creates the configuration for the initial cluster consisting
of the deployed units and starts the cluster.

Additions:
- basic source code structure in accordance with data-platform best
practice
- basic config manager
- basic implementation of peer-relation app/unit data handling
- basic state implementation for etcd-unit/server and etcd-cluster
- basic event handling for charm- and peer-relation-events such as
`on_install`, `on_start`, `on_peer_cluster_relation_created`
- basic unit test coverage

When deploying an etcd-cluster of n units, the charm sets up these units
and their config, creates the initial etcd-cluster and brings the units
into `active` status:
```
$ juju deploy ./charmed-etcd-operator_ubuntu-22.04-amd64.charm etcd -n 3
$ juju status
Model  Controller      Cloud/Region         Version  SLA          Timestamp
etcd   dev-controller  localhost/localhost  3.5.4    unsupported  15:24:28Z

App   Version  Status  Scale  Charm                  Channel  Rev  Exposed  Message
etcd           active      3  charmed-etcd-operator            20  no       

Unit      Workload  Agent  Machine  Public address  Ports  Message
etcd/27   active    idle   33       10.54.237.57           
etcd/28   active    idle   34       10.54.237.109          
etcd/29*  active    idle   35       10.54.237.30           

$ juju ssh etcd/27
# etcd.etcdctl endpoint health --endpoints=10.54.237.57:2379
10.54.237.57:2379 is healthy: successfully committed proposal: took = 2.017893ms

# etcd.etcdctl member list --endpoints=10.54.237.57:2379
7656a31b37f8b407, started, etcd29, http://10.54.237.30:2380, http://10.54.237.30:2379, false
b8a5a96e3126f130, started, etcd28, http://10.54.237.109:2380, http://10.54.237.109:2379, false
f7c51b64202cc9ca, started, etcd27, http://10.54.237.57:2380, http://10.54.237.57:2379, false
```

**Note:** The charm is currently still deploying the legacy-snap `etcd`.
  • Loading branch information
reneradoi authored Nov 21, 2024
1 parent 2107411 commit 8ab4111
Show file tree
Hide file tree
Showing 19 changed files with 5,666 additions and 54 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
with:
juju-agent-version: ${{ matrix.juju.agent }}
juju-snap-channel: ${{ matrix.juju.snap_channel }}
_beta_allure_report: ${{ matrix.juju.allure_report }}
artifact-prefix: packed-charm-cache-true
cloud: lxd
permissions:
Expand Down
Loading

0 comments on commit 8ab4111

Please sign in to comment.