-
Notifications
You must be signed in to change notification settings - Fork 404
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
templates: add apiserver-url.env file #2232
templates: add apiserver-url.env file #2232
Conversation
Nice, CI seems basically green. |
pkg/controller/container-runtime-config/container_runtime_config_controller_test.go
Show resolved
Hide resolved
pkg/controller/container-runtime-config/container_runtime_config_controller_test.go
Show resolved
Hide resolved
@@ -0,0 +1,7 @@ | |||
mode: 0644 | |||
path: "/etc/kubernetes/apiserver-url.env" | |||
# used by the cluster network operator to learn the URL to the internal apiserver load balancer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For things like the binaries extracted to the host? Or code running in a container? Both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The motivating use case is the CNO, which is in a container (and thus bind-mounts it), but I suspect we'll find a few more uses for it.
@@ -0,0 +1,7 @@ | |||
mode: 0644 | |||
path: "/etc/kubernetes/apiserver-url.env" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add something like a "MCO internals" package that things like the SDN could vendor in that would have this as a constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, that's a decent idea - as long as it won't annoy go mod
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, this path is certainly not changeable, so parameterizing it isn't really useful.
Up to you.
A few components need to know the URL of the internal apiserver load balancer. Most notably, the network operator does. Right now, the only way to get this is to parse the kubelet's kubeconfig, but this is fragile. So, write down an environment file that just sets the "usual" service environment variables. Then we can just seamlessly souce the environment file.
@cgwalters I updated to add a |
package constants | ||
|
||
// constants defines some file paths that are shared outside of the | ||
// MCO package; and thus consumed by other users |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This should help us in the future in doing things like searching across the OpenShift repos to see which other projects are using bits from the MCO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/retest |
@cgwalters could I get a lgtm again? |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, squeed The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
@squeed: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
Azure node controller needs to know the URL of the internal apiserver load balancer. To do it, this commit creates an environment file with required env variables, that can be consumed by the controller. This approach is similar to what we do on master nodes: openshift#2232
A few components need to know the URL of the internal apiserver load balancer. Most notably, the network operator does.
Right now, the only way to get this is to parse the kubelet's kubeconfig, but this is fragile. So, write down an environment file that just sets the "usual" service environment variables. Then we can just seamlessly source the environment file.
Ref: SDN-1347