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

CRD source based on getting endpoints from CRD #657

Merged
merged 8 commits into from
Sep 5, 2018

Conversation

shashidharatd
Copy link

@shashidharatd shashidharatd commented Aug 1, 2018

This pr will allow one to define a CRD with embedded DNS records (in the form of Endpoints) and then make external-dns to monitor that CRD for Endpoints and rest of the usual magic of programming DNS server continues.

Ref: #555

Here is how to use it.

$ build/external-dns --source crd --crd-source-apiversion multiclusterdns.federation.k8s.io/v1alpha1 --crd-source-kind DNSEndpoint --provider inmemory --once --dry-run
INFO[0000] config: {Master: KubeConfig: Sources:[crd] Namespace: AnnotationFilter: FQDNTemplate: CombineFQDNAndAnnotation:false Compatibility: PublishInternal:false PublishHostIP:false ConnectorSourceServer:localhost:8080 Provider:inmemory GoogleProject: DomainFilter:[] ZoneIDFilter:[] AWSZoneType: AWSAssumeRole: AWSMaxChangeCount:4000 AWSEvaluateTargetHealth:true AzureConfigFile:/etc/kubernetes/azure.json AzureResourceGroup: CloudflareProxied:false InfobloxGridHost: InfobloxWapiPort:443 InfobloxWapiUsername:admin InfobloxWapiPassword: InfobloxWapiVersion:2.3.1 InfobloxSSLVerify:true DynCustomerName: DynUsername: DynPassword: DynMinTTLSeconds:0 OCIConfigFile:/etc/kubernetes/oci.yaml InMemoryZones:[] PDNSServer:http://localhost:8081 PDNSAPIKey: PDNSTLSEnabled:false TLSCA: TLSClientCert: TLSClientCertKey: Policy:sync Registry:txt TXTOwnerID:default TXTPrefix: Interval:1m0s Once:true DryRun:true LogFormat:text MetricsAddress::7979 LogLevel:info TXTCacheInterval:0s ExoscaleEndpoint:https://api.exoscale.ch/dns ExoscaleAPIKey: ExoscaleAPISecret: CRDSourceAPIVersion:multiclusterdns.federation.k8s.io/v1alpha1 CRDSourceKind:DNSEndpoint} 
INFO[0000] running in dry-run mode. No changes to DNS records will be made. 
INFO[0000] Connected to cluster at https://192.168.99.100:8443 
INFO[0000] CREATE: fs1.default.galactic.svc.dzone.io 180 IN A 192.168.99.216 
INFO[0000] CREATE: fs1.default.galactic.svc.us.dzone.io 180 IN A 192.168.99.216 
INFO[0000] CREATE: fs1.default.galactic.svc.us1.us.dzone.io 180 IN A 192.168.99.216 
INFO[0000] CREATE: fs1.default.galactic.svc.dzone.io 0 IN TXT "heritage=external-dns,external-dns/owner=default" 
INFO[0000] CREATE: fs1.default.galactic.svc.us.dzone.io 0 IN TXT "heritage=external-dns,external-dns/owner=default" 
INFO[0000] CREATE: fs1.default.galactic.svc.us1.us.dzone.io 0 IN TXT "heritage=external-dns,external-dns/owner=default"

/cc @linki @mtsr @pmorie @irfanurrehman

p.s: This pr includes 2 commits from relatively independent pr #655

@k8s-ci-robot k8s-ci-robot requested a review from linki August 1, 2018 16:54
@k8s-ci-robot
Copy link
Contributor

@shashidharatd: GitHub didn't allow me to request PR reviews from the following users: mtsr, irfanurrehman.

Note that only kubernetes-incubator members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

This pr will allow one to define a CRD with embedded DNS records (in the form of Endpoints) and then make external-dns to monitor that CRD for Endpoints and rest of the usual magic of programming DNS server continues.

Ref: #555

Here is how to use it.

$ build/external-dns --source generic --generic-source-crd-apiversion multiclusterdns.federation.k8s.io/v1alpha1 --generic-source-crd-kind DNSEndpoint --provider inmemory --once --dry-run
INFO[0000] config: {Master: KubeConfig: Sources:[generic] Namespace: AnnotationFilter: FQDNTemplate: CombineFQDNAndAnnotation:false Compatibility: PublishInternal:false PublishHostIP:false ConnectorSourceServer:localhost:8080 Provider:inmemory GoogleProject: DomainFilter:[] ZoneIDFilter:[] AWSZoneType: AWSAssumeRole: AWSMaxChangeCount:4000 AWSEvaluateTargetHealth:true AzureConfigFile:/etc/kubernetes/azure.json AzureResourceGroup: CloudflareProxied:false InfobloxGridHost: InfobloxWapiPort:443 InfobloxWapiUsername:admin InfobloxWapiPassword: InfobloxWapiVersion:2.3.1 InfobloxSSLVerify:true DynCustomerName: DynUsername: DynPassword: DynMinTTLSeconds:0 OCIConfigFile:/etc/kubernetes/oci.yaml InMemoryZones:[] PDNSServer:http://localhost:8081 PDNSAPIKey: PDNSTLSEnabled:false TLSCA: TLSClientCert: TLSClientCertKey: Policy:sync Registry:txt TXTOwnerID:default TXTPrefix: Interval:1m0s Once:true DryRun:true LogFormat:text MetricsAddress::7979 LogLevel:info TXTCacheInterval:0s ExoscaleEndpoint:https://api.exoscale.ch/dns ExoscaleAPIKey: ExoscaleAPISecret: GenericSourceCRDApiVer:multiclusterdns.federation.k8s.io/v1alpha1 GenericSourceCRDKind:DNSEndpoint} 
INFO[0000] running in dry-run mode. No changes to DNS records will be made. 
INFO[0000] Connected to cluster at https://192.168.99.100:8443 
INFO[0000] CREATE: fs1.default.galactic.svc.dzone.io 180 IN A 192.168.99.216 
INFO[0000] CREATE: fs1.default.galactic.svc.us.dzone.io 180 IN A 192.168.99.216 
INFO[0000] CREATE: fs1.default.galactic.svc.us1.us.dzone.io 180 IN A 192.168.99.216 
INFO[0000] CREATE: fs1.default.galactic.svc.dzone.io 0 IN TXT "heritage=external-dns,external-dns/owner=default" 
INFO[0000] CREATE: fs1.default.galactic.svc.us.dzone.io 0 IN TXT "heritage=external-dns,external-dns/owner=default" 
INFO[0000] CREATE: fs1.default.galactic.svc.us1.us.dzone.io 0 IN TXT "heritage=external-dns,external-dns/owner=default"

/cc @linki @mtsr @pmorie @irfanurrehman

p.s: This pr includes 2 commits from relatively independent pr #655

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot requested a review from pmorie August 1, 2018 16:54
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 1, 2018
@shashidharatd shashidharatd force-pushed the generic-source branch 2 times, most recently from fdf8414 to 6fb9afc Compare August 6, 2018 13:12
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 6, 2018
@shashidharatd
Copy link
Author

/cc @njuettner, PTAL. Thanks !

@njuettner njuettner self-assigned this Aug 6, 2018
Copy link
Member

@pmorie pmorie left a comment

Choose a reason for hiding this comment

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

Very interesting change, left a few comments.

@@ -185,7 +189,7 @@ func (cfg *Config) ParseFlags(args []string) error {
app.Flag("kubeconfig", "Retrieve target cluster configuration from a Kubernetes configuration file (default: auto-detect)").Default(defaultConfig.KubeConfig).StringVar(&cfg.KubeConfig)

// Flags related to processing sources
app.Flag("source", "The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, fake, connector)").Required().PlaceHolder("source").EnumsVar(&cfg.Sources, "service", "ingress", "fake", "connector")
app.Flag("source", "The resource types that are queried for endpoints; specify multiple times for multiple sources (required, options: service, ingress, fake, connector)").Required().PlaceHolder("source").EnumsVar(&cfg.Sources, "service", "ingress", "fake", "connector", "generic")
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if crd is a better name here than generic, but I'll leave that question to folks who have more review history than my basically zero in this repo :)

Copy link
Author

Choose a reason for hiding this comment

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

agree, crd source seems better.

@@ -194,6 +198,8 @@ func (cfg *Config) ParseFlags(args []string) error {
app.Flag("publish-internal-services", "Allow external-dns to publish DNS records for ClusterIP services (optional)").BoolVar(&cfg.PublishInternal)
app.Flag("publish-host-ip", "Allow external-dns to publish host-ip for headless services (optional)").BoolVar(&cfg.PublishHostIP)
app.Flag("connector-source-server", "The server to connect for connector source, valid only when using connector source").Default(defaultConfig.ConnectorSourceServer).StringVar(&cfg.ConnectorSourceServer)
app.Flag("generic-source-crd-apiversion", "Api version of the crd for generic source, format (group/version) valid only when using generic source").Default(defaultConfig.GenericSourceCRDApiVer).StringVar(&cfg.GenericSourceCRDApiVer)
Copy link
Member

Choose a reason for hiding this comment

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

It might be helpful to have an example in the flag description like test.k8s.io/v1alpha1 as you have used in the test.

Copy link
Member

Choose a reason for hiding this comment

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

Suggest also capitalizing API and CRD.

Copy link
Author

Choose a reason for hiding this comment

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

ok, would update.

@@ -194,6 +198,8 @@ func (cfg *Config) ParseFlags(args []string) error {
app.Flag("publish-internal-services", "Allow external-dns to publish DNS records for ClusterIP services (optional)").BoolVar(&cfg.PublishInternal)
app.Flag("publish-host-ip", "Allow external-dns to publish host-ip for headless services (optional)").BoolVar(&cfg.PublishHostIP)
app.Flag("connector-source-server", "The server to connect for connector source, valid only when using connector source").Default(defaultConfig.ConnectorSourceServer).StringVar(&cfg.ConnectorSourceServer)
app.Flag("generic-source-crd-apiversion", "Api version of the crd for generic source, format (group/version) valid only when using generic source").Default(defaultConfig.GenericSourceCRDApiVer).StringVar(&cfg.GenericSourceCRDApiVer)
app.Flag("generic-source-crd-kind", "Kind of the crd for generic source, valid only when using generic source").Default(defaultConfig.GenericSourceCRDKind).StringVar(&cfg.GenericSourceCRDKind)
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion, make the description here: Kind of the CRD for the generic source in API group and version specified by generic-source-crd-apiversion

Copy link
Author

Choose a reason for hiding this comment

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

will update.


// NewCRDClientForAPIVersionKind return rest client for the given apiVersion and kind of the CRD
func NewCRDClientForAPIVersionKind(client kubernetes.Interface, kubeConfig, kubeMaster, apiVersion, kind string) (*rest.RESTClient, *runtime.Scheme, error) {
if kubeConfig == "" {
Copy link
Member

Choose a reason for hiding this comment

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

Is this the same as using the in-cluster config?

Copy link
Author

Choose a reason for hiding this comment

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

yes, it is almost the same. if user has not set the kubeconfig path explicitly, it would look into standard path $HOME/.kube/config and if that is also not present then uses in-cluster config. I just reused the logic already done by external-dns in here https://github.com/kubernetes-incubator/external-dns/blob/master/source/store.go#L111

}

// DNSEndpointStatus defines the observed state
type DNSEndpointStatus struct {
Copy link
Member

Choose a reason for hiding this comment

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

Question: should we have part of the contract between such a CRD and external-dns that external-dns maintains status? We should have observedGeneration here.

Copy link
Author

@shashidharatd shashidharatd Aug 9, 2018

Choose a reason for hiding this comment

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

This is a good question, and mostly raises another off topic question about optimisation for all the sources in general. currently, all the sources does not seem to be using informer pattern. they just do List the object types from the kube client. It is so because the design of external-dns needs all the objects (providing Endpoint) to feed the planner, which then calculates what changes need to be done in DNS provider.

Coming to this source in particular, it also uses the List operation to get all the CRD objects for now. we could in future write an informer and do a watch, which would give us a local cache of these objects. In that scenario, having such a contract would may be meaningful. Also observedGeneration in status field makes sense for a single CRD object, but here we are dealing with list of such objects, and i am unsure how meaningful that is to maintain it.

Copy link
Member

Choose a reason for hiding this comment

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

Well - the a single instance of this resource is itself a list. I think observedGeneration makes sense as a status field. Otherwise, how do you know - as the controller or the user - that the controller has 'seen' a particular generation of the resource?

Copy link
Author

Choose a reason for hiding this comment

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

@pmorie, currently there is nothing in status, so observedGeneration does not make sense for such an object. It would be unnecessary complexity. wdyt?

Copy link
Author

Choose a reason for hiding this comment

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

@pmorie, now i have added the ObservedGeneration field in the Status according to the discussion. PTAL.

@shashidharatd shashidharatd changed the title Generic source based on getting endpoints from CRD crd source based on getting endpoints from CRD Aug 9, 2018
source/crd.go Outdated

config.ContentConfig.GroupVersion = &groupVersion
config.APIPath = "/apis"
config.ContentType = runtime.ContentTypeJSON
Copy link
Member

Choose a reason for hiding this comment

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

No need to specify the content-type by default it's "application/json"

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

source/crd.go Outdated
config.ContentConfig.GroupVersion = &groupVersion
config.APIPath = "/apis"
config.ContentType = runtime.ContentTypeJSON
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: serializer.NewCodecFactory(scheme)}
Copy link
Member

Choose a reason for hiding this comment

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

why not using ...{CodeFactory: scheme.Codecs} directly?

Copy link
Author

Choose a reason for hiding this comment

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

i did not find scheme.Codecs in the latest vendored code. Am i missing something.

source/crd.go Outdated
result := endpoint.DNSEndpointList{}
err := cs.crdClient.Get().
Namespace(cs.namespace).
Resource(strings.ToLower(cs.crdKind)+"s").
Copy link
Member

Choose a reason for hiding this comment

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

Can we somehow make this nicer?

Copy link
Author

Choose a reason for hiding this comment

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

Updated. however not sure what exactly you meant :)

@@ -142,6 +144,8 @@ var defaultConfig = &Config{
ExoscaleEndpoint: "https://api.exoscale.ch/dns",
ExoscaleAPIKey: "",
ExoscaleAPISecret: "",
CRDSourceAPIVersion: "",
Copy link
Member

Choose a reason for hiding this comment

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

what do you think of externaldns.k8s.io/v1alpha as APIVersion and DNSEndpoint as Kind for default settings?

Copy link
Author

Choose a reason for hiding this comment

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

Agree. Done

@@ -194,6 +198,8 @@ func (cfg *Config) ParseFlags(args []string) error {
app.Flag("publish-internal-services", "Allow external-dns to publish DNS records for ClusterIP services (optional)").BoolVar(&cfg.PublishInternal)
app.Flag("publish-host-ip", "Allow external-dns to publish host-ip for headless services (optional)").BoolVar(&cfg.PublishHostIP)
app.Flag("connector-source-server", "The server to connect for connector source, valid only when using connector source").Default(defaultConfig.ConnectorSourceServer).StringVar(&cfg.ConnectorSourceServer)
app.Flag("crd-source-apiversion", "API version of the CRD for crd source, e.g. `dns.k8s.io/v1alpha1`, valid only when using crd source").Default(defaultConfig.CRDSourceAPIVersion).StringVar(&cfg.CRDSourceAPIVersion)
Copy link
Member

Choose a reason for hiding this comment

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

dns.k8s.io/v1alpha1 -> externaldns.k8s.io/v1alpha1

Copy link
Author

Choose a reason for hiding this comment

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

Done

// Labels stores labels defined for the Endpoint
Labels Labels
Labels Labels `json:"labels,omitempty"`
}
Copy link
Member

Choose a reason for hiding this comment

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

There's currently a PR #650 which includes a ProviderSpecific field to set provider specific settings for endpoints.

Could you add it additionally?

Copy link
Author

Choose a reason for hiding this comment

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

Included.

@njuettner
Copy link
Member

Please add some documentation how to use it. This would be really helpful for customers, which like to use CRD.

@shashidharatd
Copy link
Author

@njuettner, Thanks for your comments. have tried addressing them. Also have added documentation on how to use CRD source. PTAL once again.
Request @pmorie to take a look too. Thanks !

@njuettner
Copy link
Member

@shashidharatd thank you for adding the documentation.

some notes from my side:

  • CRD manifest can be also applied manually or for what do I have ? If so can you add it in the documentation, like an example crd.yaml
  • An example how an object would look like, if I would create via kubectl apply -f dns-example.yaml

@shashidharatd
Copy link
Author

@njuettner, have added the crd manifest and an example. ptal. Thanks !

@njuettner
Copy link
Member

👍 for the hard work, thank you! From my point of view it looks good.

I would appreciate if @linki or @ideahitme could have a look again 🙂.

@shashidharatd
Copy link
Author

Thanks @njuettner, @linki / @ideahitme ptal

Copy link
Member

@pmorie pmorie left a comment

Choose a reason for hiding this comment

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

A couple notes and one question - am I missing something obvious?


### Details

CRD source watches for the user specified CRD to extract [Endpoints](https://github.com/kubernetes-incubator/external-dns/blob/master/endpoint/endpoint.go) from its `Spec`.
Copy link
Member

Choose a reason for hiding this comment

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

s/the user/a user/

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.


### Creating DNS Records

Create the objects of CRD type by filing in the fields of CRD and DNS record would be created accordingly.
Copy link
Member

Choose a reason for hiding this comment

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

filling

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.


### Registering CRD

Here is typical example of CRD which provides Endpoints to `CRD source`:
Copy link
Member

Choose a reason for hiding this comment

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

You should link to the example here so people know that there's an example the rest of this file is in terms of.

Copy link
Author

Choose a reason for hiding this comment

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

Added.

@@ -107,18 +109,25 @@ func (t Targets) IsLess(o Targets) bool {
return false
}

// ProviderSpecific holds configuration which is specific to individual DNS providers
type ProviderSpecific map[string]string
Copy link
Member

Choose a reason for hiding this comment

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

It's worth considering whether this should be a list of key-value pairs. Maps are supposed to be avoided per the API conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#lists-of-named-subobjects-preferred-over-maps

Copy link
Member

Choose a reason for hiding this comment

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

I think list of k-v pairs might be better because this is a contract many different types will have to implement.

Copy link
Author

Choose a reason for hiding this comment

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

This field is added by the ongoing pr #650. Its optional for the feature in this pr to work.
I would post the same comments in that pr. In this pr i have just added json tag for it.

type DNSEndpointStatus struct {
// The generation observed by the external-dns controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

👍

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// DNSEndpoint is the CRD wrapper for Endpoint
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest something like:

// DNSEndpoint is a contract that a user-specified CRD must implement to be used as a source for external-dns.

Copy link
Member

Choose a reason for hiding this comment

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

I would also call out that the user-specified CRD must have the status subresource.

Copy link
Author

Choose a reason for hiding this comment

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

Updated.

endpoints = append(endpoints, dnsEndpoint.Spec.Endpoints...)
dnsEndpoint.Status.ObservedGeneration = dnsEndpoint.Generation
// Update the ObservedGeneration
_, err = cs.UpdateStatus(&dnsEndpoint)
Copy link
Member

Choose a reason for hiding this comment

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

We should update the observed generation as we do work - it's not clear to me where this method is used. Am I missing something?

Copy link
Author

@shashidharatd shashidharatd Aug 22, 2018

Choose a reason for hiding this comment

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

Endpoints() is the interface method for Source. The controller calls the Source's Endpoint method and proceeds onto making necessary changes to DNS records in Provider. Source is a interface with just this Endpoints() method.

Copy link
Author

@shashidharatd shashidharatd left a comment

Choose a reason for hiding this comment

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

@pmorie, have tried addressing your comments. ptal, Thanks !


### Details

CRD source watches for the user specified CRD to extract [Endpoints](https://github.com/kubernetes-incubator/external-dns/blob/master/endpoint/endpoint.go) from its `Spec`.
Copy link
Author

Choose a reason for hiding this comment

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

Fixed.


### Registering CRD

Here is typical example of CRD which provides Endpoints to `CRD source`:
Copy link
Author

Choose a reason for hiding this comment

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

Added.


### Creating DNS Records

Create the objects of CRD type by filing in the fields of CRD and DNS record would be created accordingly.
Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -107,18 +109,25 @@ func (t Targets) IsLess(o Targets) bool {
return false
}

// ProviderSpecific holds configuration which is specific to individual DNS providers
type ProviderSpecific map[string]string
Copy link
Author

Choose a reason for hiding this comment

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

This field is added by the ongoing pr #650. Its optional for the feature in this pr to work.
I would post the same comments in that pr. In this pr i have just added json tag for it.

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// DNSEndpoint is the CRD wrapper for Endpoint
Copy link
Author

Choose a reason for hiding this comment

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

Updated.

endpoints = append(endpoints, dnsEndpoint.Spec.Endpoints...)
dnsEndpoint.Status.ObservedGeneration = dnsEndpoint.Generation
// Update the ObservedGeneration
_, err = cs.UpdateStatus(&dnsEndpoint)
Copy link
Author

@shashidharatd shashidharatd Aug 22, 2018

Choose a reason for hiding this comment

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

Endpoints() is the interface method for Source. The controller calls the Source's Endpoint method and proceeds onto making necessary changes to DNS records in Provider. Source is a interface with just this Endpoints() method.

@shashidharatd shashidharatd changed the title crd source based on getting endpoints from CRD CRD source based on getting endpoints from CRD Aug 23, 2018
@pmorie
Copy link
Member

pmorie commented Aug 28, 2018

My feedbacks have been addressed, thanks @shashidharatd

@pmorie
Copy link
Member

pmorie commented Sep 4, 2018

@linki @ideahitme We're very interested in getting this merged to use external-dns with federation-v2 - does either of you (or another maintainer) have bandwidth to review this PR?

@njuettner
Copy link
Member

njuettner commented Sep 5, 2018

I think let's merge it now. This seems to be fine and was already reviewed a lot. Thanks again @shashidharatd and @pmorie 👍

@njuettner njuettner merged commit a7ac4f9 into kubernetes-sigs:master Sep 5, 2018
@shashidharatd
Copy link
Author

Thanks @njuettner

@2rs2ts
Copy link

2rs2ts commented Sep 7, 2018

Is it possible to make latency-based route53 record sets with this feature?

@linki
Copy link
Member

linki commented Sep 11, 2018

Is it possible to make latency-based route53 record sets with this feature?

@shashidharatd do you know?

@shashidharatd
Copy link
Author

Is it possible to make latency-based route53 record sets with this feature?

Honestly, i have no idea. But the Endpoint definition is quite generic, if you can fit in the definition of latency-based route53 record sets inside the Endpoint, then pretty much you can make it.

lou-lan pushed a commit to lou-lan/external-dns that referenced this pull request May 11, 2022
* Update install.md

Add small comment about Windows elevated command prompt

* Update install.md

More precise description about the symbolic link requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants