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]
* h3. Looking for examples.
* 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]
* 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]
|
|