Skip to content

Latest commit

 

History

History
62 lines (38 loc) · 2.42 KB

Header.md

File metadata and controls

62 lines (38 loc) · 2.42 KB

Par - Label Based DNS Operator

License: MIT Actions Status

Par is a DNS operator that allows you to control deployment DNS queries by labels without cluster administrative changes (ex. Istio sidecar )

It accomplishes this by changing the DNS policy of a deployment to point to the Operator DNS IP address then associating a client ID to pod ip addresses. This allows you to control the scope DNS response to a deployment's label.

Records Custom Resource Example

Forward Type

Manager

This type will update a deployment's pod template DNS configuration to the Operator's IP address. From now all DNS queries will be forwarded to the Operator. Once a DNS request is received, it will check the Records Custom Resource if an entry exist. If no entry is found it will default to the cluster's DNS.

Only the Records Custom Resource is needed for this configuration.

Proxy

The same initial setup happens as the Manager forward type, expect for that any DNS A Record Query will always return the proxy IP address. This will then force pod traffic through the proxy and from there the proxy will preform a DNS lookup from the Operator. In theory, any forward proxy can be used with this method if your able to implement the steps below.

Setup

The proxy deployment will need this label

  par.dev/proxy: "true"

and for the proxy configmap this label.

  par.dev/proxy-config: "true"

Inside the configmap will you need to add a go template tag .dnsResolver with the backticks like below. This is so the Operator can render the Operator DNA address in the configmap and forward DNS queries to the Operator.

serverBlock: |-
  server {
      listen 8080;

      location / {
          resolver {{ `{{ .dnsResolver }}` }};
          proxy_pass http://$http_host$request_uri;
          proxy_ssl_server_name on;
      }
  }

example nginx configuration

Then deploy your Records custom resource.