Operators Deep Dive
Graham Hayes / HP Ron Rickard / eBay Inc.
Operators Deep Dive Graham Hayes / HP Ron Rickard / eBay Inc. - - PowerPoint PPT Presentation
Operators Deep Dive Graham Hayes / HP Ron Rickard / eBay Inc. Graham Hayes - HP Cloud Ron Rickard Sr. Cloud Engineer, eBay Inc. rrickard@ebaysf.com irc.freenode.net: rjrjr Agenda Designate Overview Designate REST API Designate and Neutron
Graham Hayes / HP Ron Rickard / eBay Inc.
Graham Hayes - HP Cloud
○ More functionality is available in the REST API.
○ http://designate.readthedocs.org
Database DNS Server Backend Central API AMQP Keystone User
○ Servers ○ Domains ○ Records
○ Zone import/export ○ Top-Level Domains (TLDs) ○ Zone blacklists ○ Managed Floating IP PTR Records
○ http://designate.readthedocs.org/en/latest/rest.html
○ Servers ○ Domains ○ Records
GET/POST - /v2/zones/<id> - Content-Type text/dns
○ import zones in zonefile format ○ export zones in zonefile format
imports
GET/POST/PATCH - /v2/tlds/<id>
○ last label in domain name must be a TLD ○ the entire domain name cannot be a TLD
GET/POST/PATCH - /v2/blacklists/<id>
○ Example to prevent example.com. domain from being created: ■ ^example\\.com\\.$ ○ Example to prevent example.com. and subdomains of example.com. from being created: ■ ^([A-Za-z0-9_\-]+\\.)*example\\.com\\.$
Floating IP Reverse DNS
GET/PATCH - /v2/reverse/floatingips/<id>
○ Users can manage their own DNS, without support ○ Users can only set PTRs for IPs currently associated with their tenant
○ SQLAlchemy
○ PowerDNS ○ NSD4 ○ FreeIPA ○ DynECT ○ BIND (needs work)
○ Create, update, delete TSIG keys ○ Create, update, delete domains ○ Create, update, delete record set ○ Create, update, delete records
○ Pushes data using zone transfers (AXFR/IXFR) ○ Simplify backend drivers
○ http://designate.readthedocs.org/en/latest/backends.html
Database Central MiniDNS Customer Facing DNS Server Backend / Manager API
Automatic Record Creation
turns those events into DNS operations.
custom notification handlers.
○ Nova handler ○ Neutron handler
compute.instance.create.start/.error/. end compute.instance.delete.start/.end compute.instance.update compute.instance.rebuild.start/.end
network.create network.delete network.port.create network.port.delete floatingip.update.end floatingip.delete.start trove.instance.create trove.instance.delete
{"state_description": "", "availability_zone": null, "terminated_at": "", "ephemeral_gb": 0, "instance_type_id": 2, "message": "Success", "deleted_at": "", "reservation_id": "r-0fhyl6wq", "instance_id": "192c1697-bc90-483f-bffc-6f461dd793cc", "user_id": "7101d930ff084aab9136db2b359719e2", "fixed_ips": [{"floating_ips": [], "label": "private", "version": 4, "meta": {}, "address": "10.0.0.2", "type": "fixed"}], "hostname": "rontest", "state": "active", "launched_at": "2014-02-24T23:16:43.058572", "metadata": [], "node": "frodo", "ramdisk_id": "", "access_ip_v6": null, "disk_gb": 1, "access_ip_v4": null, "kernel_id": "", "image_name": "cirros-0.3.0-x86_64-disk", "host": "frodo", "display_name": "rontest", "image_ref_url": "http://192.168.56.35:9292/images/afd10e78-d2e2-41cf-b1f7-573d7c89ac18", "root_gb": 1, "tenant_id": "c8344a592b574589b531fe8956ef7ec1", "created_at": "2014-02-24T23:16:37.000000", "memory_mb": 512, "instance_type": "m1.tiny", "vcpus": 1, "image_meta": {"min_disk": "1", "container_format": "bare", "min_ram": "0", "disk_format": "qcow2", "base_image_ref": "afd10e78-d2e2-41cf-b1f7-573d7c89ac18"}, "architecture": null, "os_type": null, "instance_flavor_id": "1"}
class NotificationHandler(ExtensionPlugin): … @abc.abstractmethod def get_exchange_topics(self): """ Returns a tuple of (exchange, list(topics)) this handler wishes to receive notifications from. """
@abc.abstractmethod def get_event_types(self): """ Returns a list of event types this handler is capable of processing """ @abc.abstractmethod def process_notification(self, context, event_type, payload): """ Processes a given notification """ ...
Evolving custom notification handler: ○ Initial design: ■ Granular with a single forward and reverse zone per tenant ■ Context (user, tenant, token) taken from notification message ○ Final design: ■ VPC - Virtual Private Cloud (dev, prod, ext) ■ VPCs are implemented as special tenant (not seen by user):
■ tenants grouped into VPCs ■ many forward and reverse zones associated with VPC tenants
○ Final design (continued): ■ Nova instance metadata:
■ VPC name is mapped to VPC tenant in designate.conf:
admin_prodcos ■ service account is member of VPC tenants and used to add A and PTR records to Designate
def process_notification(self, context, event_type, payload): domain_id = self.central_api.find_option(context, “default_domain”) recordset = self.central_api.create_recordset(context, domain_id, {'name': name, 'type': type, 'ttl': ttl,}) address = {'version': 4, 'address': payload['floatingip']['floating_ip_address']} record_values = {'data': address['address']} self.central_api.create_record(context, domain_id, recordset['id'], record_values)
Make sure you have installed: VirtualBox (4.x) Vagrant (Latest)