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

Configurable geo healthcheck host & path #67

Merged
merged 27 commits into from
Apr 5, 2018
Merged

Conversation

ross
Copy link
Contributor

@ross ross commented Jun 15, 2017

#This adds new octodns custom config values to records to support providing custom healthcheck paths and hosts. E.g.

'':
  geo:
    AS-JP:
    - 2.3.4.5
  octodns:
    healthcheck:
      host: foo.bar.io
      path: /_ok
  ttl: 60
  type: A
  value: 1.2.3.4 

NOTE: this will not clean up the previous Route53 healthchecks do to changes made in the way their CallerRefereneces work.

ross added 3 commits June 15, 2017 09:04
- This reworks the CallerReference structure for Route53 health checks in a
  non-backwards compatible way. This means records will create new healthchecks
  for themselves which should be fine.
- Since we're pre 1.0, support has NOT been added to cleanup the old
  healthchecks. That could be done reasonably easy, BUT we'd have to keep that
  around forever. The hope is that the new ref format/usage will prevent this
  problem going forward since enough info exists in the ref to identify things
  fully. :fingers_crossed:
- healthcheck GC is much cleaner and more robust thanks to ^
- overall the healthcheck management code is a bit easier to follow and more
  robust now.
@ross ross self-assigned this Jun 15, 2017
ross added 7 commits June 20, 2017 11:44
…t configed

Fixes an issue where we'd be looking for custom healthcheck config on the
existing record object (from the provider) which would never have a custom
setup. Instead looking at desired lets us find what's actually configured to be
the case
Also fixes some mocking data to match what the Dyn client libs are
expecting.
More thorough unit tests while I'm in here. Ended up doing some hacks/monkey
patching of DSFMonitor as the client library's object doesn't seem to be fully
functional/useful and has inconsitent behavior.
Would have prevented both A and AAAA exisiting on the same node.
@jespada
Copy link

jespada commented Feb 9, 2018

@ross can I some how help with this PR so it gets merged :) ?

@@ -64,7 +64,8 @@ def plan(self, desired):
self.log.info('plan: filtered out %s changes', before - after)

# allow the provider to add extra changes it needs
extra = self._extra_changes(existing, changes)
extra = self._extra_changes(existing=existing, desired=desired,
changes=changes)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change allows providers to catch them by name rather than position and thus ignore the params they don't want with **kwargs.

@@ -230,7 +230,7 @@ class Route53Provider(BaseProvider):

# This should be bumped when there are underlying changes made to the
# health check config.
HEALTH_CHECK_VERSION = '0000'
HEALTH_CHECK_VERSION = '0001'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to bump Route53's HC version, this will cause a replacement of all health-checks via _extra_changes including all Geo records in the plan.

ref = '{}:{}:{}'.format(self.HEALTH_CHECK_VERSION, record._type,
uuid4().hex[:16])
ref = '{}:{}:{}:{}'.format(self.HEALTH_CHECK_VERSION, record._type,
record.name, uuid4().hex[:16])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include the record name in the healthcheck ref, not just the type.

Copy link
Contributor

@theojulienne theojulienne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a minor naming fix suggestion, otherwise makes sense 👍

label)
extra.append(Update(record, record))
continue
if _monitor_matches(monitor, record.healthcheck_host,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_monitor_matches seems to actually be checking if the monitor has any differences to the variables provided. Possibly invert the logic?

Copy link
Contributor

@dbussink dbussink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have much strong opinions on the code itself, but it would be great to have this feature available to fix up ghe.io so it won't break again.

ross added 3 commits April 4, 2018 07:33
This will ensure unique refs for different zones. Without them the ref isn't
enough to make sure we're looking at the right thing (notably when we're
gc'ing old health checks.) This also adds a bit more debugging around health
checks.
@ross ross merged commit 94b8c57 into master Apr 5, 2018
@ross ross deleted the configurable-geo-healthcheck branch April 5, 2018 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants