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

Make pod_name and pod_namespace optional #39

Open
mneverov opened this issue Oct 2, 2024 · 6 comments
Open

Make pod_name and pod_namespace optional #39

mneverov opened this issue Oct 2, 2024 · 6 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@mneverov
Copy link
Member

mneverov commented Oct 2, 2024

Currently, POD_NAME and POD_NAMESPACE environment variables are mandatory. As a user I don't want to specify them but just run the controller.
Investigate if

  • we need to use resource lock
  • it is possible to deduct name/namespace from os.host or by other means

Update readme with both variables, descriptions and default values from the investigation.

@aojea
Copy link
Contributor

aojea commented Oct 2, 2024

actually those need to be passed as parameters

type Config struct {
LeaseDuration time.Duration
RenewDeadline time.Duration
RetryPeriod time.Duration
ResourceLock string
ResourceName string
}

you can use some defaults , for namespace "default, and for id is commont to use os.Hostname()

@mneverov
Copy link
Member Author

mneverov commented Oct 2, 2024

actually those need to be passed as parameters

The biggest problem at the moment that they are not specified and by default the controller runs in leader election mode, but without these variables it fails to start. Would be nice to address it

@aojea
Copy link
Contributor

aojea commented Oct 2, 2024

yeah, we can define some default values , pod_name = os.Hostname() and pod_namespace = "default" or "kube-system", whatever we use to install our controller, I can not remember now

@mneverov
Copy link
Member Author

mneverov commented Oct 3, 2024

maybe also can be used staging/src/k8s.io/component-helpers/node/util/hostname.go:28

@aojea
Copy link
Contributor

aojea commented Oct 3, 2024

yeah, that works too

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants