WIP - Working multi-snap cluster #77

Closed
wants to merge 7 commits into
from

Conversation

Projects
None yet
3 participants
Collaborator

chuckbutler commented Feb 19, 2017

DO NOT MERGE!

This is an open thread to track the progress and discuss the approach to the refactoring of the etcd layer to migrate from apt delivery => snaps.

This has implications on:

  • delivery mechanism
  • backup/restore
  • durable storage migration(s)

Initial deployment + upgrade code. Functional X node cluster. Does not survive leader termination.

WIP - Working multi-snap cluster
Initial deployment (non-upgrade) code. Functional X node cluster. Does not survive leader termination.
@@ -1,5 +1,5 @@
# This file is rendered by Juju, manual edits will not be persisted
-ETCD_DATA_DIR=/var/lib/etcd/default
+ETCD_DATA_DIR={{ etcd_data_dir }}/{{ unit_name }}.etcd
@chuckbutler

chuckbutler Feb 19, 2017

Collaborator

This now matches what the snap is doing. I'm not 100% positive we want to keep this nomenclature but I'm for keeping it in lockstep with the snap so it stays consistent.

reactive/etcd.py
+ else:
+ subject = "peer"
+
+ status_message = "{0} with {1} known {2}.".format(unit_health, peers,
@marcoceppi

marcoceppi Feb 20, 2017

Owner

Could we do this instead?

status_message = '{0} with {1} known peer{2}'.format(unit_health, peers, 's' if peers != 1 else '')
@chuckbutler

chuckbutler Feb 20, 2017

Collaborator

We could, I don't know what it buys us other than collapsing four lines into one, but at the sake of readability. I don't feel strongly either way however.

actions/snap-upgrade
+ else
+ # Install from the resource location, and check for correct snap.
+ MANUAL_SNAP=$(resource-get etcd)
+ snap install ${ETCD_MANUAL_SNAP} --classic
@battlemidget

battlemidget Feb 21, 2017

If you are installing a local snap you need to pass --dangerous as well

actions/snap-upgrade
+ snap refresh etcd --channel=${CONFIGURED_CHANNEL} --classic
+else
+ MANUAL_SNAP=$(resource-get etcd)
+ snap refresh ${MANUAL_SNAP}
@battlemidget

battlemidget Feb 21, 2017

Also i dont think snap refresh works for locally installed snaps

@marcoceppi

marcoceppi Feb 24, 2017

Owner

You'll need to just snap install /again/

@chuckbutler chuckbutler referenced this pull request in juju-solutions/bundle-canonical-kubernetes Feb 22, 2017

Closed

Migration to k8s v1.6 and etcd v3 #208

chuckbutler added some commits Feb 24, 2017

Adds etcd3 snap support (prelim)
Tested with 3.1.2.

- Refactors template rendering to the version listed as installed in
snapd.
- Adds etcd2/3 configuration templates
- Readme updates
- Removing amulet package from test dependencies.
Cleanup of restore and snap-upgrade work
- Move "migrate.py" work to snap-upgrade
- Refactores restore to be python based and works with both 2.x and 3.x
series.
- Changes default casing in actions.yaml bool params.
Refactor storage to work with $SNAP_DATA
Storage was historically temp mounted, migrated, then blindly mounted
over the default $ETCD_DATA path. This now refactores the storage to
work with snaps that have access to the 'pluggable-media' interface.

This particular feature depends on
markshuttle/etcd-snaps#4
Collaborator

chuckbutler commented Mar 9, 2017

Closing for a formal PR

@chuckbutler chuckbutler closed this Mar 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment