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

Output cluster's fqdn #251

Merged
merged 2 commits into from
Sep 29, 2022
Merged

Output cluster's fqdn #251

merged 2 commits into from
Sep 29, 2022

Conversation

lonegunmanb
Copy link
Member

Add new outputs: cluster_fqdn, cluster_portal_fqdn and cluster_private_fqdn

Fixes #250

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

Copy link
Collaborator

@zioproto zioproto left a comment

Choose a reason for hiding this comment

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

Please check if the test passes when cluster is not a private cluster.


output "cluster_private_fqdn" {
description = "The FQDN for the Kubernetes Cluster when private link has been enabled, which is only resolvable inside the Virtual Network used by the Kubernetes Cluster."
value = azurerm_kubernetes_cluster.main.private_fqdn
Copy link
Collaborator

Choose a reason for hiding this comment

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

This value in the terraform state is "" when not using private clusters:

 "private_fqdn": "",

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @zioproto sorry for the late reply, I've tested and confirmed that this private_fqdn will be empty string when we set aks's private_cluster_enabled to false.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK. Do you think is necessary to add a comment to the function assertOutputNotEmpty to clarify that this function can be used only when testing with private clusters ?
Let me know if it makes sense to add this comment in the code.
If in the future there will be a scenario with public clusters we want to make sure that assertOutputNotEmpty is not used because it will always fail. Thank you !

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's ok since output's description has described this output only works for private cluster, if we change this example to provision a public cluster in the future and somehow we forget to remove this assertOutputNotEmpty from our e2e test, the failed test will warn us and the we can figure out what's wrong quickly by reading description.

o, ok := output[name].(string)
assert.True(t, ok)
assert.NotEqual(t, "", o)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this testing passing when private cluster is not enabled and the value in the tf state is:

 "private_fqdn": "",

??

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lonegunmanb did you have an opportunity to look at this comment ? thanks :)

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #253, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #249, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@zioproto
Copy link
Collaborator

@lonegunmanb do you want to rebase this one on the current master ?

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #245, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

1 similar comment
@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #259, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #262, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@github-actions
Copy link
Contributor

MAIN BRANCH PUSH DETECTED DUE TO #260, THIS PR NEED TO BE UPDATED TO TRIGGER CI.

@zioproto
Copy link
Collaborator

LGTM

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.

Support for output private_fqdn
2 participants