Skip to content

Commit

Permalink
feat: provide POD_IP env var to scheduler and controller-manager
Browse files Browse the repository at this point in the history
Fixes #9031

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Jul 17, 2024
1 parent 407347a commit fd6ddd1
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,18 @@ func (ctrl *ControlPlaneStaticPodController) manageControllerManager(ctx context
Name: k8s.ControllerManagerID,
Image: cfg.Image,
Command: args,
Env: env,
Env: append(
[]v1.EnvVar{
{
Name: "POD_IP",
ValueFrom: &v1.EnvVarSource{
FieldRef: &v1.ObjectFieldSelector{
FieldPath: "status.podIP",
},
},
},
},
env...),
VolumeMounts: append([]v1.VolumeMount{
{
Name: "secrets",
Expand Down Expand Up @@ -785,7 +796,18 @@ func (ctrl *ControlPlaneStaticPodController) manageScheduler(ctx context.Context
Name: k8s.SchedulerID,
Image: cfg.Image,
Command: args,
Env: env,
Env: append(
[]v1.EnvVar{
{
Name: "POD_IP",
ValueFrom: &v1.EnvVarSource{
FieldRef: &v1.ObjectFieldSelector{
FieldPath: "status.podIP",
},
},
},
},
env...),
VolumeMounts: append([]v1.VolumeMount{
{
Name: "secrets",
Expand Down

0 comments on commit fd6ddd1

Please sign in to comment.