ClusterHQ / flocker

Container data volume manager for your Dockerized application
https://clusterhq.com
Apache License 2.0
3.38k stars 288 forks source link

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

Closed lainra closed 3 years ago

lainra commented 7 years ago

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 : https://github.com/kubernetes/kubernetes/issues/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 :

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 commented 7 years ago

@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 commented 7 years ago

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

wallnerryan commented 7 years ago

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.