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

scaleway_k8s_cluster_beta.kubeconfig not available during plan #395

Closed
hazcod opened this issue Feb 10, 2020 · 2 comments
Closed

scaleway_k8s_cluster_beta.kubeconfig not available during plan #395

hazcod opened this issue Feb 10, 2020 · 2 comments
Labels
k8s Kubernetes Kapsule issues, bugs and feature requests

Comments

@hazcod
Copy link

hazcod commented Feb 10, 2020

Terraform Version

v0.12.20

Affected Resource(s)

  • scaleway_k8s_cluster_beta

Terraform Configuration Files

output "kubeconfig" {
    sensitive = true
    value     = scaleway_k8s_cluster_beta.ironpeakbe-main-cluster.kubeconfig
}

Debug Output

https://github.com/ironPeakServices/infrastructure/runs/434527118?check_suite_focus=true

Expected Behavior

Scaleway provider outputs a temporary kubeconfig for use during plan phase.

Actual Behavior

No kubeconfig output is available, making the kubernetes provider (which uses the scaleway kubeconfig) dial to localhost.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan with no previous scaleway/kubernetes cluster in state.

References

@Sh4d1
Copy link
Contributor

Sh4d1 commented Feb 10, 2020

Hmm it's working for me:

❯ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # local_file.kubeconfig will be created
  + resource "local_file" "kubeconfig" {
      + content              = (known after apply)
      + directory_permission = "0777"
      + file_permission      = "0400"
      + filename             = "kubeconfig"
      + id                   = (known after apply)
    }

  # module.kubernetes.kubernetes_namespace.mainwebsite will be created
  + resource "kubernetes_namespace" "mainwebsite" {
      + id = (known after apply)

      + metadata {
          + annotations      = {
              + "env" = "prd"
            }
          + generation       = (known after apply)
          + labels           = {
              + "env"  = "prd"
              + "type" = "website"
            }
          + name             = "mainwebsite"
          + resource_version = (known after apply)
          + self_link        = (known after apply)
          + uid              = (known after apply)
        }
    }

  # module.kubernetes.kubernetes_secret.sa-github-mainwebsite-deployer will be created
  + resource "kubernetes_secret" "sa-github-mainwebsite-deployer" {
      + id   = (known after apply)
      + type = "kubernetes.io/service-account-token"

      + metadata {
          + annotations      = {
              + "kubernetes.io/service-account.name" = "github-mainwebsite-deployer"
            }
          + generation       = (known after apply)
          + name             = "sa-github-mainwebsite-deployer"
          + namespace        = "mainwebsite"
          + resource_version = (known after apply)
          + self_link        = (known after apply)
          + uid              = (known after apply)
        }
    }

  # module.kubernetes.kubernetes_service_account.github-mainwebsite-deployer will be created
  + resource "kubernetes_service_account" "github-mainwebsite-deployer" {
      + default_secret_name = (known after apply)
      + id                  = (known after apply)

      + metadata {
          + generation       = (known after apply)
          + name             = "github-mainwebsite-deployer"
          + namespace        = "mainwebsite"
          + resource_version = (known after apply)
          + self_link        = (known after apply)
          + uid              = (known after apply)
        }
    }

  # module.scaleway.scaleway_k8s_cluster_beta.ironpeakbe-main-cluster will be created
  + resource "scaleway_k8s_cluster_beta" "ironpeakbe-main-cluster" {
      + apiserver_url    = (known after apply)
      + cni              = "calico"
      + created_at       = (known after apply)
      + enable_dashboard = true
      + id               = (known after apply)
      + ingress          = "traefik"
      + kubeconfig       = (known after apply)
      + name             = "ironpeakbe-main-cluster"
      + organization_id  = (known after apply)
      + region           = (known after apply)
      + status           = (known after apply)
      + tags             = [
          + "k8s",
          + "ironpeakbe",
          + "main-cluster",
          + "prd",
        ]
      + updated_at       = (known after apply)
      + version          = "1.17.2"
      + wildcard_dns     = (known after apply)

      + autoscaler_config {
          + balance_similar_node_groups     = (known after apply)
          + disable_scale_down              = (known after apply)
          + estimator                       = (known after apply)
          + expander                        = (known after apply)
          + expendable_pods_priority_cutoff = (known after apply)
          + ignore_daemonsets_utilization   = (known after apply)
          + scale_down_delay_after_add      = (known after apply)
        }

      + default_pool {
          + autohealing       = true
          + autoscaling       = true
          + container_runtime = "containerd"
          + created_at        = (known after apply)
          + max_size          = 1
          + min_size          = 1
          + node_type         = "GP1-XS"
          + pool_id           = (known after apply)
          + size              = 1
          + status            = (known after apply)
          + updated_at        = (known after apply)
        }
    }

Plan: 5 to add, 0 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

Are you sure your state is empty?

@hazcod
Copy link
Author

hazcod commented Feb 10, 2020

Seems to be another issue, it's in my state.

@hazcod hazcod closed this as completed Feb 10, 2020
@remyleone remyleone added the k8s Kubernetes Kapsule issues, bugs and feature requests label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k8s Kubernetes Kapsule issues, bugs and feature requests
Projects
None yet
Development

No branches or pull requests

3 participants