Giter Club home page Giter Club logo

Comments (6)

lklkxcxc avatar lklkxcxc commented on June 1, 2024 1

@manugarg config "--cloud_metadata=none" this problem was sloved.

from cloudprober.

manugarg avatar manugarg commented on June 1, 2024

@lklkxcxc This is very surprising. This is where this error is returned:

return true, fmt.Errorf("sysvars_ec2: could not get instance identity document %v", err)

But we return this error only if ec2metadata.New(s).Available() returns true. It should return true only on EC2.

Also, cloudprobers on a lot of kubernetes instances, I am surprised you're encountering this error. Anything else about your setup that could be relevant here?

I'll try to understand ec2metadata library more in the meantime.

from cloudprober.

lklkxcxc avatar lklkxcxc commented on June 1, 2024

@manugarg this case cloudprober.cfg show:

probe {
  name: "pod-to-endpoints"
  type: HTTP

  targets {
    # RDS (resource discovery service) targets
    # Equivalent to kubectl get ep cloudprober
    rds_targets {
      resource_path: "k8s://endpoints/cloudprober"
    }
  }
  
  http_probe {
    resolve_first: true
    relative_url: "/status"
  }
}

# Run an RDS gRPC server to discover Kubernetes targets.
rds_server {
  provider {
    # For all options, please take a look at:
    # https://github.com/google/cloudprober/blob/master/rds/kubernetes/proto/config.proto#L38
    kubernetes_config {
      endpoints {}
    }
  }
}

deployment on k8s:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloudprober
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cloudprober
  template:
    metadata:
      annotations:
        checksum/config: "${CONFIG_CHECKSUM}"
      labels:
        app: cloudprober
    spec:
      volumes:
      - name: cloudprober-config
        configMap:
          name: cloudprober-config
      containers:
      - name: cloudprober
        image: harbor.cechealth.cn/platform/cloudprober
        command: ["/cloudprober"]
        args: [
          "--config_file","/cfg/cloudprober.cfg",
          "--logtostderr"
        ]
        volumeMounts:
        - name: cloudprober-config
          mountPath: /cfg
        ports:
        - name: http
          containerPort: 9313
---
apiVersion: v1
kind: Service
metadata:
  name: cloudprober
  labels:
    app: cloudprober
spec:
  ports:
  - port: 9313
    protocol: TCP
    targetPort: 9313
  selector:
    app: cloudprober
  type: NodePort

Virtual machine base on OpenStack not EC2

from cloudprober.

manugarg avatar manugarg commented on June 1, 2024

It has nothing to do with cloudprober config. Something on the system.

Based on the ec2metadata code, it seems that Available() call checks for the following URL on the instance:

http://169.254.169.254/latest/meta-data/instance-id

Any possibility that this URL is somehow working on your system?

from cloudprober.

manugarg avatar manugarg commented on June 1, 2024

Ah, it seems that openstack Nova (not sure what Nova is here) provides metadata in EC2 format as well:
https://docs.openstack.org/nova/latest/user/metadata.html#nova-metadata

I am assuming that means http://169.254.169.254/latest/meta-data/instance-id will somehow work on openstack nova as well.

from cloudprober.

manugarg avatar manugarg commented on June 1, 2024

Regardless though, you can disable cloud metadata check completely by providing the following flag to cloudprober:

--cloud_metadata=none

from cloudprober.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.