Skip to content

Commit

Permalink
Check kubeletArguments["cni-bin-dir"] matches with default path used …
Browse files Browse the repository at this point in the history
…by OpenShift SDN

- If kubeletArguments["cni-bin-dir"] differs from default openshift sdn,
openshift sdn plugin will not be detected by kubelet. Pod setup fails on the node and
openshift-node service continuously spams the log.
  • Loading branch information
Ravi Sankar Penta committed Feb 6, 2018
1 parent bb140ad commit fd8d643
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/cmd/server/kubernetes/network/sdn_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package network

import (
"fmt"
"strings"

kclientv1 "k8s.io/api/core/v1"
Expand All @@ -10,6 +11,7 @@ import (
"k8s.io/client-go/tools/record"
kinternalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
kinternalinformers "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion"
kcni "k8s.io/kubernetes/pkg/kubelet/network/cni"
"k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"

configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
Expand All @@ -26,6 +28,12 @@ func NewSDNInterfaces(options configapi.NodeConfig, networkClient networkclient.
internalNetworkInformers networkinformers.SharedInformerFactory,
proxyconfig *kubeproxyconfig.KubeProxyConfiguration) (network.NodeInterface, network.ProxyInterface, error) {

if cniBinPaths, ok := options.KubeletArguments["cni-bin-dir"]; ok && (len(cniBinPaths) > 0) {
if cniBinPaths[0] != kcni.DefaultCNIDir {
return nil, nil, fmt.Errorf("kubeletArguments[\"cni-bin-dir\"] did not match with default CNI binary path used by openshift SDN plugin: %q", kcni.DefaultCNIDir)
}
}

runtimeEndpoint := options.DockerConfig.DockerShimSocket
runtime, ok := options.KubeletArguments["container-runtime"]
if ok && len(runtime) == 1 && runtime[0] == "remote" {
Expand Down

0 comments on commit fd8d643

Please sign in to comment.