Skip to content

Commit

Permalink
Set default container runtime to containerd
Browse files Browse the repository at this point in the history
  • Loading branch information
bmelbourne committed Dec 11, 2020
1 parent 3a7d728 commit af1675e
Show file tree
Hide file tree
Showing 21 changed files with 10 additions and 22 deletions.
2 changes: 0 additions & 2 deletions cmd/kops/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ func (o *CreateClusterOptions) InitDefaults() {

o.Yes = false
o.Target = cloudup.TargetDirect

o.ContainerRuntime = "docker"
}

var (
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/kops_create_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ kops create cluster [flags]
--channel string Channel for default versions and configuration to use (default "stable")
--cloud string Cloud provider to use - gce, aws, openstack
--cloud-labels string A list of KV pairs used to tag all instance groups in AWS (e.g. "Owner=John Doe,Team=Some Team").
--container-runtime string Container runtime to use: containerd, docker (default "docker")
--container-runtime string Container runtime to use: containerd, docker
--disable-subnet-tags Set to disable automatic subnet tagging
--dns string DNS hosted zone to use: public|private. (default "Public")
--dns-zone string DNS hosted zone to use (defaults to longest matching zone)
Expand Down
5 changes: 4 additions & 1 deletion docs/cluster_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,10 @@ spec:
## containerRuntime
{{ kops_feature_table(kops_added_default='1.18', k8s_min='1.11') }}

Alternative [container runtimes](https://kubernetes.io/docs/setup/production-environment/container-runtimes/) can be used to run Kubernetes. Docker is still the default container runtime, but [containerd](https://kubernetes.io/blog/2018/05/24/kubernetes-containerd-integration-goes-ga/) can also be selected.
Alternative [container runtimes](https://kubernetes.io/docs/setup/production-environment/container-runtimes/) can be used to run Kubernetes. The default container runtime is [containerd](https://containerd.io/docs/).

Docker can still be selected but be aware that Kubernetes is deprecating support for the Docker runtime from version 1.20 and will be removed in a future release (currently planned for the 1.22 release in late 2021).
@see [Don't Panic: Kubernetes and Docker](https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/)

```yaml
spec:
Expand Down
6 changes: 5 additions & 1 deletion pkg/model/components/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ func (b *DefaultsOptionsBuilder) BuildOptions(o interface{}) error {
}

if options.ContainerRuntime == "" {
options.ContainerRuntime = "docker"
if b.Context.IsKubernetesGTE("1.20") {
options.ContainerRuntime = "containerd"
} else {
options.ContainerRuntime = "docker"
}
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/complex.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
gceServiceAccount: test-account@testproject.iam.gserviceaccount.com
cloudProvider: gce
configBase: memfs://tests/gce.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
1 change: 0 additions & 1 deletion tests/integration/create_cluster/ha/expected-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/ha.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/ha.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
gceServiceAccount: default
cloudProvider: gce
configBase: memfs://tests/ha-gce.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/ha.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/ha.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/private.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/minimal.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/private.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/overrides.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ spec:
foo/bar: fib+baz
cloudProvider: aws
configBase: memfs://tests/private.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ spec:
foo/bar: fib+baz
cloudProvider: gce
configBase: memfs://tests/private.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/private-subnets.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/subnet.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/subnet.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
channel: stable
cloudProvider: aws
configBase: memfs://tests/vpc.example.com
containerRuntime: docker
etcdClusters:
- cpuRequest: 200m
etcdMembers:
Expand Down

0 comments on commit af1675e

Please sign in to comment.