mirror of https://github.com/k3s-io/k3s
Rename experimental-runtime-integration-type to experimental-cri
parent
dbc4121e16
commit
dcce768a3e
|
@ -221,8 +221,6 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||
fs.StringSliceVar(&s.AllowedUnsafeSysctls, "experimental-allowed-unsafe-sysctls", s.AllowedUnsafeSysctls, "Comma-separated whitelist of unsafe sysctls or unsafe sysctl patterns (ending in *). Use these at your own risk.")
|
||||
|
||||
// Flags intended for testing, not recommended used in production environments.
|
||||
fs.StringVar(&s.RemoteRuntimeEndpoint, "container-runtime-endpoint", s.RemoteRuntimeEndpoint, "The unix socket endpoint of remote runtime service. This is an experimental feature. Intended for testing only.")
|
||||
fs.StringVar(&s.RemoteImageEndpoint, "image-service-endpoint", s.RemoteImageEndpoint, "The unix socket endpoint of remote image service. If not specified, it will be the same with container-runtime-endpoint by default. This is an experimental feature. Intended for testing only.")
|
||||
fs.BoolVar(&s.ReallyCrashForTesting, "really-crash-for-testing", s.ReallyCrashForTesting, "If true, when panics occur crash. Intended for testing.")
|
||||
fs.Float64Var(&s.ChaosChance, "chaos-chance", s.ChaosChance, "If > 0.0, introduce random client errors and latency. Intended for testing. [default=0.0]")
|
||||
fs.BoolVar(&s.Containerized, "containerized", s.Containerized, "Experimental support for running kubelet in a container. Intended for testing. [default=false]")
|
||||
|
@ -249,7 +247,9 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
|||
fs.Int32Var(&s.PodsPerCore, "pods-per-core", s.PodsPerCore, "Number of Pods per core that can run on this Kubelet. The total number of Pods on this Kubelet cannot exceed max-pods, so max-pods will be used if this calculation results in a larger number of Pods allowed on the Kubelet. A value of 0 disables this limit.")
|
||||
fs.BoolVar(&s.ProtectKernelDefaults, "protect-kernel-defaults", s.ProtectKernelDefaults, "Default kubelet behaviour for kernel tuning. If set, kubelet errors if any of kernel tunables is different than kubelet defaults.")
|
||||
|
||||
// Hidden flags for experimental features that are still under development.
|
||||
fs.StringVar(&s.ExperimentalRuntimeIntegrationType, "experimental-runtime-integration-type", s.ExperimentalRuntimeIntegrationType, "Choose the integration path for the container runtime (specified via --container-runtime). Currently, this supports only Docker. If set to \"cri\", Kubelet will use interact with docker through the new Container Runtime Interface.")
|
||||
fs.MarkHidden("experimental-runtime-integration-type")
|
||||
// CRI flags.
|
||||
fs.BoolVar(&s.EnableCRI, "experimental-cri", s.EnableCRI, "[Experimental] Enable the Container Runtime Interface (CRI) integration. If --container-runtime is set to \"remote\", Kubelet will communicate with the runtime/image CRI server listening on the endpoint specified by --remote-runtime-endpoint/--remote-image-endpoint. If --container-runtime is set to \"docker\", Kubelet will launch a in-process CRI server on behalf of docker, and communicate over a default endpoint.")
|
||||
fs.StringVar(&s.RemoteRuntimeEndpoint, "container-runtime-endpoint", s.RemoteRuntimeEndpoint, "[Experimental] The unix socket endpoint of remote runtime service. The endpoint is used only when CRI integration is enabled (--experimental-cri)")
|
||||
fs.StringVar(&s.RemoteImageEndpoint, "image-service-endpoint", s.RemoteImageEndpoint, "[Experimental] The unix socket endpoint of remote image service. If not specified, it will be the same with container-runtime-endpoint by default. The endpoint is used only when CRI integration is enabled (--experimental-cri)")
|
||||
|
||||
}
|
||||
|
|
|
@ -435,15 +435,15 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
|
|||
return fmt.Errorf("invalid configuration: system container was specified and cgroup root was not specified")
|
||||
}
|
||||
kubeDeps.ContainerManager, err = cm.NewContainerManager(kubeDeps.Mounter, kubeDeps.CAdvisorInterface, cm.NodeConfig{
|
||||
RuntimeCgroupsName: s.RuntimeCgroups,
|
||||
SystemCgroupsName: s.SystemCgroups,
|
||||
KubeletCgroupsName: s.KubeletCgroups,
|
||||
ContainerRuntime: s.ContainerRuntime,
|
||||
CgroupsPerQOS: s.CgroupsPerQOS,
|
||||
CgroupRoot: s.CgroupRoot,
|
||||
CgroupDriver: s.CgroupDriver,
|
||||
ProtectKernelDefaults: s.ProtectKernelDefaults,
|
||||
RuntimeIntegrationType: s.ExperimentalRuntimeIntegrationType,
|
||||
RuntimeCgroupsName: s.RuntimeCgroups,
|
||||
SystemCgroupsName: s.SystemCgroups,
|
||||
KubeletCgroupsName: s.KubeletCgroups,
|
||||
ContainerRuntime: s.ContainerRuntime,
|
||||
CgroupsPerQOS: s.CgroupsPerQOS,
|
||||
CgroupRoot: s.CgroupRoot,
|
||||
CgroupDriver: s.CgroupDriver,
|
||||
ProtectKernelDefaults: s.ProtectKernelDefaults,
|
||||
EnableCRI: s.EnableCRI,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -173,8 +173,7 @@ CLAIM_BINDER_SYNC_PERIOD=${CLAIM_BINDER_SYNC_PERIOD:-"15s"} # current k8s defaul
|
|||
ENABLE_CONTROLLER_ATTACH_DETACH=${ENABLE_CONTROLLER_ATTACH_DETACH:-"true"} # current default
|
||||
CERT_DIR=${CERT_DIR:-"/var/run/kubernetes"}
|
||||
ROOT_CA_FILE=$CERT_DIR/apiserver.crt
|
||||
# How the kubelet interacts with the runtime, eg: "cri"
|
||||
EXPERIMENTAL_RUNTIME_INTEGRATION_TYPE=${EXPERIMENTAL_RUNTIME_INTEGRATION_TYPE:-""}
|
||||
EXPERIMENTAL_CRI=${EXPERIMENTAL_CRI:-"false"}
|
||||
|
||||
|
||||
function test_apiserver_off {
|
||||
|
@ -485,7 +484,7 @@ function start_kubelet {
|
|||
--v=${LOG_LEVEL} \
|
||||
--chaos-chance="${CHAOS_CHANCE}" \
|
||||
--container-runtime="${CONTAINER_RUNTIME}" \
|
||||
--experimental-runtime-integration-type="${EXPERIMENTAL_RUNTIME_INTEGRATION_TYPE}" \
|
||||
--experimental-cri=${EXPERIMENTAL_CRI} \
|
||||
--rkt-path="${RKT_PATH}" \
|
||||
--rkt-stage1-image="${RKT_STAGE1_IMAGE}" \
|
||||
--hostname-override="${HOSTNAME_OVERRIDE}" \
|
||||
|
|
|
@ -152,6 +152,7 @@ duration-sec
|
|||
e2e-output-dir
|
||||
e2e-verify-service-account
|
||||
enable-controller-attach-detach
|
||||
enable-cri
|
||||
enable-custom-metrics
|
||||
enable-debugging-handlers
|
||||
enable-dynamic-provisioning
|
||||
|
@ -193,7 +194,7 @@ experimental-mounter-path
|
|||
experimental-mounter-rootfs-path
|
||||
experimental-nvidia-gpus
|
||||
experimental-prefix
|
||||
experimental-runtime-integration-type
|
||||
experimental-cri
|
||||
external-etcd-cafile
|
||||
external-etcd-certfile
|
||||
external-etcd-endpoints
|
||||
|
@ -494,7 +495,6 @@ run-proxy
|
|||
run-services-mode
|
||||
runtime-cgroups
|
||||
runtime-config
|
||||
runtime-integration-type
|
||||
runtime-request-timeout
|
||||
save-config
|
||||
schedule-pods-here
|
||||
|
|
|
@ -462,10 +462,9 @@ type KubeletConfiguration struct {
|
|||
// featureGates is a string of comma-separated key=value pairs that describe feature
|
||||
// gates for alpha/experimental features.
|
||||
FeatureGates string `json:"featureGates"`
|
||||
// How to integrate with runtime. If set to cri, kubelet will switch to
|
||||
// using the new Container Runtine Interface.
|
||||
// Enable Container Runtime Interface (CRI) integration.
|
||||
// +optional
|
||||
ExperimentalRuntimeIntegrationType string `json:"experimentalRuntimeIntegrationType,omitempty"`
|
||||
EnableCRI bool `json:"enableCRI,omitempty"`
|
||||
}
|
||||
|
||||
type KubeletAuthorizationMode string
|
||||
|
|
|
@ -501,10 +501,9 @@ type KubeletConfiguration struct {
|
|||
// featureGates is a string of comma-separated key=value pairs that describe feature
|
||||
// gates for alpha/experimental features.
|
||||
FeatureGates string `json:"featureGates,omitempty"`
|
||||
// How to integrate with runtime. If set to CRI, kubelet will switch to
|
||||
// using the new Container Runtine Interface.
|
||||
// Enable Container Runtime Interface (CRI) integration.
|
||||
// +optional
|
||||
ExperimentalRuntimeIntegrationType string `json:"experimentalRuntimeIntegrationType,omitempty"`
|
||||
EnableCRI bool `json:"enableCRI,omitempty"`
|
||||
}
|
||||
|
||||
type KubeletAuthorizationMode string
|
||||
|
|
|
@ -406,7 +406,7 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu
|
|||
}
|
||||
out.AllowedUnsafeSysctls = *(*[]string)(unsafe.Pointer(&in.AllowedUnsafeSysctls))
|
||||
out.FeatureGates = in.FeatureGates
|
||||
out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType
|
||||
out.EnableCRI = in.EnableCRI
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,7 @@ func autoConvert_componentconfig_KubeletConfiguration_To_v1alpha1_KubeletConfigu
|
|||
}
|
||||
out.AllowedUnsafeSysctls = *(*[]string)(unsafe.Pointer(&in.AllowedUnsafeSysctls))
|
||||
out.FeatureGates = in.FeatureGates
|
||||
out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType
|
||||
out.EnableCRI = in.EnableCRI
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -460,7 +460,7 @@ func DeepCopy_v1alpha1_KubeletConfiguration(in interface{}, out interface{}, c *
|
|||
out.AllowedUnsafeSysctls = nil
|
||||
}
|
||||
out.FeatureGates = in.FeatureGates
|
||||
out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType
|
||||
out.EnableCRI = in.EnableCRI
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@ func DeepCopy_componentconfig_KubeletConfiguration(in interface{}, out interface
|
|||
out.AllowedUnsafeSysctls = nil
|
||||
}
|
||||
out.FeatureGates = in.FeatureGates
|
||||
out.ExperimentalRuntimeIntegrationType = in.ExperimentalRuntimeIntegrationType
|
||||
out.EnableCRI = in.EnableCRI
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2996,10 +2996,10 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
|||
Format: "",
|
||||
},
|
||||
},
|
||||
"experimentalRuntimeIntegrationType": {
|
||||
"enableCRI": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "How to integrate with runtime. If set to cri, kubelet will switch to using the new Container Runtine Interface.",
|
||||
Type: []string{"string"},
|
||||
Description: "Enable Container Runtime Interface (CRI) integration.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
|
@ -14750,10 +14750,10 @@ var OpenAPIDefinitions *common.OpenAPIDefinitions = &common.OpenAPIDefinitions{
|
|||
Format: "",
|
||||
},
|
||||
},
|
||||
"experimentalRuntimeIntegrationType": {
|
||||
"enableCRI": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "How to integrate with runtime. If set to CRI, kubelet will switch to using the new Container Runtine Interface.",
|
||||
Type: []string{"string"},
|
||||
Description: "Enable Container Runtime Interface (CRI) integration.",
|
||||
Type: []string{"boolean"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
|
|
|
@ -49,15 +49,15 @@ type ContainerManager interface {
|
|||
}
|
||||
|
||||
type NodeConfig struct {
|
||||
RuntimeCgroupsName string
|
||||
SystemCgroupsName string
|
||||
KubeletCgroupsName string
|
||||
ContainerRuntime string
|
||||
CgroupsPerQOS bool
|
||||
CgroupRoot string
|
||||
CgroupDriver string
|
||||
ProtectKernelDefaults bool
|
||||
RuntimeIntegrationType string
|
||||
RuntimeCgroupsName string
|
||||
SystemCgroupsName string
|
||||
KubeletCgroupsName string
|
||||
ContainerRuntime string
|
||||
CgroupsPerQOS bool
|
||||
CgroupRoot string
|
||||
CgroupDriver string
|
||||
ProtectKernelDefaults bool
|
||||
EnableCRI bool
|
||||
}
|
||||
|
||||
type Status struct {
|
||||
|
|
|
@ -335,7 +335,7 @@ func (cm *containerManagerImpl) setupNode() error {
|
|||
systemContainers := []*systemContainer{}
|
||||
if cm.ContainerRuntime == "docker" {
|
||||
dockerVersion := getDockerVersion(cm.cadvisorInterface)
|
||||
if cm.RuntimeIntegrationType == "cri" {
|
||||
if cm.EnableCRI {
|
||||
// If kubelet uses CRI, dockershim will manage the cgroups and oom
|
||||
// score for the docker processes.
|
||||
// In the future, NodeSpec should mandate the cgroup that the
|
||||
|
|
|
@ -514,7 +514,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
|
|||
var nl *noOpLegacyHost
|
||||
pluginSettings.LegacyRuntimeHost = nl
|
||||
|
||||
if kubeCfg.ExperimentalRuntimeIntegrationType == "cri" {
|
||||
if kubeCfg.EnableCRI {
|
||||
// kubelet defers to the runtime shim to setup networking. Setting
|
||||
// this to nil will prevent it from trying to invoke the plugin.
|
||||
// It's easier to always probe and initialize plugins till cri
|
||||
|
@ -2002,7 +2002,7 @@ func (kl *Kubelet) updateRuntimeUp() {
|
|||
}
|
||||
// Only check specific conditions when runtime integration type is cri,
|
||||
// because the old integration doesn't populate any runtime condition.
|
||||
if kl.kubeletConfiguration.ExperimentalRuntimeIntegrationType == "cri" {
|
||||
if kl.kubeletConfiguration.EnableCRI {
|
||||
if s == nil {
|
||||
glog.Errorf("Container runtime status is nil")
|
||||
return
|
||||
|
|
|
@ -836,7 +836,7 @@ func TestUpdateNodeStatusWithRuntimeStateError(t *testing.T) {
|
|||
checkNodeStatus(api.ConditionFalse, "KubeletNotReady")
|
||||
|
||||
// Test cri integration.
|
||||
kubelet.kubeletConfiguration.ExperimentalRuntimeIntegrationType = "cri"
|
||||
kubelet.kubeletConfiguration.EnableCRI = true
|
||||
fakeRuntime.StatusErr = nil
|
||||
|
||||
// Should report node not ready if runtime status is nil.
|
||||
|
|
|
@ -114,8 +114,8 @@ type NodeTestContextType struct {
|
|||
ManifestPath string
|
||||
// PrepullImages indicates whether node e2e framework should prepull images.
|
||||
PrepullImages bool
|
||||
// RuntimeIntegrationType indicates how runtime is integrated with Kubelet. This is mainly used for CRI validation test.
|
||||
RuntimeIntegrationType string
|
||||
// Enable CRI integration.
|
||||
EnableCRI bool
|
||||
// ContainerRuntimeEndpoint is the endpoint of remote container runtime grpc server. This is mainly used for Remote CRI
|
||||
// validation test.
|
||||
ContainerRuntimeEndpoint string
|
||||
|
@ -217,7 +217,7 @@ func RegisterNodeFlags() {
|
|||
flag.StringVar(&TestContext.CgroupDriver, "cgroup-driver", "", "Driver that the kubelet uses to manipulate cgroups on the host. Possible values: 'cgroupfs', 'systemd'")
|
||||
flag.StringVar(&TestContext.ManifestPath, "manifest-path", "", "The path to the static pod manifest file.")
|
||||
flag.BoolVar(&TestContext.PrepullImages, "prepull-images", true, "If true, prepull images so image pull failures do not cause test failures.")
|
||||
flag.StringVar(&TestContext.RuntimeIntegrationType, "runtime-integration-type", "", "Choose the integration path for the container runtime, mainly used for CRI validation.")
|
||||
flag.BoolVar(&TestContext.EnableCRI, "enable-cri", false, "Enable Container Runtime Interface (CRI) integration.")
|
||||
flag.StringVar(&TestContext.ContainerRuntimeEndpoint, "container-runtime-endpoint", "", "The endpoint of remote container runtime grpc server, mainly used for Remote CRI validation.")
|
||||
flag.StringVar(&TestContext.MounterPath, "experimental-mounter-path", "", "Path of mounter binary. Leave empty to use the default mount.")
|
||||
flag.StringVar(&TestContext.MounterRootfsPath, "experimental-mounter-rootfs-path", "", "Absolute path to root filesystem for the mounter binary.")
|
||||
|
|
|
@ -63,7 +63,7 @@ func init() {
|
|||
// It seems that someone is using flag.Parse() after init() and TestMain().
|
||||
// TODO(random-liu): Find who is using flag.Parse() and cause errors and move the following logic
|
||||
// into TestContext.
|
||||
pflag.CommandLine.MarkHidden("runtime-integration-type")
|
||||
pflag.CommandLine.MarkHidden("enable-cri")
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
|
|
@ -5,5 +5,5 @@ GCE_PROJECT=k8s-jkns-ci-node-e2e
|
|||
CLEANUP=true
|
||||
GINKGO_FLAGS='--skip="\[Flaky\]"'
|
||||
SETUP_NODE=false
|
||||
TEST_ARGS='--runtime-integration-type=cri --feature-gates="DynamicKubeletConfig=true,StreamingProxyRedirects=true" --experimental-mounter-path="" --experimental-mounter-rootfs-path=""'
|
||||
TEST_ARGS='--enable-cri=true --feature-gates=DynamicKubeletConfig=true,StreamingProxyRedirects=true --experimental-mounter-path="" --experimental-mounter-rootfs-path=""'
|
||||
PARALLELISM=1
|
||||
|
|
|
@ -5,4 +5,4 @@ GCE_PROJECT=k8s-jkns-pr-node-e2e
|
|||
CLEANUP=true
|
||||
GINKGO_FLAGS='--skip="\[Flaky\]|\[Slow\]|\[Serial\]" --flakeAttempts=2'
|
||||
SETUP_NODE=false
|
||||
TEST_ARGS='--runtime-integration-type=cri --experimental-mounter-path="" --experimental-mounter-rootfs-path="" --feature-gates="StreamingProxyRedirects=true"'
|
||||
TEST_ARGS='--enable-cri=true --experimental-mounter-path="" --experimental-mounter-rootfs-path="" --feature-gates="StreamingProxyRedirects=true"'
|
||||
|
|
|
@ -5,6 +5,6 @@ GCE_PROJECT=k8s-jkns-ci-node-e2e
|
|||
CLEANUP=true
|
||||
GINKGO_FLAGS='--focus="\[Serial\]" --skip="\[Flaky\]|\[Benchmark\]"'
|
||||
SETUP_NODE=false
|
||||
TEST_ARGS='--runtime-integration-type=cri --feature-gates="DynamicKubeletConfig=true,StreamingProxyRedirects=true" --experimental-mounter-path="" --experimental-mounter-rootfs-path=""'
|
||||
TEST_ARGS='--enable-cri=true --feature-gates=DynamicKubeletConfig=true,StreamingProxyRedirects=true --experimental-mounter-path="" --experimental-mounter-rootfs-path=""'
|
||||
PARALLELISM=1
|
||||
TIMEOUT=3h
|
||||
|
|
|
@ -5,4 +5,4 @@ GCE_PROJECT=k8s-jkns-ci-node-e2e
|
|||
CLEANUP=true
|
||||
GINKGO_FLAGS='--skip="\[Flaky\]|\[Serial\]"'
|
||||
SETUP_NODE=false
|
||||
TEST_ARGS='--runtime-integration-type=cri --experimental-mounter-path="" --experimental-mounter-rootfs-path="" --feature-gates="StreamingProxyRedirects=true"'
|
||||
TEST_ARGS='--enable-cri=true --experimental-mounter-path="" --experimental-mounter-rootfs-path="" --feature-gates="StreamingProxyRedirects=true"'
|
||||
|
|
|
@ -217,9 +217,8 @@ func (e *E2EServices) startKubelet() (*server, error) {
|
|||
// "--experimental-mounter-rootfs-path", framework.TestContext.MounterRootfsPath,
|
||||
)
|
||||
|
||||
if framework.TestContext.RuntimeIntegrationType != "" {
|
||||
cmdArgs = append(cmdArgs, "--experimental-runtime-integration-type",
|
||||
framework.TestContext.RuntimeIntegrationType) // Whether to use experimental cri integration.
|
||||
if framework.TestContext.EnableCRI {
|
||||
cmdArgs = append(cmdArgs, "--experimental-cri", "true") // Whether to use experimental cri integration.
|
||||
}
|
||||
if framework.TestContext.ContainerRuntimeEndpoint != "" {
|
||||
cmdArgs = append(cmdArgs, "--container-runtime-endpoint", framework.TestContext.ContainerRuntimeEndpoint)
|
||||
|
|
Loading…
Reference in New Issue