-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat: add new flags to allow migration of OwnerID #4823
base: master
Are you sure you want to change the base?
Conversation
Welcome @troll-os! |
Hi @troll-os. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
Thanks @troll-os. It looks good. |
@mloiseleur Sure ! Where do you think it would fit the best? TXT registry ? |
With this PR, it works only with TXT registry, so yes. |
/ok-to-test |
/lgtm /assign @Raffo |
if im.isMigrationEnabled { | ||
filteredChanges.UpdateOld = append(filteredChanges.UpdateOld, endpoint.FilterEndpointsByOwnerID(im.oldOwnerID, changes.UpdateOld)...) | ||
filteredChanges.Delete = append(filteredChanges.Delete, endpoint.FilterEndpointsByOwnerID(im.oldOwnerID, changes.Delete)...) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the purpose of those lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to apply the changes which should include the deletion of the old entries in the registry, otherwise we're left we unmanaged and unwanted records
@troll-os answered to your comments. Could you please also provide a way to test this manually with manifests and kubectl commands? I would be eager to verify myself that the migration works and then keep an end to end test around. |
New changes are detected. LGTM label has been removed. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b5673a8
to
08dd8b4
Compare
So I had to make a change for the OVH provider to ensure record targets are properly formatted, I ran another batch of test to migrate from the Meaning that we couldn't map the record ID and the deletion would fail I don't know why this happens on a specific zones, the other zones covered seem fine... When I make direct calls to the OVH API the formatting is good... I didn't forget your query for manifests to tests the changes @Raffo, I'll make them ASAP |
…y are properly formatted for all operations, fixed regexp usage
So I did a little of homework and made this work with Gandi with a domain I own for personal use and minikube Steps used to reproduce on another setup than my work dev and prod environments :
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
annotations:
external-dns.alpha.kubernetes.io/hostname: helloworld.whatever.tld
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nginx
spec:
ingressClassName: nginx
rules:
- host: helloworld.whatever.tld
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
port:
number: 80
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
spec:
replicas: 1
selector:
matchLabels:
app: external-dns
strategy:
type: Recreate
template:
metadata:
labels:
app: external-dns
spec:
containers:
- name: external-dns
image: yourRegistry.com/external-dns:v-someBuildNumber # <<<<<<<<<<<<
args:
- "--txt-prefix=%{record_type}-"
- "--txt-cache-interval=15m"
- "--log-level=info"
- "--log-format=text"
- "--txt-owner-id=old-owner"
- "--policy=sync"
- "--provider=youDecide" # <<<<<<<<<<<<<<<<
- "--registry=txt"
- "--interval=1m"
- "--domain-filter=whatever.tld"
- "--source=ingress"
env:
- name: whatever_env_var_provider_needs
value: "hello"
apiVersion: apps/v1
kind: Deployment
metadata:
name: external-dns
spec:
replicas: 1
selector:
matchLabels:
app: external-dns
strategy:
type: Recreate
template:
metadata:
labels:
app: external-dns
spec:
containers:
- name: external-dns
image: yourRegistry.com/external-dns:v-someBuildNumber # <<<<<<<<<<<<
args:
- "--txt-prefix=%{record_type}-"
- "--txt-cache-interval=15m"
- "--log-level=info"
- "--log-format=text"
- "--txt-owner-id=new-owner"
- "--from-txt-owner=old-owner"
- "--migrate-txt-owner"
- "--policy=sync"
- "--provider=youDecide" # <<<<<<<<<<<<
- "--registry=txt"
- "--interval=1m"
- "--domain-filter=whatever.tld"
- "--source=ingress"
env:
- name: whatever_env_var_provider_needs
value: "hello"
|
Also I tried to follow the CoreDNS setup from the external-dns docs to have a non "external" provider dependent way to tests but didn't manage to make it work for some reason and I didn't want to spend too much time on it (probably a minikube issue) knowing that it worked with a classic provider |
Description
This pull requests aims to complete the work initiated in these PR : #2466 and #3631
Most credits go to the creators of the initial work, as I mostly just rebased their work on the current state of master
Initial PR description:
As for me I've successfully managed records without any issue using the newly added flags on the OVH provider
If anyone is willing to try these changes on other providers I'd be happy to troubleshoot their issues
Regarding the documentation I'm not sure either in which category these changes are relevant, so taking any recommendations on that
Note: this is my first contribution to such a project and first time using Go aswell, I've went through the contribution guidelines but if I missed something please let me know so that I can fix it
Fixes #2036
Checklist