Progress:
h4. Regards get the cluster IP and protocol automatically:
The following works when the project is executed with the command "make run-local" but not when the operator is deployed by the image, using the command "make create-all" the IP returned is not the master one.
{code:java} func getClusterProtocol() string { cfg, _:= config.GetConfig() cfgHost := cfg.Host cfgHost = strings.Replace(cfgHost, "//", "", 2) host := strings.Split(cfgHost, ":")
return host[0] }
func getHostIP() string { cfg, _:= config.GetConfig() cfgHost := cfg.Host cfgHost = strings.Replace(cfgHost, "//", "", 2) host := strings.Split(cfgHost, ":")
return host[1] }
{code} h4. Regards check the ingress used in other operators to expose the service.
* Result of the test doing exactly the code suggested by [~weil] [here|https://github.com/linzhuangrong/prometheus-operator/blob/9874ab3427f7395b57b1fd696f24ca52ff928f55/test/framework/ingress.go#L24]
See [here|https://issues.jboss.org/browse/AEROGEAR-8990?focusedCommentId=13724577&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-13724577], the OCP did not create the router based on the ingress source generated.
Also, shows that this is just used to test the operator and not to expose the service on it. h3. Looking for examples.
*NOTE: All places that I could check when is creating the ingress is passing the host and it is a config value made by the user*
* Integr8ly is informing the host as we are doing here. See [here|https://github.com/integr8ly/gitea-operator/blob/9b58cafe5e57b28606fafb569fbd0b2928021af2/templates/gitea-ingress.yaml#L10] and [here|https://github.com/integr8ly/gitea-operator/blob/9b58cafe5e57b28606fafb569fbd0b2928021af2/templates/gitea-config.yaml#L31]
* The WordPress operator shows request the domain definition for the host too. See [here|https://github.com/presslabs/wordpress-operator/blob/55cede40032a0f6a4188239cf394afc8dbcf6ba2/chart/wordpress-operator/templates/crds.yaml#L100] and [here|https://github.com/presslabs/wordpress-operator/blob/1d285e7cff886ac42fe88a9ec742b824b3c05e17/pkg/controller/wordpress/internal/sync/ingress.go#L66]
* This one is informing the domain too. [here|https://github.com/infinimesh/operator/blob/72eedaa87d5feb12eedc676fd38780c79593602e/pkg/controller/platform/apiserver_rest.go#L128] and [here|https://github.com/infinimesh/operator/blob/f77e95bc90f944af9197458a2e939149001a9e1c/config/samples/infinimesh_v1beta1_platform.yaml#L14]
* The vault.operator shows also requiring the host. See [here|https://github.com/coreos/vault-operator/blob/9f310f12f67d3080e16d1fa5dc0d345aa543a966/doc/user/tectonic/ingress.md#L3] and [here|https://github.com/coreos/vault-operator/blob/9f310f12f67d3080e16d1fa5dc0d345aa543a966/doc/user/tectonic/vault-ui.md#L40]
* The CrunchyData shows request to the user create the ingress/route manually. See [here|https://github.com/CrunchyData/postgres-operator/blob/7e867ebf211b488def26dfaf10d7b2b5bbd6f5f6/hugo/content/Installation/_index.md#pgo-cli-installation]
|
|