Skip to content

Commit b5a64a9

Browse files
committed
enable test handler for containerd runtime
1 parent 419b93b commit b5a64a9

12 files changed

+56
-55
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ dev-upload: dev-upload-linux-amd64 dev-upload-linux-arm64
752752
.PHONY: crds
753753
crds:
754754
cd "${KOPS_ROOT}/hack" && go build -o "${KOPS_ROOT}/_output/bin/controller-gen" sigs.k8s.io/controller-tools/cmd/controller-gen
755-
"${KOPS_ROOT}/_output/bin/controller-gen" crd paths=k8s.io/kops/pkg/apis/kops/v1alpha2 output:dir=k8s/crds/ crd:crdVersions=v1
755+
"${KOPS_ROOT}/_output/bin/controller-gen" crd paths=k8s.io/kops/pkg/apis/kops/v1alpha2 output:dir=k8s/crds/
756756

757757
#------------------------------------------------------
758758
# kops-controller

k8s/crds/kops.k8s.io_clusters.yaml

+27-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.5.0
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
97
name: clusters.kops.k8s.io
108
spec:
119
group: kops.k8s.io
@@ -921,6 +919,10 @@ spec:
921919
description: State directory for execution state files (default
922920
"/run/containerd").
923921
type: string
922+
testHandlerEnabled:
923+
description: TestHandlerEnabled enables a runtime called test-handler,
924+
specific to k/k e2e tests
925+
type: boolean
924926
version:
925927
description: Version used to pick the containerd package.
926928
type: string
@@ -1513,9 +1515,9 @@ spec:
15131515
masters so that they are not on the pod network. true is the kube-up
15141516
behaviour, but it is very surprising: it means that daemonsets only
15151517
work on the master if they have hostNetwork=true. false is now the
1516-
default, and it will: * give the master a normal PodCIDR * run
1517-
kube-proxy on the master * enable debugging handlers on the master,
1518-
so kubectl logs works'
1518+
default, and it will: * give the master a normal PodCIDR * run kube-proxy
1519+
on the master * enable debugging handlers on the master, so kubectl
1520+
logs works'
15191521
type: boolean
15201522
karpenter:
15211523
description: Karpenter defines the Karpenter configuration.
@@ -2494,6 +2496,7 @@ spec:
24942496
type: object
24952497
type: array
24962498
type: object
2499+
x-kubernetes-map-type: atomic
24972500
weight:
24982501
description: Weight associated with matching the
24992502
corresponding nodeSelectorTerm, in the range 1-100.
@@ -2599,10 +2602,12 @@ spec:
25992602
type: object
26002603
type: array
26012604
type: object
2605+
x-kubernetes-map-type: atomic
26022606
type: array
26032607
required:
26042608
- nodeSelectorTerms
26052609
type: object
2610+
x-kubernetes-map-type: atomic
26062611
type: object
26072612
podAffinity:
26082613
description: Describes pod affinity scheduling rules (e.g.
@@ -2683,6 +2688,7 @@ spec:
26832688
only "value". The requirements are ANDed.
26842689
type: object
26852690
type: object
2691+
x-kubernetes-map-type: atomic
26862692
namespaceSelector:
26872693
description: A label query over the set of namespaces
26882694
that the term applies to. The term is applied
@@ -2740,6 +2746,7 @@ spec:
27402746
only "value". The requirements are ANDed.
27412747
type: object
27422748
type: object
2749+
x-kubernetes-map-type: atomic
27432750
namespaces:
27442751
description: namespaces specifies a static list
27452752
of namespace names that the term applies to.
@@ -2844,6 +2851,7 @@ spec:
28442851
The requirements are ANDed.
28452852
type: object
28462853
type: object
2854+
x-kubernetes-map-type: atomic
28472855
namespaceSelector:
28482856
description: A label query over the set of namespaces
28492857
that the term applies to. The term is applied
@@ -2900,6 +2908,7 @@ spec:
29002908
The requirements are ANDed.
29012909
type: object
29022910
type: object
2911+
x-kubernetes-map-type: atomic
29032912
namespaces:
29042913
description: namespaces specifies a static list
29052914
of namespace names that the term applies to. The
@@ -3003,6 +3012,7 @@ spec:
30033012
only "value". The requirements are ANDed.
30043013
type: object
30053014
type: object
3015+
x-kubernetes-map-type: atomic
30063016
namespaceSelector:
30073017
description: A label query over the set of namespaces
30083018
that the term applies to. The term is applied
@@ -3060,6 +3070,7 @@ spec:
30603070
only "value". The requirements are ANDed.
30613071
type: object
30623072
type: object
3073+
x-kubernetes-map-type: atomic
30633074
namespaces:
30643075
description: namespaces specifies a static list
30653076
of namespace names that the term applies to.
@@ -3164,6 +3175,7 @@ spec:
31643175
The requirements are ANDed.
31653176
type: object
31663177
type: object
3178+
x-kubernetes-map-type: atomic
31673179
namespaceSelector:
31683180
description: A label query over the set of namespaces
31693181
that the term applies to. The term is applied
@@ -3220,6 +3232,7 @@ spec:
32203232
The requirements are ANDed.
32213233
type: object
32223234
type: object
3235+
x-kubernetes-map-type: atomic
32233236
namespaces:
32243237
description: namespaces specifies a static list
32253238
of namespace names that the term applies to. The
@@ -3827,9 +3840,9 @@ spec:
38273840
description: 'How should the kubelet configure the container bridge
38283841
for hairpin packets. Setting this flag allows endpoints in a
38293842
Service to loadbalance back to themselves if they should try
3830-
to access their own Service. Values: "promiscuous-bridge":
3831-
make the container bridge promiscuous. "hairpin-veth": set
3832-
the hairpin flag on container veth interfaces. "none": do
3843+
to access their own Service. Values: "promiscuous-bridge": make
3844+
the container bridge promiscuous. "hairpin-veth": set
3845+
the hairpin flag on container veth interfaces. "none": do
38333846
nothing. Setting --configure-cbr0 to false implies that to achieve
38343847
hairpin NAT one must set --hairpin-mode=veth-flag, because bridge
38353848
assumes the existence of a container bridge named cbr0.'
@@ -4265,9 +4278,9 @@ spec:
42654278
description: 'How should the kubelet configure the container bridge
42664279
for hairpin packets. Setting this flag allows endpoints in a
42674280
Service to loadbalance back to themselves if they should try
4268-
to access their own Service. Values: "promiscuous-bridge":
4269-
make the container bridge promiscuous. "hairpin-veth": set
4270-
the hairpin flag on container veth interfaces. "none": do
4281+
to access their own Service. Values: "promiscuous-bridge": make
4282+
the container bridge promiscuous. "hairpin-veth": set
4283+
the hairpin flag on container veth interfaces. "none": do
42714284
nothing. Setting --configure-cbr0 to false implies that to achieve
42724285
hairpin NAT one must set --hairpin-mode=veth-flag, because bridge
42734286
assumes the existence of a container bridge named cbr0.'
@@ -5866,9 +5879,9 @@ spec:
58665879
type: object
58675880
updatePolicy:
58685881
description: 'UpdatePolicy determines the policy for applying upgrades
5869-
automatically. Valid values: ''automatic'' (default): apply updates
5882+
automatically. Valid values: ''automatic'' (default): apply updates
58705883
automatically (apply OS security upgrades, avoiding rebooting when
5871-
possible) ''external'': do not apply updates automatically; they
5884+
possible) ''external'': do not apply updates automatically; they
58725885
are applied manually or by an external system'
58735886
type: string
58745887
useHostCertificates:
@@ -5903,9 +5916,3 @@ spec:
59035916
type: object
59045917
served: true
59055918
storage: true
5906-
status:
5907-
acceptedNames:
5908-
kind: ""
5909-
plural: ""
5910-
conditions: []
5911-
storedVersions: []

k8s/crds/kops.k8s.io_instancegroups.yaml

+12-16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.5.0
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
97
name: instancegroups.kops.k8s.io
108
spec:
119
group: kops.k8s.io
@@ -225,6 +223,10 @@ spec:
225223
description: State directory for execution state files (default
226224
"/run/containerd").
227225
type: string
226+
testHandlerEnabled:
227+
description: TestHandlerEnabled enables a runtime called test-handler,
228+
specific to k/k e2e tests
229+
type: boolean
228230
version:
229231
description: Version used to pick the containerd package.
230232
type: string
@@ -286,8 +288,8 @@ spec:
286288
type: array
287289
gcpProvisioningModel:
288290
description: 'GCPProvisioningModel: Specifies the provisioning model
289-
of the GCP instance. Valid values: ''STANDARD'': (default) standard
290-
provisioning with user controlled run time, no discounts ''SPOT'':
291+
of the GCP instance. Valid values: ''STANDARD'': (default) standard
292+
provisioning with user controlled run time, no discounts ''SPOT'':
291293
heavily discounted, no guaranteed run time.'
292294
type: string
293295
guestAccelerators:
@@ -573,9 +575,9 @@ spec:
573575
description: 'How should the kubelet configure the container bridge
574576
for hairpin packets. Setting this flag allows endpoints in a
575577
Service to loadbalance back to themselves if they should try
576-
to access their own Service. Values: "promiscuous-bridge":
577-
make the container bridge promiscuous. "hairpin-veth": set
578-
the hairpin flag on container veth interfaces. "none": do
578+
to access their own Service. Values: "promiscuous-bridge": make
579+
the container bridge promiscuous. "hairpin-veth": set
580+
the hairpin flag on container veth interfaces. "none": do
579581
nothing. Setting --configure-cbr0 to false implies that to achieve
580582
hairpin NAT one must set --hairpin-mode=veth-flag, because bridge
581583
assumes the existence of a container bridge named cbr0.'
@@ -1052,9 +1054,9 @@ spec:
10521054
updatePolicy:
10531055
description: 'UpdatePolicy determines the policy for applying upgrades
10541056
automatically. If specified, this value overrides a value specified
1055-
in the Cluster''s "spec.updatePolicy" field. Valid values: ''automatic''
1057+
in the Cluster''s "spec.updatePolicy" field. Valid values: ''automatic''
10561058
(default): apply updates automatically (apply OS security upgrades,
1057-
avoiding rebooting when possible) ''external'': do not apply updates
1059+
avoiding rebooting when possible) ''external'': do not apply updates
10581060
automatically; they are applied manually or by an external system'
10591061
type: string
10601062
volumeMounts:
@@ -1162,9 +1164,3 @@ spec:
11621164
served: true
11631165
storage: true
11641166
subresources: {}
1165-
status:
1166-
acceptedNames:
1167-
kind: ""
1168-
plural: ""
1169-
conditions: []
1170-
storedVersions: []

k8s/crds/kops.k8s.io_keysets.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.5.0
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
97
name: keysets.kops.k8s.io
108
spec:
119
group: kops.k8s.io
@@ -76,9 +74,3 @@ spec:
7674
type: object
7775
served: true
7876
storage: true
79-
status:
80-
acceptedNames:
81-
kind: ""
82-
plural: ""
83-
conditions: []
84-
storedVersions: []

k8s/crds/kops.k8s.io_sshcredentials.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition
54
metadata:
65
annotations:
7-
controller-gen.kubebuilder.io/version: v0.5.0
8-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
97
name: sshcredentials.kops.k8s.io
108
spec:
119
group: kops.k8s.io
@@ -41,9 +39,3 @@ spec:
4139
type: object
4240
served: true
4341
storage: true
44-
status:
45-
acceptedNames:
46-
kind: ""
47-
plural: ""
48-
conditions: []
49-
storedVersions: []

nodeup/pkg/model/containerd.go

+3
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ func (b *ContainerdBuilder) buildContainerdConfig() (string, error) {
492492
if containerd.SeLinuxEnabled {
493493
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "enable_selinux"}, true)
494494
}
495+
if containerd.TestHandlerEnabled {
496+
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "containerd", "runtimes", "test-handler", "runtime_type"}, "io.containerd.runc.v2")
497+
}
495498
if b.NodeupConfig.KubeletConfig.PodInfraContainerImage != "" {
496499
config.SetPath([]string{"plugins", "io.containerd.grpc.v1.cri", "sandbox_image"}, b.NodeupConfig.KubeletConfig.PodInfraContainerImage)
497500
}

pkg/apis/kops/containerdconfig.go

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ type ContainerdConfig struct {
5151
SeLinuxEnabled bool `json:"selinuxEnabled,omitempty"`
5252
// NRI configures the Node Resource Interface.
5353
NRI *NRIConfig `json:"nri,omitempty"`
54+
// TestHandlerEnabled enables a runtime called test-handler, specific to k/k e2e tests
55+
TestHandlerEnabled bool `json:"testHandlerEnabled,omitempty"`
5456
}
5557

5658
type NRIConfig struct {

pkg/apis/kops/v1alpha2/containerdconfig.go

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ type ContainerdConfig struct {
4646
SeLinuxEnabled bool `json:"selinuxEnabled,omitempty"`
4747
// NRI configures the Node Resource Interface.
4848
NRI *NRIConfig `json:"nri,omitempty"`
49+
// TestHandlerEnabled enables a runtime called test-handler, specific to k/k e2e tests
50+
TestHandlerEnabled bool `json:"testHandlerEnabled,omitempty"`
4951
}
5052

5153
type NRIConfig struct {

pkg/apis/kops/v1alpha2/zz_generated.conversion.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/kops/v1alpha3/containerdconfig.go

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ type ContainerdConfig struct {
4646
SeLinuxEnabled bool `json:"selinuxEnabled,omitempty"`
4747
// NRI configures the Node Resource Interface.
4848
NRI *NRIConfig `json:"nri,omitempty"`
49+
// TestHandlerEnabled enables a runtime called test-handler, specific to k/k e2e tests
50+
TestHandlerEnabled bool `json:"testHandlerEnabled,omitempty"`
4951
}
5052

5153
type NRIConfig struct {

pkg/apis/kops/v1alpha3/zz_generated.conversion.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e/kubetest2-kops/deployer/up.go

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
118118
"--kubernetes-version", d.KubernetesVersion,
119119
"--ssh-public-key", d.SSHPublicKeyPath,
120120
"--set", "cluster.spec.nodePortAccess=0.0.0.0/0",
121+
"--set", "spec.containerd.testHandlerEnabled=true",
121122
}
122123
if yes {
123124
args = append(args, "--yes")

0 commit comments

Comments
 (0)