-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Document how clients not on K8s can join a DC in K8s #9438
Conversation
b7585a7
to
7e366d1
Compare
@@ -35,14 +48,68 @@ annotation `consul.hashicorp.com/auto-join-port` to an integer value or | |||
a named port to specify the port for the auto-join to return. This enables | |||
different pods to have different exposed ports. |
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.
In my testing, I did not need to add this annotation, even though I configured my server gossip port to be 9301. consul members
still successfully showed all members of the cluster.
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.
I think it's still useful documentation to have, but that's why I didn't include this annotation in the instructions below.
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.
Hmm that's interesting. Did you change the gossip ports on the servers or just the external client? I definitely see in the code that it's being used.
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.
weird, I don't know how the join could have worked without this? Wouldn't it try 8301 unless explicitly configured?
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.
@ishustava Yup, I did change the gossip port on the server to 9301. And the client just used -retry-join 'provider=k8s host_network=true label_selector="app=consul,component=server"'
to join the servers. I know its super weird I would expect it to use that code as well!
@lkysow Yup, I would have expected the external client agent fail to join because it would try 8301. However, when trying the exactly the steps here while replacing the retry-join with -retry-join 'provider=k8s host_network=true label_selector="app=consul,component=server"'
I observed it joining just fine and on port 9301, which is definitely mind boggling.
I will retry those steps one more time tomorrow morning just to make sure.
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.
Update: I ran through the steps with -retry-join 'provider=k8s host_network=true label_selector="app=consul,component=server"'
on the external agent without the annotation and it works. In fact, when I do add the annotation, it doesn't accept an integer value, and if I add the port "9301" as a string, the consul clients on k8s itself fail to join saying no consul servers found.
I think for these docs I should remove this annotation, since it doesn't seem to work. wdyt @ishustava @lkysow?
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.
As discussed lets:
- Add a warning that if you're using 9301 and your consul servers are on different nodes (which is unlikely because in that case you wouldn't need to use 9301) then you can't use autojoin
- Create a bug in go-discover about the annotation issue
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.
I removed the note about the annotation since its currently broken (we can add it back once the bug is fixed in go-discover), and added the note/warning about default port. I phrased it a bit differently, let me know if you think its clear or not
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.
Writing the bug right now. EDIT: hashicorp/go-discover#166
7e366d1
to
334db2e
Compare
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.
Looking pretty good! Thanks so much for doing this work and writing the docs; I like that the networking requirements sound much more clear now! I've left a few edits and suggestions, and once those are resolved, it's good to go!
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Show resolved
Hide resolved
@@ -35,14 +48,68 @@ annotation `consul.hashicorp.com/auto-join-port` to an integer value or | |||
a named port to specify the port for the auto-join to return. This enables | |||
different pods to have different exposed ports. |
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.
Hmm that's interesting. Did you change the gossip ports on the servers or just the external client? I definitely see in the code that it's being used.
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
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.
This is looking great!
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
website/content/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes.mdx
Outdated
Show resolved
Hide resolved
@@ -35,14 +48,68 @@ annotation `consul.hashicorp.com/auto-join-port` to an integer value or | |||
a named port to specify the port for the auto-join to return. This enables | |||
different pods to have different exposed ports. |
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.
weird, I don't know how the join could have worked without this? Wouldn't it try 8301 unless explicitly configured?
334db2e
to
6cac706
Compare
6cac706
to
0658035
Compare
@lkysow @ishustava Thank you so much for the thorough reviews, it really helped. I think I've left open only the stuff worth taking another look at and resolved anything else. Going to re-request your reviews. |
gke-external-agent-default-pool-32d15192-vo7k 10.138.0.42:8301 alive client 1.9.1 2 dc1 <default> | ||
``` | ||
|
||
### Auto-join on via host ports |
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.
### Auto-join on via host ports | |
### Auto-join via host ports |
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.
💯 looks great! Just comment about not setting -client 0.0.0.0
since that exposes the HTTP API.
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.
🎉
0658035
to
8372b4d
Compare
8372b4d
to
6516083
Compare
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/307179. |
Documents hashicorp/consul-helm#740.
Also resolves/helps with hashicorp/consul-helm#743.