Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with kubernetes and flocker agent-control node connectivity #2994

Closed
lainra opened this issue Jan 6, 2017 · 3 comments
Closed

Problem with kubernetes and flocker agent-control node connectivity #2994

lainra opened this issue Jan 6, 2017 · 3 comments

Comments

@lainra
Copy link

lainra commented Jan 6, 2017

Hello,

I tried to install Flocker with my Kubernetes cluster.
K8s version : 1.5.1
Flocker version : 1.15.0
I have problems similar to this old issue : kubernetes/kubernetes#17651
My nodes are on Centos 7.3.
I'm using VMWare-flocker-plugin to provision the storage. Everything is working as long as it doesn't deal with Kubernetes.
I tried both https://clusterhq.com/2015/12/22/ha-demo-kubernetes-flocker/ demo and https://github.com/vmware/vsphere-flocker-driver installation instructions.

The problem is that kubelet cannot reach the control node because it cannot fetch the environment variables :
FLOCKER_CONTROL_SERVICE_HOST
FLOCKER_CONTROL_SERVICE_PORT
FLOCKER_CONTROL_SERVICE_CA_FILE
FLOCKER_CONTROL_SERVICE_CLIENT_KEY_FILE
FLOCKER_CONTROL_SERVICE_CLIENT_CERT_FILE

I tried every single way to pass these variables :

  • By setting them as temporary env var with export
  • By setting them into /etc/.bashrc
  • By passing them into /etc/systemd/system/kubelet.service file as Environment=
  • By passing them into /etc/systemd/system/kubelet.service file as EnvironmentFile=/etc/kubernetes/kubelet.env containing all variables

Unfortunately, kubelet/flocker-agent doesn't seem to get these variables.

The datasetUUID for volume with datasetName='volume1' can not be found using flocker: Get https://localhost:4523/v1/configuration/datasets: dial tcp 127.0.0.1:4523: getsockopt: connection refused
This is because the https://github.com/kubernetes/kubernetes/blob/v1.5.1/pkg/volume/flocker/flocker.go
defines default variables as :

const (
	flockerPluginName = "kubernetes.io/flocker"

	defaultHost           = "localhost"
	defaultPort           = 4523
	defaultCACertFile     = "/etc/flocker/cluster.crt"
	defaultClientKeyFile  = "/etc/flocker/apiuser.key"
	defaultClientCertFile = "/etc/flocker/apiuser.crt"
	defaultMountPath      = "/flocker"

	timeoutWaitingForVolume = 2 * time.Minute
	tickerWaitingForVolume  = 5 * time.Second
)

I took the flocker.go module NewClient function from kubernetes/kubernetes github to test it on my machine :

package main

import (
  "fmt"
  "os"
)


func GetEnvAsStringOrFallback(key, defaultValue string) string {
        if v := os.Getenv(key); v != "" {
                return v
        }
        return defaultValue
}



func main() {
        fmt.Println(GetEnvAsStringOrFallback("FLOCKER_CONTROL_SERVICE_HOST", "default"))
}

and I get the variable :

[root@k8s-storage-s3 ~]# go run test.go 
192.168.40.31

I don't know what to do, there is only this problem left for my Kubernetes to work with Flocker.

@wallnerryan
Copy link
Contributor

@lain92 did you reload the daemon config and restart the kubelet after placing the ENV variables in .service?

$ systemctl daemon-reload
$ systemctl restart kubelet

@lainra
Copy link
Author

lainra commented Jan 6, 2017

@wallnerryan yes, i did it dozens of times while troubleshooting

@wallnerryan
Copy link
Contributor

FYI, This project is moving to https://github.com/ScatterHQ/flocker, a small number of the clusterhq folks will try to maintain it to a certain degree if the community wants it.

@lainra lainra closed this as completed Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants