Comment: |
Progress:
The following code worked when the operator is executed locally but not when not. ( We need to get the master Virtual IP of the cluster which shows available in the restClient of the client_go ks8 lib ).
{code:java} cfg, _:= config.GetConfig() cfgHost := cfg.Host cfgHost = strings.Replace(cfgHost, "//", "", 2) host := strings.Split(cfgHost, ":")
reqLogger.Info("******** HOST", "host", host)
{code}
Following some info that may be helpful to solve it.
{code:java} var config *rest.Config if kubeconfig == "" { log.Printf("using in-cluster configuration") config, err = rest.InClusterConfig() } else { log.Printf("using configuration from '%s'", kubeconfig) config, err = clientcmd.BuildConfigFromFlags("", kubeconfig) } {code}
Check the link: https://rancher.com/using-kubernetes-api-go-kubecon-2017-session-recap/
|