Skip to content

Custom Ingress Path for Helm Chart #1834

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

Merged
merged 13 commits into from
May 11, 2023
Merged

Conversation

JordanZimmitti
Copy link
Contributor

Description

Now that Selenium supports custom sub-paths for the UI, in order to take advantage of it in Kubernetes the helm chart needs the ingress path to be overwritable. I added a path key under the ingress section of the values.yaml file and made it backward compatible in the template so if no path key exists then it will use the default "/" path just like before.

Motivation and Context

Deploy selenium with a custom domain sub-path using the helm chart

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Apr 21, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

I do not see how the sub path is getting configured in the Grid itself. Am I missing something?

@JordanZimmitti
Copy link
Contributor Author

JordanZimmitti commented Apr 24, 2023

@diemol

I do not see how the sub path is getting configured in the Grid itself. Am I missing something?

I was able to configure that part using the existing helm chart already by adding these lines here:

hub:
    extraEnvironmentVariables:
        - name: SE_OPTS
           value: '--sub-path /<custom-sub-path>/'
  

which worked fine, but then could not update the ingress path itself since it was hard coded

@JordanZimmitti JordanZimmitti requested a review from diemol April 24, 2023 13:41
@diemol
Copy link
Member

diemol commented Apr 25, 2023

@JordanZimmitti would if be better if we add a new environment variable just to set the sub-path? If so, I can have a look at it unless you want to do it.

@JordanZimmitti
Copy link
Contributor Author

JordanZimmitti commented Apr 25, 2023

@diemol it did take me a little while to figure out how to set the subpath for the hub so having an env called SUB_PATH or something similar might be easier for people to interpret. I'll take a stab at it I think I might know where that needs to be updated

@JordanZimmitti
Copy link
Contributor Author

JordanZimmitti commented Apr 25, 2023

@diemol I updated the selenium hub start script to take a new environment variable called SE_HUB_SUB_PATH which will set the sub-path. Tested this locally with and without using the env variable and it worked as expected. I followed the naming convention that I saw being used in the script, if you would like something different let me know and I'll update it

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Looks good, we just need to add it to a couple of places more. I'd be nice if you have time to put a couple of lines describing it on the main README. Thanks!

@JordanZimmitti
Copy link
Contributor Author

@diemol Thanks for the suggestions! I updated the environment variable name to $SE_SUB_PATH as suggested and added it to the Standalone and Router scripts. I also added some documentation for using the environment variable in the readme.md in a spot that I think makes sense but if you want me to put it somewhere else let me know

@JordanZimmitti JordanZimmitti requested a review from diemol April 27, 2023 01:52
Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Looks great!

Not sure if I am missing something, but shouldn't the SE_SUB_PATH variable be used somewhere in the chart?

@JordanZimmitti
Copy link
Contributor Author

JordanZimmitti commented Apr 27, 2023

@diemol

Looks great!

Not sure if I am missing something, but shouldn't the SE_SUB_PATH variable be used somewhere in the chart?

Since the docker file takes SE_SUB_PATH in as an environment variable it would work fine with the helm chart as is like this

hub:
    extraEnvironmentVariables:
        - name: SE_SUB_PATH
           value: "/<custom-sub-path>/"

But I could break it out of extraEnvironmentVariables and make it its own key under the hub section if you want.
If we go down that path then I probably need to make a sub_path key under the router section too since we added it to the start script there as well correct?

@diemol
Copy link
Member

diemol commented May 2, 2023

@JordanZimmitti sorry for the late reply, we had a long weekend here.

But I could break it out of extraEnvironmentVariables and make it its own key under the hub section if you want.
If we go down that path then I probably need to make a sub_path key under the router section too since we added it to the start script there as well correct?

I think ☝️ is the preferred solution so all places where the env var can be used get the option to be configured. Thanks!

@JordanZimmitti
Copy link
Contributor Author

@diemol Sounds good ill implement the changes in the next day or so!

@JordanZimmitti JordanZimmitti requested a review from diemol May 3, 2023 21:59
@JordanZimmitti
Copy link
Contributor Author

@diemol
I broke out the environment variable in the helm charts in the needed locations, let me know if you have any other suggestions!

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you!

I just noted that the sub-path environment variable is being used in a few places we do not need it.

@JordanZimmitti
Copy link
Contributor Author

@diemol I removed the sub_path from components that don't need it based on your recommendation!

@JordanZimmitti JordanZimmitti requested a review from diemol May 4, 2023 21:04
Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @JordanZimmitti!

@diemol diemol merged commit 8019879 into SeleniumHQ:trunk May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants