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

metrics-server deployment failing - failed to scrape node #1095

Open
joaozanuttoqr opened this issue Sep 6, 2023 · 0 comments
Open

metrics-server deployment failing - failed to scrape node #1095

joaozanuttoqr opened this issue Sep 6, 2023 · 0 comments

Comments

@joaozanuttoqr
Copy link

joaozanuttoqr commented Sep 6, 2023

I just started using the provider (version 1.26.0-alpha.1) with a basic configuration but I'm having trouble with the metrics-server. It fails to scrape node metrics with the error message:

E0906 16:54:20.683294       1 scraper.go:140] "Failed to scrape node" err="Get \"https://i-04cb08573c1656c4f.ec2.internal:10250/metrics/resource\": dial tcp: lookup i-04cb08573c1656c4f.ec2.internal on 100.64.0.10:53: no such host" node="i-04cb08573c1656c4f"

I found this workaround where I had to manually edit the metrics-server deployment and add the --kubelet-preferred-address-types=InternalIP arg and it worked, but I wanted it to be configured on cluster startup. Is it possible to add an input variable in the metrics_server_config in order to allow custom args? Or is there an easier solution that I'm missing?

I'm running a single control-plane node with two worker nodes on AWS. My current cluster config is looking like this:

resource "kops_cluster" "cluster" {
  name               = "${var.cluster_name}.${var.domain}"
  kubernetes_version = "1.26.8"
  dns_zone           = var.domain

  networking {
    calico {}

    network_id = aws_vpc.vpc.id
    topology {
      control_plane = "private"
      nodes         = "private"
      dns           = "Public"
    }
    dynamic "subnet" {
      for_each = ["a", "b", "c"]
      content {
        name = "private-${subnet.key}"
        type = "Private"
        zone = "us-east-1${subnet.value}"
      }
    }
    dynamic "subnet" {
      for_each = ["a", "b", "c"]
      content {
        name = "utility-${subnet.key}"
        type = "Utility"
        zone = "us-east-1${subnet.value}"
      }
    }
  }

  cloud_provider {
    aws {
      ebs_csi_driver {
        enabled = true
        managed = true
      }
    }
  }

  iam {
    allow_container_registry = true
  }

  api {
    access = ["0.0.0.0/0"]
  }

  authentication {
    aws {
      backend_mode = "CRD"
      identity_mappings {
        arn      = "arn:aws:iam::<account_id>:user/joao.zanutto"
        username = "admin"
        groups   = ["admin"]
      }
    }
  }

  authorization {
    rbac {}
  }

  metrics_server {
    enabled  = true
    insecure = false
  }

  cert_manager {
    enabled = true
    managed = true
  }

  etcd_cluster {
    name = "main"
    member {
      name           = "control-plane"
      instance_group = "control-plane"
    }
  }
  etcd_cluster {
    name = "events"
    member {
      name           = "control-plane"
      instance_group = "control-plane"
    }
  }
}

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

No branches or pull requests

1 participant