Skip to content
This repository was 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.
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

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

Open

Description

@robinbraemer

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: {}

Activity

  1. croomes commented on Jun 12, 2019

    @croomes
    Contributor

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions