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

rebase 1.9.0 beta.1 #17576

Merged
merged 78 commits into from
Dec 13, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f0bb2b6
update glide.yaml
deads2k Dec 1, 2017
c671103
update glide.yaml for networking
deads2k Dec 7, 2017
07c6b99
glide.yaml: update ours dependencies
deads2k Dec 8, 2017
710998e
bump(*)
deads2k Dec 4, 2017
c8626b7
UPSTREAM: 57148: expose special storage locations
deads2k Dec 5, 2017
f3769c7
UPSTREAM: 57149: make quota reusable
deads2k Dec 5, 2017
123246b
UPSTREAM: <carry>: exclude some origin resources from quota
deads2k Dec 7, 2017
534c679
UPSTREAM: <drop>: add back PrintSuccess. remove when printing is fixed
deads2k Dec 6, 2017
ca1b85f
UPSTREAM: <drop>: skip controller metric error, drop once we run in a…
deads2k Dec 7, 2017
9ff7f3f
UPSTREAM: <drop>: skip scheduler configz error, drop once we run in a…
deads2k Dec 7, 2017
d34b354
UPSTREAM: <carry>: patch scheduler to apply defaults. drop once we r…
deads2k Dec 7, 2017
df449cc
UPSTREAM: <carry>: make wiring in kubeproxy easy until we sort out co…
deads2k Dec 8, 2017
f046a0b
UPSTREAM: 49312: allow the /version endpoint to pass through
deads2k Jul 20, 2017
3c7a135
UPSTREAM: openshift/api: 17: Rbac fix
deads2k Dec 8, 2017
3f45cdc
UPSTREAM: <drop>: remove usage of bad transport since only GKE routes
deads2k Dec 11, 2017
ee0f726
UPSTREAM: <carry>: keep set working on internal types
deads2k Dec 11, 2017
de36874
UPSTREAM: <drop>: enable beta APIs by default. fixed by several pulls…
deads2k Dec 11, 2017
64974bc
UPSTREAM: 56687: kube-apiserver: enable admissionregistration v1beta1…
deads2k Dec 11, 2017
bf64f2c
UPSTREAM: 57150: allow convert to default on a per object basis
juanvallejo Dec 8, 2017
cf235c2
UPSTREAM: <carry>: switch apply to use the legacyscheme so our types …
deads2k Dec 12, 2017
4bc612e
boring changes
deads2k Dec 4, 2017
66d94ff
skuznets: switch to golang 1.9
deads2k Dec 7, 2017
fc9b4e2
DISABLE ROUTER e2e tests! hopefully fix golang 1.9 before we merge a…
deads2k Dec 11, 2017
5b3859b
update generators
deads2k Dec 4, 2017
d1b5fe8
add secret reference
deads2k Dec 4, 2017
42a1e2c
update image type generation flags
deads2k Dec 4, 2017
d49083e
CreatedByAnnotation is gone, idling probably broke again
deads2k Dec 5, 2017
07e5313
image limit ranger plugin
deads2k Dec 5, 2017
ab033d4
explicitly stop running admission on some resources
deads2k Dec 5, 2017
32a0c9a
add admission validation for *some* special resources
deads2k Dec 5, 2017
27ad23a
NEEDS REVIEW: boring: docker client update
deads2k Dec 5, 2017
f490d38
update internal scale type for dc
deads2k Dec 5, 2017
2f11419
interesting: update the dc/scale integration test to use the generic …
deads2k Dec 7, 2017
b3fa18d
minimal lease reconciler change
deads2k Dec 5, 2017
22f0b91
remove deprecated dc rollback generator
deads2k Dec 5, 2017
0aedd29
QUOTA: refactor our use of quota
deads2k Dec 5, 2017
7f86e08
SEPARATE: needs picking to webconsole server when they rebase
deads2k Dec 5, 2017
99c59c6
interesting: use listener instead of bindport
deads2k Dec 5, 2017
afdcb87
jvallejo: printing debt to fix
deads2k Dec 6, 2017
2abedd5
SROSS: hack new start for hpa controller for https support
deads2k Dec 6, 2017
5d40a0f
weird: clusterresourceoverride admission with a fake limit ranger
deads2k Dec 6, 2017
4383cd7
admission wiring changes
deads2k Dec 6, 2017
7ffc267
SJENNING: node wiring changes
deads2k Dec 6, 2017
244afd3
DANW: update networking related code for rebase
deads2k Dec 4, 2017
30fe89a
update deletion strategies
deads2k Dec 11, 2017
de21f14
authorization changes
deads2k Dec 5, 2017
80cef2d
authorization: updates to bootstrap roles
deads2k Dec 11, 2017
a92560d
add roundtripping for aggregation rules
deads2k Dec 8, 2017
a1cef1f
apiserver default changes
deads2k Dec 8, 2017
8454d7d
etcd storage test updates
deads2k Dec 11, 2017
9344e48
BPAREES: simplify concurrent controller test
deads2k Dec 8, 2017
062ffb1
BPAREES: crio values seem half changed
deads2k Dec 11, 2017
93bd84a
router/f5: move test types into testing sub-pkg
sttts Dec 12, 2017
0089bbb
oc: simple
deads2k Dec 6, 2017
ad7d2fc
oc: interesting: handle switch to external types in printers and set
deads2k Dec 6, 2017
60d3fa9
oc: make printers work again - sortof
deads2k Dec 6, 2017
b15c3b6
oc: builder updates
deads2k Dec 6, 2017
1d18e82
oc: cluster up dockername parsing
deads2k Dec 7, 2017
31f33b0
oc: first round of fixes for test-cmd
juanvallejo Dec 7, 2017
2cf15a3
oc: break oc explain
deads2k Dec 11, 2017
ee8266b
oc: adm migrate isn't getting a full scheme. add missing types
deads2k Dec 12, 2017
bb2ecf0
oc: stop testing upstream shortcuts, we no longer statically include …
deads2k Dec 8, 2017
2db374f
oc: CLAYTON: using internal gives me external types
deads2k Dec 11, 2017
a4d2794
needs review: boring: change e2e status check
deads2k Dec 7, 2017
ebc468c
needs review: boring: ignore pod dns config for deployer pods
deads2k Dec 11, 2017
7256949
boring: needs review: update deletion so it never waits. Something c…
deads2k Dec 12, 2017
6c58566
boring: test updates
deads2k Dec 7, 2017
d4ee63c
generated
deads2k Dec 4, 2017
9e3ca9a
DANW: comments
deads2k Dec 12, 2017
6b39f30
separate kube controller informers in advance of splitting process
deads2k Dec 12, 2017
2fa3a79
BPAREES: don't pass unused streams to streamoptions because it hangs
deads2k Dec 12, 2017
d826d91
make migration printing work again
deads2k Dec 12, 2017
a783419
UPSTREAM: 57107: Check ns setup error during e2e
deads2k Dec 12, 2017
5c42201
make cluster quota admission wait for namespace to be present
deads2k Dec 12, 2017
b80c0d2
boring: update tsb e2e to exclude new events group
deads2k Dec 12, 2017
088b81d
update bootstrap role for router
deads2k Dec 12, 2017
cdc12ca
skip some networking tests that fail in the rebase
deads2k Dec 13, 2017
b374cbd
increase DC hook timeouts. indicates pod start latency problem and f…
deads2k Dec 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 30 additions & 36 deletions pkg/cmd/server/kubernetes/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
"path/filepath"
"time"

dockertypes "github.com/docker/docker/api/types"
dockerclient "github.com/fsouza/go-dockerclient"
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/kubelet/dockershim"
dockertools "k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"

kapiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeletapp "k8s.io/kubernetes/cmd/kubelet/app"
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
cadvisortesting "k8s.io/kubernetes/pkg/kubelet/cadvisor/testing"
"k8s.io/kubernetes/pkg/kubelet/cm"
dockertools "k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
"k8s.io/kubernetes/pkg/volume"

configapi "github.com/openshift/origin/pkg/cmd/server/api"
Expand All @@ -34,7 +34,7 @@ const minimumDockerAPIVersionWithPullByID = "1.22"
// All errors here are fatal.
func (c *NodeConfig) EnsureKubeletAccess() {
if _, err := os.Stat("/var/lib/docker"); os.IsPermission(err) {
c.HandleDockerError("Unable to view the /var/lib/docker directory - are you running as root?")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we should be moving away from these checks as we lean more on cri, not making them unconditionally fatal

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like we should be moving away from these checks as we lean more on cri, not making them unconditionally fatal

This is a pre-existing move. Not something net new.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or at least move this into EnsureDocker or protect with if c.KubeletServer.ContainerRuntime == "docker" { ... }

glog.Fatal("Unable to view the /var/lib/docker directory - are you running as root?")
}
if c.Containerized {
if _, err := os.Stat("/rootfs"); os.IsPermission(err) || os.IsNotExist(err) {
Expand Down Expand Up @@ -82,73 +82,67 @@ func (c *NodeConfig) EnsureDocker(docker *dockerutil.Helper) {
if c.KubeletServer.ContainerRuntime != "docker" {
return
}
dockerClient, dockerAddr, err := docker.GetKubeClient(c.KubeletServer.RuntimeRequestTimeout.Duration, c.KubeletServer.ImagePullProgressDeadline.Duration)
if err != nil {
c.HandleDockerError(fmt.Sprintf("Unable to create a Docker client for %s - Docker must be installed and running to start containers.\n%v", dockerAddr, err))
return

var endpoint string
if len(os.Getenv("DOCKER_HOST")) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems better suited like a config variable rather than an env.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems better suited like a config variable rather than an env.

Pre-existing as upstream helpers were removed. This can't change without breaking previously working environments.

endpoint = os.Getenv("DOCKER_HOST")
} else {
endpoint = "unix:///var/run/docker.sock"
}

dockerClientConfig := &dockershim.ClientConfig{
DockerEndpoint: endpoint,
RuntimeRequestTimeout: c.KubeletServer.RuntimeRequestTimeout.Duration,
ImagePullProgressDeadline: c.KubeletServer.ImagePullProgressDeadline.Duration,
}
if url, err := url.Parse(dockerAddr); err == nil && url.Scheme == "unix" && len(url.Path) > 0 {
client := dockertools.ConnectToDockerOrDie(endpoint, c.KubeletServer.RuntimeRequestTimeout.Duration, c.KubeletServer.ImagePullProgressDeadline.Duration, false, false)
dockerClient := &dockerutil.KubeDocker{client}

if url, err := url.Parse(endpoint); err == nil && url.Scheme == "unix" && len(url.Path) > 0 {
s, err := os.Stat(url.Path)
switch {
case os.IsNotExist(err):
c.HandleDockerError(fmt.Sprintf("No Docker socket found at %s. Have you started the Docker daemon?", url.Path))
glog.Fatalf("No Docker socket found at %s. Have you started the Docker daemon?", url.Path)
return
case os.IsPermission(err):
c.HandleDockerError(fmt.Sprintf("You do not have permission to connect to the Docker daemon (via %s). This process requires running as the root user.", url.Path))
glog.Fatalf("You do not have permission to connect to the Docker daemon (via %s). This process requires running as the root user.", url.Path)
return
case err == nil && s.IsDir():
c.HandleDockerError(fmt.Sprintf("The Docker socket at %s is a directory instead of a unix socket - check that you have configured your connection to the Docker daemon properly.", url.Path))
glog.Fatalf("The Docker socket at %s is a directory instead of a unix socket - check that you have configured your connection to the Docker daemon properly.", url.Path)
return
}
}
if err := dockerClient.Ping(); err != nil {
c.HandleDockerError(fmt.Sprintf("Docker could not be reached at %s. Docker must be installed and running to start containers.\n%v", dockerAddr, err))
glog.Fatalf("Docker could not be reached at %s. Docker must be installed and running to start containers.\n%v", endpoint, err)
return
}

glog.Infof("Connecting to Docker at %s", dockerAddr)
glog.Infof("Connecting to Docker at %s", endpoint)

version, err := dockerClient.Version()
if err != nil {
c.HandleDockerError(fmt.Sprintf("Unable to check for Docker server version.\n%v", err))
glog.Fatalf("Unable to check for Docker server version.\n%v", err)
return
}

serverVersion, err := dockerclient.NewAPIVersion(version.APIVersion)
if err != nil {
c.HandleDockerError(fmt.Sprintf("Unable to determine Docker server version from %q.\n%v", version.APIVersion, err))
glog.Fatalf("Unable to determine Docker server version from %q.\n%v", version.APIVersion, err)
return
}

minimumPullByIDVersion, err := dockerclient.NewAPIVersion(minimumDockerAPIVersionWithPullByID)
if err != nil {
c.HandleDockerError(fmt.Sprintf("Unable to check for Docker server version.\n%v", err))
glog.Fatalf("Unable to check for Docker server version.\n%v", err)
return
}

if serverVersion.LessThan(minimumPullByIDVersion) {
c.HandleDockerError(fmt.Sprintf("Docker 1.6 or later (server API version %s or later) required.", minimumDockerAPIVersionWithPullByID))
glog.Fatalf("Docker 1.6 or later (server API version %s or later) required.", minimumDockerAPIVersionWithPullByID)
return
}

c.DockerClient = dockerClient
}

// HandleDockerError handles an an error from the docker daemon
func (c *NodeConfig) HandleDockerError(message string) {
if !c.AllowDisabledDocker {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

kubelet removed the ability to pass the client through, so the responsibility for wiring a fake falls to kubelet. We can't wire it through any more.

glog.Fatalf("error: %s", message)
}
glog.Errorf("WARNING: %s", message)
c.DockerClient = &dockertools.FakeDockerClient{
VersionInfo: dockertypes.Version{
APIVersion: minimumDockerAPIVersionWithPullByID,
Version: "1.13",
},
Information: dockertypes.Info{
CgroupDriver: "systemd",
},
}
c.DockerClientConfig = dockerClientConfig
}

// EnsureVolumeDir attempts to convert the provided volume directory argument to
Expand Down Expand Up @@ -251,7 +245,7 @@ func (c *NodeConfig) RunKubelet() {
}

// only set when ContainerRuntime == "docker"
c.KubeletDeps.DockerClient = c.DockerClient
c.KubeletDeps.DockerClientConfig = c.DockerClientConfig
// updated by NodeConfig.EnsureVolumeDir
c.KubeletServer.RootDirectory = c.VolumeDir

Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/server/kubernetes/node/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/tls"

"github.com/golang/glog"
"k8s.io/kubernetes/pkg/kubelet/dockershim"

kclientsetexternal "k8s.io/client-go/kubernetes"
"k8s.io/client-go/util/cert"
Expand All @@ -12,7 +13,6 @@ import (
"k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/kubelet"
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1alpha1"
dockertools "k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
kubeletserver "k8s.io/kubernetes/pkg/kubelet/server"

configapi "github.com/openshift/origin/pkg/cmd/server/api"
Expand All @@ -35,8 +35,8 @@ type NodeConfig struct {
// the cluster. It should not be passed into the Kubelet.
DNSClient kclientsetexternal.Interface

// DockerClient is a client to connect to Docker
DockerClient dockertools.Interface
// DockerClientConfig is a client config to connect to Docker
DockerClientConfig *dockershim.ClientConfig
// KubeletServer contains the KubeletServer configuration
KubeletServer *kubeletoptions.KubeletServer
// KubeletDeps are the injected code dependencies for the kubelet, fully initialized
Expand Down
111 changes: 56 additions & 55 deletions pkg/cmd/server/kubernetes/node/node_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ import (
"k8s.io/apiserver/pkg/util/flag"
kubeproxyoptions "k8s.io/kubernetes/cmd/kube-proxy/app"
kubeletoptions "k8s.io/kubernetes/cmd/kubelet/app/options"
"k8s.io/kubernetes/pkg/apis/componentconfig"
"k8s.io/kubernetes/pkg/cloudprovider"
"k8s.io/kubernetes/pkg/cloudprovider/providers/fake"
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
"k8s.io/kubernetes/pkg/kubelet/config"
"k8s.io/kubernetes/pkg/kubelet/rkt"
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
"k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"
)

func TestKubeletDefaults(t *testing.T) {
Expand All @@ -29,18 +30,29 @@ func TestKubeletDefaults(t *testing.T) {
expectedDefaults := &kubeletoptions.KubeletServer{
KubeletFlags: kubeletoptions.KubeletFlags{
KubeConfig: flag.NewStringFlag("/var/lib/kubelet/kubeconfig"),
ContainerRuntimeOptions: kubeletoptions.ContainerRuntimeOptions{
ContainerRuntimeOptions: config.ContainerRuntimeOptions{
DockershimRootDirectory: "/var/lib/dockershim",
DockerExecHandlerName: "native",
DockerEndpoint: "unix:///var/run/docker.sock",
ImagePullProgressDeadline: metav1.Duration{Duration: 1 * time.Minute},
RktAPIEndpoint: rkt.DefaultRktAPIServiceEndpoint,
PodSandboxImage: "gcr.io/google_containers/pause-" + goruntime.GOARCH + ":3.0", // overridden
DockerDisableSharedPID: true,
ContainerRuntime: "docker",
},
CloudProvider: "auto-detect",
RootDirectory: "/var/lib/kubelet",
CertDirectory: "/var/lib/kubelet/pki",
CloudProvider: "", // now disabled
RootDirectory: "/var/lib/kubelet",
CertDirectory: "/var/lib/kubelet/pki",
RegisterNode: true, // this looks suspicious
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment... this is ok

RemoteRuntimeEndpoint: "unix:///var/run/dockershim.sock", // overridden
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Containerized: false, // overridden based on OPENSHIFT_CONTAINERIZED

VolumePluginDir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
SeccompProfileRoot: "/var/lib/kubelet/seccomp",
MaxContainerCount: -1,
MasterServiceNamespace: "default",
ExperimentalQOSReserved: map[string]string{},
NodeLabels: map[string]string{},
MaxPerPodContainerCount: 1,
RegisterSchedulable: true,
NonMasqueradeCIDR: "10.0.0.0/8",
},

KubeletConfiguration: kubeletconfig.KubeletConfiguration{
Expand All @@ -65,18 +77,21 @@ func TestKubeletDefaults(t *testing.T) {
VolumeStatsAggPeriod: metav1.Duration{Duration: time.Minute},
CgroupRoot: "",
CgroupDriver: "cgroupfs",
ClusterDNS: nil, // overridden
ClusterDomain: "", // overridden
ContainerRuntime: "docker",
Containerized: false, // overridden based on OPENSHIFT_CONTAINERIZED
CPUCFSQuota: true, // forced to true

EventBurst: 10,
EventRecordQPS: 5.0,
EnableCustomMetrics: false,
EnableDebuggingHandlers: true,
EnableServer: true,
EvictionHard: "memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%",
ClusterDNS: nil, // overridden
ClusterDomain: "", // overridden
CPUCFSQuota: true, // forced to true

EventBurst: 10,
EventRecordQPS: 5.0,
//EnableCustomMetrics: false,
EnableDebuggingHandlers: true,
EnableServer: true,
EvictionHard: map[string]string{
"memory.available": "100Mi",
"nodefs.available": "10%",
"nodefs.inodesFree": "5%",
"imagefs.available": "15%",
},
FileCheckFrequency: metav1.Duration{Duration: 20 * time.Second}, // overridden
HealthzBindAddress: "127.0.0.1", // disabled
HealthzPort: 10248, // disabled
Expand All @@ -92,31 +107,19 @@ func TestKubeletDefaults(t *testing.T) {
// TODO figure out where this moved
// LowDiskSpaceThresholdMB: 0, // used to be 256. Overriden to have old behavior. 3.7
MakeIPTablesUtilChains: true,
MasterServiceNamespace: "default",
MaxContainerCount: -1,
MaxPerPodContainerCount: 1,
MaxOpenFiles: 1000000,
MaxPods: 110, // overridden
MinimumGCAge: metav1.Duration{},
NonMasqueradeCIDR: "10.0.0.0/8",
VolumePluginDir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
NodeStatusUpdateFrequency: metav1.Duration{Duration: 10 * time.Second},
NodeLabels: nil,
OOMScoreAdj: -999,
LockFilePath: "",
Port: 10250, // overridden
ReadOnlyPort: 10255, // disabled
RegisterNode: true,
RegisterSchedulable: true,
RegistryBurst: 10,
RegistryPullQPS: 5.0,
RemoteRuntimeEndpoint: "unix:///var/run/dockershim.sock", // overridden
ResolverConfig: kubetypes.ResolvConfDefault,
KubeletCgroups: "",
CgroupsPerQOS: true,
// TODO figure out where this moved
// RootDirectory: "/var/lib/kubelet", // overridden
RuntimeCgroups: "",
//RuntimeCgroups: "",
SerializeImagePulls: true,
StreamingConnectionIdleTimeout: metav1.Duration{Duration: 4 * time.Hour},
SyncFrequency: metav1.Duration{Duration: 1 * time.Minute},
Expand All @@ -125,22 +128,15 @@ func TestKubeletDefaults(t *testing.T) {
TLSPrivateKeyFile: "", // overridden to prevent cert generation
KubeAPIQPS: 5.0,
KubeAPIBurst: 10,
// TODO figure out where this moved
// OutOfDiskTransitionFrequency: metav1.Duration{Duration: 5 * time.Minute},
HairpinMode: "promiscuous-bridge",
SeccompProfileRoot: "/var/lib/kubelet/seccomp",
// TODO figure out where this moved
// CloudProvider: "auto-detect",
RuntimeRequestTimeout: metav1.Duration{Duration: 2 * time.Minute},
ContentType: "application/vnd.kubernetes.protobuf",
EnableControllerAttachDetach: true,
ExperimentalQOSReserved: kubeletconfig.ConfigurationMap{},
HairpinMode: "promiscuous-bridge",
RuntimeRequestTimeout: metav1.Duration{Duration: 2 * time.Minute},
ContentType: "application/vnd.kubernetes.protobuf",
EnableControllerAttachDetach: true,

EvictionPressureTransitionPeriod: metav1.Duration{Duration: 5 * time.Minute},
ExperimentalKernelMemcgNotification: false,
EvictionPressureTransitionPeriod: metav1.Duration{Duration: 5 * time.Minute},

SystemReserved: kubeletconfig.ConfigurationMap{},
KubeReserved: kubeletconfig.ConfigurationMap{},
SystemReserved: nil,
KubeReserved: nil,

EnforceNodeAllocatable: []string{"pods"},

Expand All @@ -151,7 +147,7 @@ func TestKubeletDefaults(t *testing.T) {
}

if goruntime.GOOS == "darwin" {
expectedDefaults.KubeletConfiguration.RemoteRuntimeEndpoint = ""
//expectedDefaults.KubeletConfiguration.RemoteRuntimeEndpoint = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow up to restore this, object.KubeletFlags.RemoteRuntimeEndpoint

}

if !reflect.DeepEqual(defaults, expectedDefaults) {
Expand All @@ -166,33 +162,38 @@ func TestProxyConfig(t *testing.T) {
// Once we've reacted to the changes appropriately in buildKubeProxyConfig(), update this expected default to match the new upstream defaults
oomScoreAdj := int32(-999)
ipTablesMasqueratebit := int32(14)
conntrackMin := int32(128 * 1024)
conntrackMaxPerCore := int32(32 * 1024)

expectedProxyConfig := &componentconfig.KubeProxyConfiguration{
expectedProxyConfig := &kubeproxyconfig.KubeProxyConfiguration{
BindAddress: "0.0.0.0",
HealthzBindAddress: "0.0.0.0:10256", // disabled
MetricsBindAddress: "127.0.0.1:10249", // disabled
ClientConnection: componentconfig.ClientConnectionConfiguration{
ClientConnection: kubeproxyconfig.ClientConnectionConfiguration{
ContentType: "application/vnd.kubernetes.protobuf",
QPS: 5,
Burst: 10,
},
IPTables: componentconfig.KubeProxyIPTablesConfiguration{
IPTables: kubeproxyconfig.KubeProxyIPTablesConfiguration{
MasqueradeBit: &ipTablesMasqueratebit,
SyncPeriod: metav1.Duration{Duration: 30 * time.Second},
},
IPVS: kubeproxyconfig.KubeProxyIPVSConfiguration{
SyncPeriod: metav1.Duration{Duration: 30 * time.Second},
},
OOMScoreAdj: &oomScoreAdj, // disabled
ResourceContainer: "/kube-proxy", // disabled
UDPIdleTimeout: metav1.Duration{Duration: 250 * time.Millisecond},
Conntrack: componentconfig.KubeProxyConntrackConfiguration{
Min: 128 * 1024,
MaxPerCore: 32 * 1024,
TCPEstablishedTimeout: metav1.Duration{Duration: 86400 * time.Second}, // 1 day (1/5 default)
TCPCloseWaitTimeout: metav1.Duration{Duration: 1 * time.Hour},
Conntrack: kubeproxyconfig.KubeProxyConntrackConfiguration{
Min: &conntrackMin,
MaxPerCore: &conntrackMaxPerCore,
TCPEstablishedTimeout: &metav1.Duration{Duration: 86400 * time.Second}, // 1 day (1/5 default)
TCPCloseWaitTimeout: &metav1.Duration{Duration: 1 * time.Hour},
},
ConfigSyncPeriod: metav1.Duration{Duration: 15 * time.Minute},
}

actualDefaultConfig, _ := kubeproxyoptions.NewOptions()
actualDefaultConfig := kubeproxyoptions.NewOptions()
actualConfig, _ := actualDefaultConfig.ApplyDefaults(actualDefaultConfig.GetConfig())

if !reflect.DeepEqual(expectedProxyConfig, actualConfig) {
Expand Down
4 changes: 1 addition & 3 deletions pkg/cmd/server/kubernetes/node/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func Build(options configapi.NodeConfig) (*kubeletoptions.KubeletServer, error)
server.MaxPods = 250
server.PodsPerCore = 10
server.CgroupDriver = "systemd"
server.DockerExecHandlerName = string(options.DockerConfig.ExecHandlerName)
server.RemoteRuntimeEndpoint = options.DockerConfig.DockerShimSocket
server.RemoteImageEndpoint = options.DockerConfig.DockerShimSocket
server.DockershimRootDirectory = options.DockerConfig.DockershimRootDirectory
Expand Down Expand Up @@ -128,7 +127,7 @@ func Build(options configapi.NodeConfig) (*kubeletoptions.KubeletServer, error)

// terminate early if feature gate is incorrect on the node
if len(server.FeatureGates) > 0 {
if err := utilfeature.DefaultFeatureGate.Set(server.FeatureGates); err != nil {
if err := utilfeature.DefaultFeatureGate.SetFromMap(server.FeatureGates); err != nil {
return nil, err
}
}
Expand All @@ -143,7 +142,6 @@ func Build(options configapi.NodeConfig) (*kubeletoptions.KubeletServer, error)
if network.IsOpenShiftNetworkPlugin(options.NetworkConfig.NetworkPluginName) {
// SDN plugin pod setup/teardown is implemented as a CNI plugin
server.NetworkPluginName = kubeletcni.CNIPluginName
server.NetworkPluginDir = kubeletcni.DefaultNetDir
server.CNIConfDir = kubeletcni.DefaultNetDir
server.CNIBinDir = kubeletcni.DefaultCNIDir
server.HairpinMode = kubeletconfig.HairpinNone
Expand Down