Skip to content

Commit

Permalink
Merge pull request #215 from alphagov/upgrade_etcd_serial
Browse files Browse the repository at this point in the history
Ensure etcd cluster is updated serially
  • Loading branch information
mtekel committed Apr 19, 2016
2 parents 4974da3 + 0a57347 commit 7e629f7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
32 changes: 17 additions & 15 deletions manifests/cf-manifest/deployments/030-cf-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,6 @@ jobs:
services:
etcd: {}

- name: consul_z3
templates: (( grab meta.consul_templates ))
instances: 1
persistent_disk: 1024
resource_pool: small_z3
networks:
- name: cf3
static_ips:
properties:
consul:
agent:
mode: server
metron_agent:
zone: z3

- name: etcd_z2
templates: (( grab meta.etcd_templates ))
instances: 1
Expand All @@ -270,6 +255,8 @@ jobs:
networks:
- name: cf2
static_ips:
update:
serial: true
properties:
metron_agent:
zone: z2
Expand All @@ -278,6 +265,21 @@ jobs:
services:
etcd: {}

- name: consul_z3
templates: (( grab meta.consul_templates ))
instances: 1
persistent_disk: 1024
resource_pool: small_z3
networks:
- name: cf3
static_ips:
properties:
consul:
agent:
mode: server
metron_agent:
zone: z3

- name: etcd_z3
templates: (( grab meta.etcd_templates ))
instances: 1
Expand Down
10 changes: 7 additions & 3 deletions manifests/cf-manifest/spec/jobs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,21 @@ def ordered(job1_name, job2_name)
end
end

describe "in order to start one etcd master for consensus" do
describe "in order to start/upgrade etcd cluster while maintaining consensus" do
it "has etcd_z1 serial" do
expect(is_serial("etcd_z1")).to be true
end

it "has etcd_z2 serial" do
expect(is_serial("etcd_z2")).to be true
end

it "has etcd_z1 before etcd_z2" do
expect(ordered("etcd_z1", "etcd_z2")).to be true
end

it "has etcd_z1 before etcd_z3" do
expect(ordered("etcd_z1", "etcd_z3")).to be true
it "has etcd_z2 before etcd_z3" do
expect(ordered("etcd_z2", "etcd_z3")).to be true
end
end

Expand Down

0 comments on commit 7e629f7

Please sign in to comment.