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
Allow nodePort value for the postgres-operator-ui service #928
Conversation
…or-ui service when the type is NodePort
I think I would rather add the |
I have made the change you suggested. I think it is still important to see if a node port value is specified because a randomised value may be desired in some cases. If both the type is set to NodePort and the value is specified then it will be applied. |
Could you still add the |
I have added a nodePort field to the values.yaml file with no value. This is for the postgres-operator-ui chart so there is no values-crd.yaml. If no value is specified for this field a random port is selected. If a value is specified for this field it is used as the NodePort port. |
Will the |
Adding the nodePort field to the values.yaml file causes the Travis CI build to fail. I attempted to remove the conditional addition of the field in the Helm chart to remedy this but the build unfortunately still fails. Both scenarios work for me when I test the operator locally when the type of the service is NodePort. Further testing when the type of the service is ClusterIP causes the build to fail if the nodePort field is specified. As a result, I am reverting my changes since it feels wrong to add a field that is conditional to the values.yaml file when it is not applicable i.e. the type for the service is not NodeType. I will add the check back to the Helm chart and a commented out field to the values.yaml file to indicate the field does exist and can be specified when the type is NodePort. |
The build error has nothing to do with this PR. Besides, the UI isn't really covered in our tests. Edit: Ok now I've read your edited message again. If it fails when the nodePort is specified then it's true that we have to check that the serviceType is not of |
Are you happy with having the nodePort field commented out in the values.yaml file with a comment describing its usage? |
Why not add |
…d in service.yaml
Because the field is only valid if the type is NodePort. Removing the check in the service.yaml demonstrated this as the deployment failed. I believe there is a difference between an optional field, for which an empty value is valid, and a conditional field that is only valid as a result of the value of some other field. Having it commented out with a comment explaining its usage makes it clear that just setting the value is not sufficient and that the type also needs to be set to NodePort. |
👍 |
1 similar comment
👍 |
@marcusportmann thank you for the contribution :) |
Added support for specifying a nodePort value for the postgres-operator-ui service when the service type is NodePort.