-
Notifications
You must be signed in to change notification settings - Fork 9.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
Kubernetes failed to configure tls #14073
Comments
Hi @OverlyExcessive Firstly the outputs need to reference the certs/key with the appropriate index as output "client_cert" {
value = "${google_container_cluster.primary.master_auth.0.client_certificate}"
}
output "client_key" {
value = "${google_container_cluster.primary.master_auth.0.client_key}"
}
output "ca_cert" {
value = "${google_container_cluster.primary.master_auth.0.cluster_ca_certificate}"
} It may look confusing, but it's due to the current limitations of HCL. Secondly the certificates and key come from the GKE resource base64-encoded so the correct way of binding the modules would be e.g. module "container_cluster" {
source = "./gce-container-cluster"
credentials_path = "${var.credentials_path}"
project_name = "${var.project_name}"
region = "${var.region}"
cluster_name = "${var.cluster_name}"
cluster_zone = "${var.cluster_zone}"
master_auth_username = "${var.master_auth_username}"
master_auth_password = "${var.master_auth_password}"
}
module "kubernetes_secret" {
source = "./kubernetes-secret"
endpoint_ip = "${module.container_cluster.ip}"
username = "${var.master_auth_username}"
password = "${var.master_auth_password}"
client_cert = "${base64decode(module.container_cluster.client_cert)}"
client_key = "${base64decode(module.container_cluster.client_key)}"
cluster_ca_certificate = "${base64decode(module.container_cluster.ca_cert)}"
kubernetes_secret_pwd = "${var.kubernetes_secret_pwd}"
} There's a plan to solve this by automatically decoding anything that looks as "base64-decodable". See #12869 Thirdly there's a known core bug which breaks relationships between resource in one provider and another provider. This is tracked in #12393 and #4149 respectively. Do you agree we can close this issue in favour of the mentioned issues? Thanks. |
@radeksimko |
This resolves hashicorp/terraform#16417 and is a follow up to hashicorp/terraform#14073
* Document that GKE master_auth key is an array This resolves hashicorp/terraform#16417 and is a follow up to hashicorp/terraform#14073 * Update container_cluster.html.markdown * Update container_cluster.html.markdown * Update container_cluster.html.markdown
The advice to use base64decode() was very helpful to me in creating a configuration that used the Kubernetes provider against a k8s cluster provisioned by Terraform to GKE. Thanks! |
* Document that GKE master_auth key is an array This resolves hashicorp/terraform#16417 and is a follow up to hashicorp/terraform#14073 * Update container_cluster.html.markdown * Update container_cluster.html.markdown * Update container_cluster.html.markdown
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.9.3
Affected Resource(s)
Terraform Configuration Files
gce-container-cluster/main.tf
gce-container-cluster/outputs.tf
kubernetes-secret/main.tf
main.tf
Steps to Reproduce
terraform plan
Output
The text was updated successfully, but these errors were encountered: