Git Product home page Git Product logo

Comments (6)

manugarg avatar manugarg commented on April 28, 2024

Thanks for this @DazWilkin.

Here is logic for discovering port for the default server:

func (pr *Prober) initDefaultServer() error {

If port is not in the config, and environment variable CLOUDPROBER_PORT is not defined, cloudprober will use 9313 (DefaultServerPort).

What error do you get when you don't specify the environment variable CLOUDPROBER_PORT.

from cloudprober.

DazWilkin avatar DazWilkin commented on April 28, 2024

I looked at cloudprober.go but it wasn't immediately obvious to me why it doesn't work.

Curiously, the container works outside of Kubernetes.

If I exclude the environment variable from the deployment file on Kubernetes, it generates:

cloudprober.go:164] Error initializing cloudprober. Err: failed to parse default port from the env var: CLOUDPROBER_PORT=tcp://10.102.246.132:9313

If I include:

env:
- name: CLOUDPROBER_PORT
  value: "9313"

It works.

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

Apparently Kubernetes automatically sets the environment variable "_PORT"
https://kubernetes.io/docs/concepts/services-networking/service/#environment-variables

This is colliding with the Cloudprober's default port environment variable name, CLOUDPROBER_PORT.

CLOUDPROBER_SERVICE_PORT would have been more compatible with Kubernetes. I'll document it for now and possibly change the environment variable name later.

from cloudprober.

DazWilkin avatar DazWilkin commented on April 28, 2024

IDNKT!

I've confirmed this is the root-cause in my case.

I renamed the service in my deployment (cloudproberxcloudprober) and removed the env for CLOUDPROBER_PORT and the deployment succeeded.

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

Filed #252 to modify CLOUDPROBER_PORT parsing to work with Kubernetes.

from cloudprober.

manugarg avatar manugarg commented on April 28, 2024

Closing this issue now.

In case someone adopts the ConfigMap proposal described by Daz at the top, I'd also recommend to look at #149 (comment) for how to rollout ConfigMap updates.

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.