From d023f3d25df5f3f16f8ec57324ea0765a256c605 Mon Sep 17 00:00:00 2001 From: "Rostislav M. Georgiev" Date: Mon, 22 Jun 2020 14:39:34 +0300 Subject: [PATCH] kubeadm: Cleanup and refactor the LoadJoinConfigurationFromFile test Back in the v1alpha2 days the fuzzer test needed to be disabled. To ensure that there were no config breaks and everything worked correctly extensive replacement tests were put in place that functioned as unit tests for the kubeadm config utils as well. The fuzzer test has been reenabled for a long time now and there's no need for these replacements. Hence, over time most of these were disabled, deleted and refactored. The last remnants are part of the LoadJoinConfigurationFromFile test. The test data for those old tests remains largely unused today, but it still receives updates as it contains kubelet's and kube-proxy's component configs. Updates to these configs are usually done because the maintainers of those need to add a new field. Hence, to cleanup old code and reduce maintenance burden, the last test that depends on this test data is finally refactored and cleaned up to represent a simple unit test of `LoadJoinConfigurationFromFile`. Signed-off-by: Rostislav M. Georgiev --- cmd/kubeadm/app/util/config/BUILD | 3 - .../app/util/config/initconfiguration_test.go | 21 +- .../app/util/config/joinconfiguration_test.go | 149 +++++++------ .../conversion/controlplane/internal.yaml | 208 ------------------ .../controlplane/internal_non_linux.yaml | 206 ----------------- .../conversion/controlplane/v1beta1.yaml | 170 -------------- .../controlplane/v1beta1_non_linux.yaml | 168 -------------- .../testdata/conversion/node/internal.yaml | 23 -- .../testdata/conversion/node/v1beta1.yaml | 20 -- .../testdata/conversion/node/v1beta2.yaml | 20 -- .../defaulting/controlplane/defaulted.yaml | 155 ------------- .../controlplane/defaulted_non_linux.yaml | 154 ------------- .../defaulting/controlplane/incomplete.yaml | 19 -- .../testdata/defaulting/node/defaulted.yaml | 14 -- .../testdata/defaulting/node/incomplete.yaml | 11 - .../validation/invalid_controlplanecfg.yaml | 7 - .../testdata/validation/invalid_nodecfg.yaml | 15 -- 17 files changed, 79 insertions(+), 1284 deletions(-) delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal_non_linux.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1_non_linux.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/node/internal.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta1.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta2.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted_non_linux.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/incomplete.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/defaulting/node/defaulted.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/defaulting/node/incomplete.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/validation/invalid_controlplanecfg.yaml delete mode 100644 cmd/kubeadm/app/util/config/testdata/validation/invalid_nodecfg.yaml diff --git a/cmd/kubeadm/app/util/config/BUILD b/cmd/kubeadm/app/util/config/BUILD index 53949fdaf95..05d06bcc9e1 100644 --- a/cmd/kubeadm/app/util/config/BUILD +++ b/cmd/kubeadm/app/util/config/BUILD @@ -56,8 +56,6 @@ go_test( embed = [":go_default_library"], deps = [ "//cmd/kubeadm/app/apis/kubeadm:go_default_library", - "//cmd/kubeadm/app/apis/kubeadm/scheme:go_default_library", - "//cmd/kubeadm/app/apis/kubeadm/v1beta1:go_default_library", "//cmd/kubeadm/app/apis/kubeadm/v1beta2:go_default_library", "//cmd/kubeadm/app/componentconfigs:go_default_library", "//cmd/kubeadm/app/constants:go_default_library", @@ -74,7 +72,6 @@ go_test( "//staging/src/k8s.io/client-go/testing:go_default_library", "//vendor/github.com/lithammer/dedent:go_default_library", "//vendor/github.com/pkg/errors:go_default_library", - "//vendor/github.com/pmezard/go-difflib/difflib:go_default_library", "//vendor/sigs.k8s.io/yaml:go_default_library", ], ) diff --git a/cmd/kubeadm/app/util/config/initconfiguration_test.go b/cmd/kubeadm/app/util/config/initconfiguration_test.go index 9a46ea75478..435a3401e91 100644 --- a/cmd/kubeadm/app/util/config/initconfiguration_test.go +++ b/cmd/kubeadm/app/util/config/initconfiguration_test.go @@ -23,8 +23,6 @@ import ( "path/filepath" "testing" - "github.com/pmezard/go-difflib/difflib" - "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" @@ -32,24 +30,11 @@ import ( "sigs.k8s.io/yaml" ) -func diff(expected, actual []byte) string { - // Write out the diff - var diffBytes bytes.Buffer - difflib.WriteUnifiedDiff(&diffBytes, difflib.UnifiedDiff{ - A: difflib.SplitLines(string(expected)), - B: difflib.SplitLines(string(actual)), - FromFile: "expected", - ToFile: "actual", - Context: 3, - }) - return diffBytes.String() -} - func TestLoadInitConfigurationFromFile(t *testing.T) { // Create temp folder for the test case tmpdir, err := ioutil.TempDir("", "") if err != nil { - t.Fatalf("Couldn't create tmpdir") + t.Fatalf("Couldn't create tmpdir: %v", err) } defer os.RemoveAll(tmpdir) @@ -100,7 +85,7 @@ func TestLoadInitConfigurationFromFile(t *testing.T) { cfgPath := filepath.Join(tmpdir, rt.name) err := ioutil.WriteFile(cfgPath, rt.fileContents, 0644) if err != nil { - t.Errorf("Couldn't create file") + t.Errorf("Couldn't create file: %v", err) return } @@ -116,7 +101,7 @@ func TestLoadInitConfigurationFromFile(t *testing.T) { } if obj == nil { - t.Errorf("Unexpected nil return value") + t.Error("Unexpected nil return value") } } }) diff --git a/cmd/kubeadm/app/util/config/joinconfiguration_test.go b/cmd/kubeadm/app/util/config/joinconfiguration_test.go index cd9649ccbcd..5d52eb30011 100644 --- a/cmd/kubeadm/app/util/config/joinconfiguration_test.go +++ b/cmd/kubeadm/app/util/config/joinconfiguration_test.go @@ -17,100 +17,103 @@ limitations under the License. package config import ( - "bytes" "io/ioutil" + "os" + "path/filepath" "testing" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" - "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/scheme" - kubeadmapiv1beta1 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta1" - kubeadmapiv1beta2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" - kubeadmutil "k8s.io/kubernetes/cmd/kubeadm/app/util" -) - -const ( - nodeV1beta1YAML = "testdata/conversion/node/v1beta1.yaml" - nodeV1beta2YAML = "testdata/conversion/node/v1beta2.yaml" - nodeInternalYAML = "testdata/conversion/node/internal.yaml" - nodeIncompleteYAML = "testdata/defaulting/node/incomplete.yaml" - nodeDefaultedYAML = "testdata/defaulting/node/defaulted.yaml" - nodeInvalidYAML = "testdata/validation/invalid_nodecfg.yaml" + "github.com/lithammer/dedent" ) func TestLoadJoinConfigurationFromFile(t *testing.T) { + // Create temp folder for the test case + tmpdir, err := ioutil.TempDir("", "") + if err != nil { + t.Fatalf("Couldn't create tmpdir: %v", err) + } + defer os.RemoveAll(tmpdir) + + // cfgFiles is in cluster_test.go var tests = []struct { - name, in, out string - groupVersion schema.GroupVersion - expectedErr bool + name string + fileContents string + expectErr bool }{ - // These tests are reading one file, loading it using LoadJoinConfigurationFromFile that all of kubeadm is using for unmarshal of our API types, - // and then marshals the internal object to the expected groupVersion - { // v1beta1 -> internal - name: "v1beta1ToInternal", - in: nodeV1beta1YAML, - out: nodeInternalYAML, - groupVersion: kubeadm.SchemeGroupVersion, + { + name: "empty file causes error", + expectErr: true, }, - { // v1beta1 -> internal -> v1beta1 - name: "v1beta1Tov1beta1", - in: nodeV1beta1YAML, - out: nodeV1beta1YAML, - groupVersion: kubeadmapiv1beta1.SchemeGroupVersion, + { + name: "Invalid v1beta1 causes error", + fileContents: dedent.Dedent(` + apiVersion: kubeadm.k8s.io/v1beta1 + kind: JoinConfiguration + `), + expectErr: true, }, - { // v1beta2 -> internal - name: "v1beta2ToInternal", - in: nodeV1beta2YAML, - out: nodeInternalYAML, - groupVersion: kubeadm.SchemeGroupVersion, + { + name: "valid v1beta1 is loaded", + fileContents: dedent.Dedent(` + apiVersion: kubeadm.k8s.io/v1beta1 + kind: JoinConfiguration + caCertPath: /etc/kubernetes/pki/ca.crt + discovery: + bootstrapToken: + apiServerEndpoint: kube-apiserver:6443 + token: abcdef.0123456789abcdef + unsafeSkipCAVerification: true + timeout: 5m0s + tlsBootstrapToken: abcdef.0123456789abcdef + `), }, - { // v1beta2 -> internal -> v1beta2 - name: "v1beta2Tov1beta2", - in: nodeV1beta2YAML, - out: nodeV1beta2YAML, - groupVersion: kubeadmapiv1beta2.SchemeGroupVersion, + { + name: "Invalid v1beta2 causes error", + fileContents: dedent.Dedent(` + apiVersion: kubeadm.k8s.io/v1beta2 + kind: JoinConfiguration + `), + expectErr: true, }, - // These tests are reading one file that has only a subset of the fields populated, loading it using LoadJoinConfigurationFromFile, - // and then marshals the internal object to the expected groupVersion - { // v1beta2 -> default -> validate -> internal -> v1beta2 - name: "incompleteYAMLToDefaultedv1beta2", - in: nodeIncompleteYAML, - out: nodeDefaultedYAML, - groupVersion: kubeadmapiv1beta2.SchemeGroupVersion, - }, - { // v1beta2 -> validation should fail - name: "invalidYAMLShouldFail", - in: nodeInvalidYAML, - expectedErr: true, + { + name: "valid v1beta2 is loaded", + fileContents: dedent.Dedent(` + apiVersion: kubeadm.k8s.io/v1beta2 + kind: JoinConfiguration + caCertPath: /etc/kubernetes/pki/ca.crt + discovery: + bootstrapToken: + apiServerEndpoint: kube-apiserver:6443 + token: abcdef.0123456789abcdef + unsafeSkipCAVerification: true + timeout: 5m0s + tlsBootstrapToken: abcdef.0123456789abcdef + `), }, } for _, rt := range tests { t.Run(rt.name, func(t2 *testing.T) { - - internalcfg, err := LoadJoinConfigurationFromFile(rt.in) + cfgPath := filepath.Join(tmpdir, rt.name) + err := ioutil.WriteFile(cfgPath, []byte(rt.fileContents), 0644) if err != nil { - if rt.expectedErr { + t.Errorf("Couldn't create file: %v", err) + return + } + + obj, err := LoadJoinConfigurationFromFile(cfgPath) + if rt.expectErr { + if err == nil { + t.Error("Unexpected success") + } + } else { + if err != nil { + t.Errorf("Error reading file: %v", err) return } - t2.Fatalf("couldn't unmarshal test data: %v", err) - } else if rt.expectedErr { - t2.Fatalf("expected error, but no error returned") - } - actual, err := kubeadmutil.MarshalToYamlForCodecs(internalcfg, rt.groupVersion, scheme.Codecs) - if err != nil { - t2.Fatalf("couldn't marshal internal object: %v", err) - } - - expected, err := ioutil.ReadFile(rt.out) - if err != nil { - t2.Fatalf("couldn't read test data: %v", err) - } - - if !bytes.Equal(expected, actual) { - t2.Errorf("the expected and actual output differs.\n\tin: %s\n\tout: %s\n\tgroupversion: %s\n\tdiff: \n%s\n", - rt.in, rt.out, rt.groupVersion.String(), diff(expected, actual)) + if obj == nil { + t.Error("Unexpected nil return value") + } } }) } diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal.yaml deleted file mode 100644 index 32dad2254bc..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal.yaml +++ /dev/null @@ -1,208 +0,0 @@ -APIServer: - CertSANs: null - ExtraArgs: - authorization-mode: Node,RBAC,Webhook - ExtraVolumes: - - HostPath: /host/read-only - MountPath: /mount/read-only - Name: ReadOnlyVolume - PathType: "" - ReadOnly: true - - HostPath: /host/writable - MountPath: /mount/writable - Name: WritableVolume - PathType: "" - ReadOnly: false - TimeoutForControlPlane: 4m0s -BootstrapTokens: -- Description: "" - Expires: null - Groups: - - system:bootstrappers:kubeadm:default-node-token - TTL: 24h0m0s - Token: s73ybu.6tw6wnqgp5z0wb77 - Usages: - - signing - - authentication -CIImageRepository: "" -CertificatesDir: /etc/kubernetes/pki -ClusterName: kubernetes -ComponentConfigs: - KubeProxy: - BindAddress: 0.0.0.0 - BindAddressHardFail: false - ClientConnection: - AcceptContentTypes: "" - Burst: 10 - ContentType: application/vnd.kubernetes.protobuf - Kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - QPS: 5 - ClusterCIDR: "" - ConfigSyncPeriod: 15m0s - Conntrack: - MaxPerCore: 32768 - Min: 131072 - TCPCloseWaitTimeout: 1h0m0s - TCPEstablishedTimeout: 24h0m0s - EnableProfiling: false - FeatureGates: - ServiceNodeExclusion: true - SupportIPVSProxyMode: true - HealthzBindAddress: 0.0.0.0:10256 - HostnameOverride: "" - IPTables: - MasqueradeAll: false - MasqueradeBit: 14 - MinSyncPeriod: 0s - SyncPeriod: 30s - IPVS: - ExcludeCIDRs: null - MinSyncPeriod: 0s - Scheduler: "" - SyncPeriod: 30s - MetricsBindAddress: 127.0.0.1:10249 - Mode: iptables - NodePortAddresses: null - OOMScoreAdj: -999 - PortRange: "" - UDPIdleTimeout: 250ms - Winkernel: - EnableDSR: false - NetworkName: "" - SourceVip: "" - Kubelet: - Address: 1.2.3.4 - AllowedUnsafeSysctls: null - Authentication: - Anonymous: - Enabled: false - Webhook: - CacheTTL: 2m0s - Enabled: true - X509: - ClientCAFile: /etc/kubernetes/pki/ca.crt - Authorization: - Mode: Webhook - Webhook: - CacheAuthorizedTTL: 5m0s - CacheUnauthorizedTTL: 30s - CPUCFSQuota: true - CPUCFSQuotaPeriod: 0s - CPUManagerPolicy: none - CPUManagerReconcilePeriod: 10s - CgroupDriver: cgroupfs - CgroupRoot: "" - CgroupsPerQOS: true - ClusterDNS: - - 10.96.0.10 - ClusterDomain: cluster.local - ConfigMapAndSecretChangeDetectionStrategy: Watch - ContainerLogMaxFiles: 5 - ContainerLogMaxSize: 10Mi - ContentType: application/vnd.kubernetes.protobuf - EnableContentionProfiling: false - EnableControllerAttachDetach: true - EnableDebuggingHandlers: true - EnforceNodeAllocatable: - - pods - EventBurst: 10 - EventRecordQPS: 5 - EvictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% - nodefs.inodesFree: 5% - EvictionMaxPodGracePeriod: 0 - EvictionMinimumReclaim: null - EvictionPressureTransitionPeriod: 5m0s - EvictionSoft: null - EvictionSoftGracePeriod: null - FailSwapOn: true - FeatureGates: null - FileCheckFrequency: 20s - HTTPCheckFrequency: 20s - HairpinMode: promiscuous-bridge - HealthzBindAddress: 127.0.0.1 - HealthzPort: 10248 - IPTablesDropBit: 15 - IPTablesMasqueradeBit: 14 - ImageGCHighThresholdPercent: 85 - ImageGCLowThresholdPercent: 80 - ImageMinimumGCAge: 2m0s - KubeAPIBurst: 10 - KubeAPIQPS: 5 - KubeReserved: null - KubeReservedCgroup: "" - KubeletCgroups: "" - MakeIPTablesUtilChains: true - MaxOpenFiles: 1000000 - MaxPods: 110 - NodeLeaseDurationSeconds: 40 - NodeStatusReportFrequency: 1m0s - NodeStatusUpdateFrequency: 10s - OOMScoreAdj: -999 - PodCIDR: "" - PodPidsLimit: -1 - PodsPerCore: 0 - Port: 10250 - ProtectKernelDefaults: false - QOSReserved: null - ReadOnlyPort: 0 - RegistryBurst: 10 - RegistryPullQPS: 5 - ResolverConfig: /etc/resolv.conf - RotateCertificates: true - RuntimeRequestTimeout: 2m0s - SerializeImagePulls: true - ServerTLSBootstrap: false - StaticPodPath: /etc/kubernetes/manifests - StaticPodURL: "" - StaticPodURLHeader: null - StreamingConnectionIdleTimeout: 4h0m0s - SyncFrequency: 1m0s - SystemCgroups: "" - SystemReserved: null - SystemReservedCgroup: "" - TLSCertFile: "" - TLSCipherSuites: null - TLSMinVersion: "" - TLSPrivateKeyFile: "" - VolumeStatsAggPeriod: 1m0s -ControlPlaneEndpoint: "" -ControllerManager: - ExtraArgs: null - ExtraVolumes: null -DNS: - ImageRepository: "" - ImageTag: "" - Type: CoreDNS -Etcd: - External: null - Local: - DataDir: /var/lib/etcd - ExtraArgs: null - ImageRepository: "" - ImageTag: "" - PeerCertSANs: null - ServerCertSANs: null -FeatureGates: null -ImageRepository: k8s.gcr.io -KubernetesVersion: v1.12.2 -LocalAPIEndpoint: - AdvertiseAddress: 192.168.2.2 - BindPort: 6443 -Networking: - DNSDomain: cluster.local - PodSubnet: "" - ServiceSubnet: 10.96.0.0/12 -NodeRegistration: - CRISocket: /var/run/dockershim.sock - KubeletExtraArgs: null - Name: control-plane-1 - Taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master -Scheduler: - ExtraArgs: null - ExtraVolumes: null -UseHyperKubeImage: true diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal_non_linux.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal_non_linux.yaml deleted file mode 100644 index 6c67924061e..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/internal_non_linux.yaml +++ /dev/null @@ -1,206 +0,0 @@ -APIServer: - CertSANs: null - ExtraArgs: - authorization-mode: Node,RBAC,Webhook - ExtraVolumes: - - HostPath: /host/read-only - MountPath: /mount/read-only - Name: ReadOnlyVolume - PathType: "" - ReadOnly: true - - HostPath: /host/writable - MountPath: /mount/writable - Name: WritableVolume - PathType: "" - ReadOnly: false - TimeoutForControlPlane: 4m0s -BootstrapTokens: -- Description: "" - Expires: null - Groups: - - system:bootstrappers:kubeadm:default-node-token - TTL: 24h0m0s - Token: s73ybu.6tw6wnqgp5z0wb77 - Usages: - - signing - - authentication -CIImageRepository: "" -CertificatesDir: /etc/kubernetes/pki -ClusterName: kubernetes -ComponentConfigs: - KubeProxy: - BindAddress: 0.0.0.0 - BindAddressHardFail: false - ClientConnection: - AcceptContentTypes: "" - Burst: 10 - ContentType: application/vnd.kubernetes.protobuf - Kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - QPS: 5 - ClusterCIDR: "" - ConfigSyncPeriod: 15m0s - Conntrack: - MaxPerCore: 32768 - Min: 131072 - TCPCloseWaitTimeout: 1h0m0s - TCPEstablishedTimeout: 24h0m0s - EnableProfiling: false - FeatureGates: - ServiceNodeExclusion: true - SupportIPVSProxyMode: true - HealthzBindAddress: 0.0.0.0:10256 - HostnameOverride: "" - IPTables: - MasqueradeAll: false - MasqueradeBit: 14 - MinSyncPeriod: 0s - SyncPeriod: 30s - IPVS: - ExcludeCIDRs: null - MinSyncPeriod: 0s - Scheduler: "" - SyncPeriod: 30s - MetricsBindAddress: 127.0.0.1:10249 - Mode: iptables - NodePortAddresses: null - OOMScoreAdj: -999 - PortRange: "" - UDPIdleTimeout: 250ms - Winkernel: - EnableDSR: false - NetworkName: "" - SourceVip: "" - Kubelet: - Address: 1.2.3.4 - Authentication: - Anonymous: - Enabled: false - Webhook: - CacheTTL: 2m0s - Enabled: true - X509: - ClientCAFile: /etc/kubernetes/pki/ca.crt - Authorization: - Mode: Webhook - Webhook: - CacheAuthorizedTTL: 5m0s - CacheUnauthorizedTTL: 30s - CPUCFSQuota: true - CPUCFSQuotaPeriod: 0s - CPUManagerPolicy: none - CPUManagerReconcilePeriod: 10s - CgroupDriver: cgroupfs - CgroupRoot: "" - CgroupsPerQOS: true - ClusterDNS: - - 10.96.0.10 - ClusterDomain: cluster.local - ConfigMapAndSecretChangeDetectionStrategy: Watch - ContainerLogMaxFiles: 5 - ContainerLogMaxSize: 10Mi - ContentType: application/vnd.kubernetes.protobuf - EnableContentionProfiling: false - EnableControllerAttachDetach: true - EnableDebuggingHandlers: true - EnforceNodeAllocatable: - - pods - EventBurst: 10 - EventRecordQPS: 5 - EvictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% - EvictionMaxPodGracePeriod: 0 - EvictionMinimumReclaim: null - EvictionPressureTransitionPeriod: 5m0s - EvictionSoft: null - EvictionSoftGracePeriod: null - FailSwapOn: true - FeatureGates: null - FileCheckFrequency: 20s - HTTPCheckFrequency: 20s - HairpinMode: promiscuous-bridge - HealthzBindAddress: 127.0.0.1 - HealthzPort: 10248 - IPTablesDropBit: 15 - IPTablesMasqueradeBit: 14 - ImageGCHighThresholdPercent: 85 - ImageGCLowThresholdPercent: 80 - ImageMinimumGCAge: 2m0s - KubeAPIBurst: 10 - KubeAPIQPS: 5 - KubeReserved: null - KubeReservedCgroup: "" - KubeletCgroups: "" - MakeIPTablesUtilChains: true - MaxOpenFiles: 1000000 - MaxPods: 110 - NodeLeaseDurationSeconds: 40 - NodeStatusReportFrequency: 1m0s - NodeStatusUpdateFrequency: 10s - OOMScoreAdj: -999 - PodCIDR: "" - PodPidsLimit: -1 - PodsPerCore: 0 - Port: 10250 - ProtectKernelDefaults: false - QOSReserved: null - ReadOnlyPort: 0 - RegistryBurst: 10 - RegistryPullQPS: 5 - ResolverConfig: /etc/resolv.conf - RotateCertificates: true - RuntimeRequestTimeout: 2m0s - SerializeImagePulls: true - ServerTLSBootstrap: false - StaticPodPath: /etc/kubernetes/manifests - StaticPodURL: "" - StaticPodURLHeader: null - StreamingConnectionIdleTimeout: 4h0m0s - SyncFrequency: 1m0s - SystemCgroups: "" - SystemReserved: null - SystemReservedCgroup: "" - TLSCertFile: "" - TLSCipherSuites: null - TLSMinVersion: "" - TLSPrivateKeyFile: "" - VolumeStatsAggPeriod: 1m0s -ControlPlaneEndpoint: "" -ControllerManager: - ExtraArgs: null - ExtraVolumes: null -DNS: - ImageRepository: "" - ImageTag: "" - Type: CoreDNS -Etcd: - External: null - Local: - DataDir: /var/lib/etcd - ExtraArgs: null - ImageRepository: "" - ImageTag: "" - PeerCertSANs: null - ServerCertSANs: null -FeatureGates: null -ImageRepository: k8s.gcr.io -KubernetesVersion: v1.12.2 -LocalAPIEndpoint: - AdvertiseAddress: 192.168.2.2 - BindPort: 6443 -Networking: - DNSDomain: cluster.local - PodSubnet: "" - ServiceSubnet: 10.96.0.0/12 -NodeRegistration: - CRISocket: /var/run/dockershim.sock - KubeletExtraArgs: null - Name: control-plane-1 - Taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master -Scheduler: - ExtraArgs: null - ExtraVolumes: null -UseHyperKubeImage: true diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1.yaml deleted file mode 100644 index 0dbaca5917b..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1.yaml +++ /dev/null @@ -1,170 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -bootstrapTokens: -- groups: - - system:bootstrappers:kubeadm:default-node-token - token: s73ybu.6tw6wnqgp5z0wb77 - ttl: 24h0m0s - usages: - - signing - - authentication -kind: InitConfiguration -localAPIEndpoint: - advertiseAddress: 192.168.2.2 - bindPort: 6443 -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: control-plane-1 - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master ---- -apiServer: - extraArgs: - authorization-mode: Node,RBAC,Webhook - extraVolumes: - - hostPath: /host/read-only - mountPath: /mount/read-only - name: ReadOnlyVolume - readOnly: true - - hostPath: /host/writable - mountPath: /mount/writable - name: WritableVolume - timeoutForControlPlane: 4m0s -apiVersion: kubeadm.k8s.io/v1beta1 -certificatesDir: /etc/kubernetes/pki -clusterName: kubernetes -controlPlaneEndpoint: "" -controllerManager: {} -dns: - type: CoreDNS -etcd: - local: - dataDir: /var/lib/etcd -imageRepository: k8s.gcr.io -kind: ClusterConfiguration -kubernetesVersion: v1.12.2 -networking: - dnsDomain: cluster.local - podSubnet: "" - serviceSubnet: 10.96.0.0/12 -scheduler: {} -useHyperKubeImage: true ---- -apiVersion: kubeproxy.config.k8s.io/v1alpha1 -bindAddress: 0.0.0.0 -bindAddressHardFail: false -clientConnection: - acceptContentTypes: "" - burst: 10 - contentType: application/vnd.kubernetes.protobuf - kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - qps: 5 -clusterCIDR: "" -configSyncPeriod: 15m0s -conntrack: - maxPerCore: 32768 - min: 131072 - tcpCloseWaitTimeout: 1h0m0s - tcpEstablishedTimeout: 24h0m0s -enableProfiling: false -featureGates: - ServiceNodeExclusion: true - SupportIPVSProxyMode: true -healthzBindAddress: 0.0.0.0:10256 -hostnameOverride: "" -iptables: - masqueradeAll: false - masqueradeBit: 14 - minSyncPeriod: 0s - syncPeriod: 30s -ipvs: - excludeCIDRs: null - minSyncPeriod: 0s - scheduler: "" - syncPeriod: 30s -kind: KubeProxyConfiguration -metricsBindAddress: 127.0.0.1:10249 -mode: iptables -nodePortAddresses: null -oomScoreAdj: -999 -portRange: "" -udpIdleTimeout: 250ms -winkernel: - enableDSR: false - networkName: "" - sourceVip: "" ---- -address: 1.2.3.4 -apiVersion: kubelet.config.k8s.io/v1beta1 -authentication: - anonymous: - enabled: false - webhook: - cacheTTL: 2m0s - enabled: true - x509: - clientCAFile: /etc/kubernetes/pki/ca.crt -authorization: - mode: Webhook - webhook: - cacheAuthorizedTTL: 5m0s - cacheUnauthorizedTTL: 30s -cgroupDriver: cgroupfs -cgroupsPerQOS: true -clusterDNS: -- 10.96.0.10 -clusterDomain: cluster.local -configMapAndSecretChangeDetectionStrategy: Watch -containerLogMaxFiles: 5 -containerLogMaxSize: 10Mi -contentType: application/vnd.kubernetes.protobuf -cpuCFSQuota: true -cpuCFSQuotaPeriod: 0s -cpuManagerPolicy: none -cpuManagerReconcilePeriod: 10s -enableControllerAttachDetach: true -enableDebuggingHandlers: true -enforceNodeAllocatable: -- pods -eventBurst: 10 -eventRecordQPS: 5 -evictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% - nodefs.inodesFree: 5% -evictionPressureTransitionPeriod: 5m0s -failSwapOn: true -fileCheckFrequency: 20s -hairpinMode: promiscuous-bridge -healthzBindAddress: 127.0.0.1 -healthzPort: 10248 -httpCheckFrequency: 20s -imageGCHighThresholdPercent: 85 -imageGCLowThresholdPercent: 80 -imageMinimumGCAge: 2m0s -iptablesDropBit: 15 -iptablesMasqueradeBit: 14 -kind: KubeletConfiguration -kubeAPIBurst: 10 -kubeAPIQPS: 5 -makeIPTablesUtilChains: true -maxOpenFiles: 1000000 -maxPods: 110 -nodeLeaseDurationSeconds: 40 -nodeStatusReportFrequency: 1m0s -nodeStatusUpdateFrequency: 10s -oomScoreAdj: -999 -podPidsLimit: -1 -port: 10250 -registryBurst: 10 -registryPullQPS: 5 -resolvConf: /etc/resolv.conf -rotateCertificates: true -runtimeRequestTimeout: 2m0s -serializeImagePulls: true -staticPodPath: /etc/kubernetes/manifests -streamingConnectionIdleTimeout: 4h0m0s -syncFrequency: 1m0s -volumeStatsAggPeriod: 1m0s -allowedUnsafeSysctls: [] diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1_non_linux.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1_non_linux.yaml deleted file mode 100644 index 77dce0f33cd..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/controlplane/v1beta1_non_linux.yaml +++ /dev/null @@ -1,168 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -bootstrapTokens: -- groups: - - system:bootstrappers:kubeadm:default-node-token - token: s73ybu.6tw6wnqgp5z0wb77 - ttl: 24h0m0s - usages: - - signing - - authentication -kind: InitConfiguration -localAPIEndpoint: - advertiseAddress: 192.168.2.2 - bindPort: 6443 -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: control-plane-1 - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master ---- -apiServer: - extraArgs: - authorization-mode: Node,RBAC,Webhook - extraVolumes: - - hostPath: /host/read-only - mountPath: /mount/read-only - name: ReadOnlyVolume - readOnly: true - - hostPath: /host/writable - mountPath: /mount/writable - name: WritableVolume - timeoutForControlPlane: 4m0s -apiVersion: kubeadm.k8s.io/v1beta1 -certificatesDir: /etc/kubernetes/pki -clusterName: kubernetes -controlPlaneEndpoint: "" -controllerManager: {} -dns: - type: CoreDNS -etcd: - local: - dataDir: /var/lib/etcd -imageRepository: k8s.gcr.io -kind: ClusterConfiguration -kubernetesVersion: v1.12.2 -networking: - dnsDomain: cluster.local - podSubnet: "" - serviceSubnet: 10.96.0.0/12 -scheduler: {} -useHyperKubeImage: true ---- -apiVersion: kubeproxy.config.k8s.io/v1alpha1 -bindAddress: 0.0.0.0 -bindAddressHardFail: false -clientConnection: - acceptContentTypes: "" - burst: 10 - contentType: application/vnd.kubernetes.protobuf - kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - qps: 5 -clusterCIDR: "" -configSyncPeriod: 15m0s -conntrack: - maxPerCore: 32768 - min: 131072 - tcpCloseWaitTimeout: 1h0m0s - tcpEstablishedTimeout: 24h0m0s -enableProfiling: false -featureGates: - ServiceNodeExclusion: true - SupportIPVSProxyMode: true -healthzBindAddress: 0.0.0.0:10256 -hostnameOverride: "" -iptables: - masqueradeAll: false - masqueradeBit: 14 - minSyncPeriod: 0s - syncPeriod: 30s -ipvs: - excludeCIDRs: null - minSyncPeriod: 0s - scheduler: "" - syncPeriod: 30s -kind: KubeProxyConfiguration -metricsBindAddress: 127.0.0.1:10249 -mode: iptables -nodePortAddresses: null -oomScoreAdj: -999 -portRange: "" -udpIdleTimeout: 250ms -winkernel: - enableDSR: false - networkName: "" - sourceVip: "" ---- -address: 1.2.3.4 -apiVersion: kubelet.config.k8s.io/v1beta1 -authentication: - anonymous: - enabled: false - webhook: - cacheTTL: 2m0s - enabled: true - x509: - clientCAFile: /etc/kubernetes/pki/ca.crt -authorization: - mode: Webhook - webhook: - cacheAuthorizedTTL: 5m0s - cacheUnauthorizedTTL: 30s -cgroupDriver: cgroupfs -cgroupsPerQOS: true -clusterDNS: -- 10.96.0.10 -clusterDomain: cluster.local -configMapAndSecretChangeDetectionStrategy: Watch -containerLogMaxFiles: 5 -containerLogMaxSize: 10Mi -contentType: application/vnd.kubernetes.protobuf -cpuCFSQuota: true -cpuCFSQuotaPeriod: 0s -cpuManagerPolicy: none -cpuManagerReconcilePeriod: 10s -enableControllerAttachDetach: true -enableDebuggingHandlers: true -enforceNodeAllocatable: -- pods -eventBurst: 10 -eventRecordQPS: 5 -evictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% -evictionPressureTransitionPeriod: 5m0s -failSwapOn: true -fileCheckFrequency: 20s -hairpinMode: promiscuous-bridge -healthzBindAddress: 127.0.0.1 -healthzPort: 10248 -httpCheckFrequency: 20s -imageGCHighThresholdPercent: 85 -imageGCLowThresholdPercent: 80 -imageMinimumGCAge: 2m0s -iptablesDropBit: 15 -iptablesMasqueradeBit: 14 -kind: KubeletConfiguration -kubeAPIBurst: 10 -kubeAPIQPS: 5 -makeIPTablesUtilChains: true -maxOpenFiles: 1000000 -maxPods: 110 -nodeLeaseDurationSeconds: 40 -nodeStatusReportFrequency: 1m0s -nodeStatusUpdateFrequency: 10s -oomScoreAdj: -999 -podPidsLimit: -1 -port: 10250 -registryBurst: 10 -registryPullQPS: 5 -resolvConf: /etc/resolv.conf -rotateCertificates: true -runtimeRequestTimeout: 2m0s -serializeImagePulls: true -staticPodPath: /etc/kubernetes/manifests -streamingConnectionIdleTimeout: 4h0m0s -syncFrequency: 1m0s -volumeStatsAggPeriod: 1m0s diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/node/internal.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/node/internal.yaml deleted file mode 100644 index e0af329be05..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/node/internal.yaml +++ /dev/null @@ -1,23 +0,0 @@ -CACertPath: /etc/kubernetes/pki/ca.crt -ControlPlane: - CertificateKey: "" - LocalAPIEndpoint: - AdvertiseAddress: 192.168.2.2 - BindPort: 6443 -Discovery: - BootstrapToken: - APIServerEndpoint: kube-apiserver:6443 - CACertHashes: null - Token: abcdef.0123456789abcdef - UnsafeSkipCAVerification: true - File: null - TLSBootstrapToken: abcdef.0123456789abcdef - Timeout: 5m0s -NodeRegistration: - CRISocket: /var/run/dockershim.sock - IgnorePreflightErrors: null - KubeletExtraArgs: null - Name: control-plane-1 - Taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta1.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta1.yaml deleted file mode 100644 index 90bd7430140..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta1.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -caCertPath: /etc/kubernetes/pki/ca.crt -controlPlane: - localAPIEndpoint: - advertiseAddress: 192.168.2.2 - bindPort: 6443 -discovery: - bootstrapToken: - apiServerEndpoint: kube-apiserver:6443 - token: abcdef.0123456789abcdef - unsafeSkipCAVerification: true - timeout: 5m0s - tlsBootstrapToken: abcdef.0123456789abcdef -kind: JoinConfiguration -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: control-plane-1 - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master diff --git a/cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta2.yaml b/cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta2.yaml deleted file mode 100644 index bd75a932a58..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/conversion/node/v1beta2.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta2 -caCertPath: /etc/kubernetes/pki/ca.crt -controlPlane: - localAPIEndpoint: - advertiseAddress: 192.168.2.2 - bindPort: 6443 -discovery: - bootstrapToken: - apiServerEndpoint: kube-apiserver:6443 - token: abcdef.0123456789abcdef - unsafeSkipCAVerification: true - timeout: 5m0s - tlsBootstrapToken: abcdef.0123456789abcdef -kind: JoinConfiguration -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: control-plane-1 - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master diff --git a/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted.yaml b/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted.yaml deleted file mode 100644 index 7daef54d779..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted.yaml +++ /dev/null @@ -1,155 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -bootstrapTokens: -- groups: - - system:bootstrappers:kubeadm:default-node-token - token: s73ybu.6tw6wnqgp5z0wb77 - ttl: 24h0m0s - usages: - - signing - - authentication -kind: InitConfiguration -localAPIEndpoint: - advertiseAddress: 192.168.2.2 - bindPort: 6443 -nodeRegistration: - criSocket: /var/run/criruntime.sock - name: control-plane-1 - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master ---- -apiServer: - timeoutForControlPlane: 4m0s -apiVersion: kubeadm.k8s.io/v1beta1 -certificatesDir: /var/lib/kubernetes/pki -clusterName: kubernetes -controlPlaneEndpoint: "" -controllerManager: {} -dns: - type: CoreDNS -etcd: - local: - dataDir: /var/lib/etcd -imageRepository: my-company.com -kind: ClusterConfiguration -kubernetesVersion: v1.13.0 -networking: - dnsDomain: cluster.global - podSubnet: 10.148.0.0/16 - serviceSubnet: 10.196.0.0/12 -scheduler: {} ---- -apiVersion: kubeproxy.config.k8s.io/v1alpha1 -bindAddress: 0.0.0.0 -bindAddressHardFail: false -clientConnection: - acceptContentTypes: "" - burst: 10 - contentType: application/vnd.kubernetes.protobuf - kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - qps: 5 -clusterCIDR: 10.148.0.0/16 -configSyncPeriod: 15m0s -conntrack: - maxPerCore: 32768 - min: 131072 - tcpCloseWaitTimeout: 1h0m0s - tcpEstablishedTimeout: 24h0m0s -enableProfiling: false -healthzBindAddress: 0.0.0.0:10256 -hostnameOverride: "" -iptables: - masqueradeAll: false - masqueradeBit: 14 - minSyncPeriod: 0s - syncPeriod: 30s -ipvs: - excludeCIDRs: null - minSyncPeriod: 0s - scheduler: "" - syncPeriod: 30s -kind: KubeProxyConfiguration -metricsBindAddress: 127.0.0.1:10249 -mode: "" -nodePortAddresses: null -oomScoreAdj: -999 -portRange: "" -udpIdleTimeout: 250ms -winkernel: - enableDSR: false - networkName: "" - sourceVip: "" ---- -address: 0.0.0.0 -apiVersion: kubelet.config.k8s.io/v1beta1 -authentication: - anonymous: - enabled: false - webhook: - cacheTTL: 2m0s - enabled: true - x509: - clientCAFile: /etc/kubernetes/pki/ca.crt -authorization: - mode: Webhook - webhook: - cacheAuthorizedTTL: 5m0s - cacheUnauthorizedTTL: 30s -cgroupDriver: cgroupfs -cgroupsPerQOS: true -clusterDNS: -- 10.192.0.10 -clusterDomain: cluster.global -configMapAndSecretChangeDetectionStrategy: Watch -containerLogMaxFiles: 5 -containerLogMaxSize: 10Mi -contentType: application/vnd.kubernetes.protobuf -cpuCFSQuota: true -cpuCFSQuotaPeriod: 100ms -cpuManagerPolicy: none -cpuManagerReconcilePeriod: 10s -enableControllerAttachDetach: true -enableDebuggingHandlers: true -enforceNodeAllocatable: -- pods -eventBurst: 10 -eventRecordQPS: 5 -evictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% - nodefs.inodesFree: 5% -evictionPressureTransitionPeriod: 5m0s -failSwapOn: true -fileCheckFrequency: 20s -hairpinMode: promiscuous-bridge -healthzBindAddress: 127.0.0.1 -healthzPort: 10248 -httpCheckFrequency: 20s -imageGCHighThresholdPercent: 85 -imageGCLowThresholdPercent: 80 -imageMinimumGCAge: 2m0s -iptablesDropBit: 15 -iptablesMasqueradeBit: 14 -kind: KubeletConfiguration -kubeAPIBurst: 10 -kubeAPIQPS: 5 -makeIPTablesUtilChains: true -maxOpenFiles: 1000000 -maxPods: 110 -nodeLeaseDurationSeconds: 40 -nodeStatusReportFrequency: 1m0s -nodeStatusUpdateFrequency: 10s -oomScoreAdj: -999 -podPidsLimit: -1 -port: 10250 -registryBurst: 10 -registryPullQPS: 5 -resolvConf: /etc/resolv.conf -rotateCertificates: true -runtimeRequestTimeout: 2m0s -serializeImagePulls: true -staticPodPath: /etc/kubernetes/manifests -streamingConnectionIdleTimeout: 4h0m0s -syncFrequency: 1m0s -volumeStatsAggPeriod: 1m0s diff --git a/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted_non_linux.yaml b/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted_non_linux.yaml deleted file mode 100644 index 455c74a3af2..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/defaulted_non_linux.yaml +++ /dev/null @@ -1,154 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -bootstrapTokens: -- groups: - - system:bootstrappers:kubeadm:default-node-token - token: s73ybu.6tw6wnqgp5z0wb77 - ttl: 24h0m0s - usages: - - signing - - authentication -kind: InitConfiguration -localAPIEndpoint: - advertiseAddress: 192.168.2.2 - bindPort: 6443 -nodeRegistration: - criSocket: /var/run/criruntime.sock - name: control-plane-1 - taints: - - effect: NoSchedule - key: node-role.kubernetes.io/master ---- -apiServer: - timeoutForControlPlane: 4m0s -apiVersion: kubeadm.k8s.io/v1beta1 -certificatesDir: /var/lib/kubernetes/pki -clusterName: kubernetes -controlPlaneEndpoint: "" -controllerManager: {} -dns: - type: CoreDNS -etcd: - local: - dataDir: /var/lib/etcd -imageRepository: my-company.com -kind: ClusterConfiguration -kubernetesVersion: v1.13.0 -networking: - dnsDomain: cluster.global - podSubnet: 10.148.0.0/16 - serviceSubnet: 10.196.0.0/12 -scheduler: {} ---- -apiVersion: kubeproxy.config.k8s.io/v1alpha1 -bindAddress: 0.0.0.0 -bindAddressHardFail: false -clientConnection: - acceptContentTypes: "" - burst: 10 - contentType: application/vnd.kubernetes.protobuf - kubeconfig: /var/lib/kube-proxy/kubeconfig.conf - qps: 5 -clusterCIDR: 10.148.0.0/16 -configSyncPeriod: 15m0s -conntrack: - maxPerCore: 32768 - min: 131072 - tcpCloseWaitTimeout: 1h0m0s - tcpEstablishedTimeout: 24h0m0s -enableProfiling: false -healthzBindAddress: 0.0.0.0:10256 -hostnameOverride: "" -iptables: - masqueradeAll: false - masqueradeBit: 14 - minSyncPeriod: 0s - syncPeriod: 30s -ipvs: - excludeCIDRs: null - minSyncPeriod: 0s - scheduler: "" - syncPeriod: 30s -kind: KubeProxyConfiguration -metricsBindAddress: 127.0.0.1:10249 -mode: "" -nodePortAddresses: null -oomScoreAdj: -999 -portRange: "" -udpIdleTimeout: 250ms -winkernel: - enableDSR: false - networkName: "" - sourceVip: "" ---- -address: 0.0.0.0 -apiVersion: kubelet.config.k8s.io/v1beta1 -authentication: - anonymous: - enabled: false - webhook: - cacheTTL: 2m0s - enabled: true - x509: - clientCAFile: /etc/kubernetes/pki/ca.crt -authorization: - mode: Webhook - webhook: - cacheAuthorizedTTL: 5m0s - cacheUnauthorizedTTL: 30s -cgroupDriver: cgroupfs -cgroupsPerQOS: true -clusterDNS: -- 10.192.0.10 -clusterDomain: cluster.global -configMapAndSecretChangeDetectionStrategy: Watch -containerLogMaxFiles: 5 -containerLogMaxSize: 10Mi -contentType: application/vnd.kubernetes.protobuf -cpuCFSQuota: true -cpuCFSQuotaPeriod: 100ms -cpuManagerPolicy: none -cpuManagerReconcilePeriod: 10s -enableControllerAttachDetach: true -enableDebuggingHandlers: true -enforceNodeAllocatable: -- pods -eventBurst: 10 -eventRecordQPS: 5 -evictionHard: - imagefs.available: 15% - memory.available: 100Mi - nodefs.available: 10% -evictionPressureTransitionPeriod: 5m0s -failSwapOn: true -fileCheckFrequency: 20s -hairpinMode: promiscuous-bridge -healthzBindAddress: 127.0.0.1 -healthzPort: 10248 -httpCheckFrequency: 20s -imageGCHighThresholdPercent: 85 -imageGCLowThresholdPercent: 80 -imageMinimumGCAge: 2m0s -iptablesDropBit: 15 -iptablesMasqueradeBit: 14 -kind: KubeletConfiguration -kubeAPIBurst: 10 -kubeAPIQPS: 5 -makeIPTablesUtilChains: true -maxOpenFiles: 1000000 -maxPods: 110 -nodeLeaseDurationSeconds: 40 -nodeStatusReportFrequency: 1m0s -nodeStatusUpdateFrequency: 10s -oomScoreAdj: -999 -podPidsLimit: -1 -port: 10250 -registryBurst: 10 -registryPullQPS: 5 -resolvConf: /etc/resolv.conf -rotateCertificates: true -runtimeRequestTimeout: 2m0s -serializeImagePulls: true -staticPodPath: /etc/kubernetes/manifests -streamingConnectionIdleTimeout: 4h0m0s -syncFrequency: 1m0s -volumeStatsAggPeriod: 1m0s diff --git a/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/incomplete.yaml b/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/incomplete.yaml deleted file mode 100644 index f945cec6101..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/defaulting/controlplane/incomplete.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -kind: InitConfiguration -bootstrapTokens: -- token: s73ybu.6tw6wnqgp5z0wb77 -localAPIEndpoint: - advertiseAddress: 192.168.2.2 -nodeRegistration: - criSocket: /var/run/criruntime.sock - name: control-plane-1 ---- -apiVersion: kubeadm.k8s.io/v1beta1 -certificatesDir: /var/lib/kubernetes/pki -imageRepository: my-company.com -kind: ClusterConfiguration -kubernetesVersion: v1.13.0 -networking: - dnsDomain: cluster.global - podSubnet: 10.148.0.0/16 - serviceSubnet: 10.196.0.0/12 \ No newline at end of file diff --git a/cmd/kubeadm/app/util/config/testdata/defaulting/node/defaulted.yaml b/cmd/kubeadm/app/util/config/testdata/defaulting/node/defaulted.yaml deleted file mode 100644 index 6de881fffd9..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/defaulting/node/defaulted.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta2 -caCertPath: /etc/kubernetes/pki/ca.crt -discovery: - bootstrapToken: - apiServerEndpoint: kube-apiserver:6443 - token: abcdef.0123456789abcdef - unsafeSkipCAVerification: true - timeout: 5m0s - tlsBootstrapToken: abcdef.0123456789abcdef -kind: JoinConfiguration -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: thegopher - taints: null diff --git a/cmd/kubeadm/app/util/config/testdata/defaulting/node/incomplete.yaml b/cmd/kubeadm/app/util/config/testdata/defaulting/node/incomplete.yaml deleted file mode 100644 index fb56966e540..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/defaulting/node/incomplete.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta2 -discovery: - bootstrapToken: - apiServerEndpoint: kube-apiserver:6443 - token: abcdef.0123456789abcdef - unsafeSkipCAVerification: true - tlsBootstrapToken: abcdef.0123456789abcdef -kind: JoinConfiguration -nodeRegistration: - criSocket: /var/run/dockershim.sock - name: thegopher diff --git a/cmd/kubeadm/app/util/config/testdata/validation/invalid_controlplanecfg.yaml b/cmd/kubeadm/app/util/config/testdata/validation/invalid_controlplanecfg.yaml deleted file mode 100644 index 55c7fb1b5ad..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/validation/invalid_controlplanecfg.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta1 -kind: ClusterConfiguration -networking: - dnsDomain: INVALID-DOMAIN-!!!! - podSubnet: "" - serviceSubnet: 10.96.0.0/12 -useHyperKubeImage: false \ No newline at end of file diff --git a/cmd/kubeadm/app/util/config/testdata/validation/invalid_nodecfg.yaml b/cmd/kubeadm/app/util/config/testdata/validation/invalid_nodecfg.yaml deleted file mode 100644 index c4fabd135ba..00000000000 --- a/cmd/kubeadm/app/util/config/testdata/validation/invalid_nodecfg.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: kubeadm.k8s.io/v1beta2 -kind: NodeConfiguration -caCertPath: relativepath -discovery: - timeout: not-a-time - bootstrapToken: - token: invalidtoken - apiServerEndpoints: - - INVALID_URL - unsafeSkipCAVerification: false - file: - kubeConfigPath: relativepath -nodeRegistration: - criSocket: relativepath - name: NODE-1