Skip to content

Commit c22624e

Browse files
committed
Fix: Add metrics configuration to overcommit controller and validating webhooks
1 parent 699da62 commit c22624e

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

internal/resources/generate_resources_overcommit_class_controller_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ func GenerateOvercommitClassControllerDeployment(overcommitObject overcommit.Ove
4444
{
4545
Name: "overcommit-controller",
4646
Image: os.Getenv("IMAGE_REGISTRY") + "/" + os.Getenv("IMAGE_REPOSITORY") + ":" + os.Getenv("APP_VERSION"),
47+
Args: []string{
48+
"--metrics-bind-address=:8080",
49+
"-metrics-secure=false",
50+
},
4751
Env: []corev1.EnvVar{
4852
{
4953
Name: "ENABLE_OVERCOMMIT_CLASS_CONTROLLER",
@@ -79,7 +83,6 @@ func GenerateOvercommitClassControllerDeployment(overcommitObject overcommit.Ove
7983
},
8084
},
8185
Ports: []corev1.ContainerPort{
82-
{ContainerPort: 9443},
8386
{ContainerPort: 8080, Name: "metrics", Protocol: corev1.ProtocolTCP},
8487
},
8588
},

internal/resources/generate_resources_validating_webhooks.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ func GeneratePodValidatingDeployment(overcommitObject overcommit.Overcommit) *ap
7474
{
7575
Name: "k8s-overcommit-pod-validating-webhook",
7676
Image: os.Getenv("IMAGE_REGISTRY") + "/" + os.Getenv("IMAGE_REPOSITORY") + ":" + os.Getenv("APP_VERSION"),
77+
Args: []string{
78+
"--metrics-bind-address=:8080",
79+
"-metrics-secure=false",
80+
},
7781
Env: []corev1.EnvVar{
7882
{
7983
Name: "ENABLE_POD_VALIDATING_WEBHOOK",
@@ -245,6 +249,10 @@ func GenerateOvercommitClassValidatingDeployment(overcommitObject overcommit.Ove
245249
{
246250
Name: "k8s-overcommit-class-validating-webhook",
247251
Image: os.Getenv("IMAGE_REGISTRY") + "/" + os.Getenv("IMAGE_REPOSITORY") + ":" + os.Getenv("APP_VERSION"),
252+
Args: []string{
253+
"--metrics-bind-address=:8080",
254+
"-metrics-secure=false",
255+
},
248256
Env: []corev1.EnvVar{
249257
{
250258
Name: "ENABLE_OC_VALIDATING_WEBHOOK",

0 commit comments

Comments
 (0)