Skip to content

Conversation

@iOrcohen
Copy link
Contributor

@iOrcohen iOrcohen commented Dec 1, 2025

Add webhook for HPA creation

@komodor-bot
Copy link
Contributor

timeoutSeconds: {{ .Values.capabilities.admissionController.mutatingWebhook.timeoutSeconds | default 5 }}
{{- end }}
{{- if .Values.capabilities.admissionController.hpaWebhook.enabled }}
- name: hpa.komodor.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, maybe we want to use hpa.rightsizing.com? Again, not sure, would love to hear your opinion here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is directly related to rightsizing capabilities, yes I would use hpa.rightsizing.komodor.com

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iOrcohen I think you renamed the original rule instead of the new one 😶

sideEffects: None
timeoutSeconds: {{ .Values.capabilities.admissionController.mutatingWebhook.timeoutSeconds | default 5 }}
{{- end }}
{{- if .Values.capabilities.admissionController.hpaWebhook.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these values exist? I mean, this wouldn't render if .Values.capabilities.admissionController.hpaWebhook is null.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 100% an issue for users that will upgrade using --reuse-values as the hpaWebhook will be null for them.
You might be able to use dig https://helm.sh/docs/chart_template_guide/function_list/#dig or empty function like we did here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also regarding this, add default value object to the values.yaml file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iOrcohen add default values

timeoutSeconds: {{ .Values.capabilities.admissionController.mutatingWebhook.timeoutSeconds | default 5 }}
{{- end }}
{{- if .Values.capabilities.admissionController.hpaWebhook.enabled }}
- name: hpa.komodor.com
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is directly related to rightsizing capabilities, yes I would use hpa.rightsizing.komodor.com

sideEffects: None
timeoutSeconds: {{ .Values.capabilities.admissionController.mutatingWebhook.timeoutSeconds | default 5 }}
{{- end }}
{{- if .Values.capabilities.admissionController.hpaWebhook.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 100% an issue for users that will upgrade using --reuse-values as the hpaWebhook will be null for them.
You might be able to use dig https://helm.sh/docs/chart_template_guide/function_list/#dig or empty function like we did here

sideEffects: None
timeoutSeconds: {{ .Values.capabilities.admissionController.mutatingWebhook.timeoutSeconds | default 5 }}
{{- end }}
{{- if .Values.capabilities.admissionController.hpaWebhook.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also regarding this, add default value object to the values.yaml file

@iOrcohen
Copy link
Contributor Author

iOrcohen commented Dec 1, 2025

@OrBin @MickaelAlliel
I'm thinking of maybe include the webhook anyway if the Values.capabilities.admissionController.rightsizing.enabled is true.

If we would want to open the HPA for a customer after release it, changing it in the remote config won't be enough, we would require the client to reinstall the Helm with a true value in it right?

So I think maybe the webhook should exist anyway, and inside the AC we will check this remote configuration to understand if we want to do something with it.

@MickaelAlliel
Copy link
Contributor

@OrBin @MickaelAlliel I'm thinking of maybe include the webhook anyway if the Values.capabilities.admissionController.rightsizing.enabled is true.

If we would want to open the HPA for a customer after release it, changing it in the remote config won't be enough, we would require the client to reinstall the Helm with a true value in it right?

So I think maybe the webhook should exist anyway, and inside the AC we will check this remote configuration to understand if we want to do something with it.

Correct yes - the best way for now is to have it deployed and the remote configuration will decide if to return early or actually do any logic.

For reference, we didnt get to it yet but:
The plan for the future was to have the AC act as an operator and dynamically manage and create the webhook configuration depending on the remote configuration, as to prevent having unnecessary requests going out that just return 200 like we do today.

@iOrcohen
Copy link
Contributor Author

iOrcohen commented Dec 1, 2025

@OrBin @MickaelAlliel I'm thinking of maybe include the webhook anyway if the Values.capabilities.admissionController.rightsizing.enabled is true.
If we would want to open the HPA for a customer after release it, changing it in the remote config won't be enough, we would require the client to reinstall the Helm with a true value in it right?
So I think maybe the webhook should exist anyway, and inside the AC we will check this remote configuration to understand if we want to do something with it.

Correct yes - the best way for now is to have it deployed and the remote configuration will decide if to return early or actually do any logic.

For reference, we didnt get to it yet but: The plan for the future was to have the AC act as an operator and dynamically manage and create the webhook configuration depending on the remote configuration, as to prevent having unnecessary requests going out that just return 200 like we do today.

That would be amazing, this with the fact we can changing the remote config and the AC server is restarting is pretty amazing

@Moran-k Moran-k added the wip label Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants