Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

failed to dial all known cluster members, (http://storageos.kube-system.svc.cluster.local) #134

Open
robinbraemer opened this issue Jun 11, 2019 · 1 comment

Comments

@robinbraemer
Copy link

robinbraemer commented Jun 11, 2019

I'm trying to connect a in-cluster client to the StorageOS API but cluster members cannot be found.

This is my go code

func InitClient() error {
	cli, err := storageos.NewClient(env.Get(env.STORAGEOS_HOST))
	if err != nil {
		return err
	}
	cli.SetAuth(env.Get(env.STORAGEOS_USERNAME), env.Get(env.STORAGEOS_PASSWORD))
	client = cli
	return nil
}

and then I run a test ping

if err = client.Ping(); err != nil {
	log.Error(err, "Failed ping test StorageOS API")
	os.Exit(1)
}

and there is the error

"error":"failed to dial all known cluster members, (http://storageos.kube-system.svc.cluster.local)

The pod is running in another namespace.

This is the storageos service:

apiVersion: v1
kind: Service
metadata:
  labels:
    app: storageos
  name: storageos
  namespace: kube-system
spec:
  clusterIP: 10.43.68.167
  ports:
  - name: storageos
    port: 5705
    protocol: TCP
    targetPort: 5705
  selector:
    app: storageos
    kind: daemonset
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}
@croomes
Copy link
Contributor

croomes commented Jun 12, 2019

Hi @robinbraemer, can you try appending the port (:5705) to STORAGEOS_HOST? Just had a quick look at the api code and it only seems to set the default port if you've not set STORAGEOS_HOST at all, otherwise it expects the port to be set.

If that doesn't work you could try to isolate by running the CLI in the same namespace, and see if that can connect? There's a script to do that here: https://github.com/storageos/deploy/blob/master/k8s/run-cli.sh. You'll need to change the env vars to match the credentials and the service.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants