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

Add public IPv4 address of Traefik to output #16

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

dhoppe
Copy link
Contributor

@dhoppe dhoppe commented Jan 13, 2022

This output might be required by other Terraform modules to manage the DNS records.

@mysticaltech mysticaltech merged commit 6708ecb into kube-hetzner:master Jan 13, 2022
@dhoppe dhoppe deleted the add_output branch January 13, 2022 20:37
@mysticaltech
Copy link
Collaborator

Tried to merge this but it failed and had to revert it. Also, the type of LB is configured here. So not always going to be lb11.

I understand what you are trying to achieve, maybe we can find a better way.

@dhoppe
Copy link
Contributor Author

dhoppe commented Jan 13, 2022

This was just the name of the data source. The public IPv4 address will be fetched, based on the name traefik.

@mysticaltech
Copy link
Collaborator

Ok, I understand, will just change lb11 to lb and push it back then!

@mysticaltech
Copy link
Collaborator

It did not work because the lb is automatically provisioned by the CCM, not through terraform. So there is no way I know of acquiring its IP unless we ask Kubernetes somehow.

When deploying I get the following error:

Error: no Load Balancer found with name traefik
 
   with data.hcloud_load_balancer.lb,
   on data.tf line 17, in data "hcloud_load_balancer" "lb":
   17: data "hcloud_load_balancer" "lb" {

@mysticaltech
Copy link
Collaborator

@dhoppe If your concern is to have the lb IP to later configure DNS, this is easily solved by external-dns that can be installed in kube.

@mysticaltech
Copy link
Collaborator

mysticaltech commented Jan 13, 2022

You seem pretty advanced :) But just in case, gave an example of using external-dns at the end of issue #18

@dhoppe
Copy link
Contributor Author

dhoppe commented Jan 13, 2022

Hm. To be honest, the loadbalancer already existed when I tested this. Unfortunately my DNS provider is not supported by external-dns, yet.
kubernetes-sigs/external-dns#1980

@mysticaltech
Copy link
Collaborator

In that case, maybe there is a way to ask Kubernetes and grab the value, store it, and display that. Maybe with https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants