cloudflare-operator icon indicating copy to clipboard operation
cloudflare-operator copied to clipboard

Proposal: Move from Annotations to CRD

Open adyanth opened this issue 2 years ago • 1 comments

Motivation

Manage Cloudflare configuration outside the service lifecycle.

Current Status

Currently, the service is annotated with several annotations that determine the behaviour of the Service Controller. The controller adds a finalizer to the service preventing it from being deleted until the DNS records are deleted. If #43 is to be implemented, a new set of annotations come in, making it difficult to track all the possibilities.

Implementation

Create a CRD (ServiceTunnel? TunnelBinding like RoleBinding?) that binds the service and the tunnel to be served from. All configurations can be optional fields in the CRD. Finalizers can be on the CRD rather than the service, with an optional service finalizer to prevent deletion. For #43, a CRD (AccessTunnel) can be created that binds the referred service to the generated deployment.

adyanth avatar Mar 27 '22 08:03 adyanth

This will also help to link the Tunnel to an existing service like the Ingress Controller's service. Also, when Load Balancer support is added, it will make adding it simple by inserting it right into the CRD.

https://github.com/adyanth/cloudflare-operator/pull/1#issuecomment-1123236806

adyanth avatar May 11 '22 08:05 adyanth