-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add hostAlias (/etc/hosts entry) in OpenLibertyApplication CR #211
Comments
Hi @faandg, thanks for opening this issue. Can you please describe the user scenario you are trying to solve using |
Hi @navidsh . The user scenario is simply adding host records in a container's /etc/hosts. There are many cases in which a user might decide to add host records: for testing purposes, a temporary workaround, split DNS. For our case it's because split DNS is used in our enterprise, now and then we require following a different network path. |
Hi @faandg, we see two options to tackle this issue:
Though option 1 provides a better user experience, we might end of with complicated and messy CRD. We have had other requests in the past to add other configuration fields that only power users would be interested in using. |
Hi @navidsh It would prevent that you receive a feature request for many smaller features added to the Kubernetes specification, in which case you would probably need to make a selection of the most interesting/requested features to add to the CRD while having to reject others. This approach would also be more future proof as we would have the flexibility to add other fields which are added through Kubernetes as well as soon as they become available through OpenShift. Since you mention only power users would be interested in using this approach, I would expect power users to also have a certain level of technical knowledge required to implement this solution even if it is a bit more complex. |
Hi @faandg, Thanks for your input.
You are right on this. Option 2 gives us lots of flexibility and extensibility for the future. |
I came searching for the same thing, which we need. Looks like even the patch approach never got implemented? |
Hmmm... although, colleague found that applying a patch to the Deployment for these elements does not seem to be overwritten by the olapp CRD. spec:
template:
spec:
hostAliases:
- ip: "10.10.10.1"
hostnames:
- myhost In our case (OpenShift):
|
@dougbreaux the deployment object is managed by the OpenLibertyApplication though (you can verify this in the OpenShift UI), so as soon as you deploy a new version of the olapp it will replace the existing deployment and your patch will be gone unfortunately. |
@faandg the thing is... that's what we expected, but is not what is happening 😕 |
@dougbreaux it depends on what part of the OLA spec you modify. Unless the behavior changed recently, for example changing the ApplicationImage should give you a new deployment and pods. But if you change some other part like the service ports, it's possible the deployment and pods still exist. |
@faandg I hear you, but it's the application image that we change regularly, and haven't lost the |
No, it is specific to the OpenLiberty Operator.
When adding following lines in an OpenLibertyApplication CR:
This entry is not being added in
/etc/hosts
in the created containers.hostAlias is not recognized in the OpenLibertyApplication custom resource. Verified this in the CRD.
According to this solution from Red Hat, it is included starting in Kubernetes 1.7 which started shipping in OpenShift 3.7.
Please add support for setting hostAlias in the OpenLibertyApplication CR.
The text was updated successfully, but these errors were encountered: