Skip to content

Commit 4db9135

Browse files
committed
Add integration tests for containerd.selinuxEnabled
Add two integration tests that exercise spec.containerd.selinuxEnabled: one AWS cluster (containerd-selinux) and one GCE cluster (minimal_gce_selinux). They assert that enabling SELinux renders seLinuxMount: true on the CSIDriver and adds the extra host mounts the node CSI driver needs (/etc/selinux and, on AWS, /sys/fs).
1 parent e3ba060 commit 4db9135

60 files changed

Lines changed: 9940 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/kops/integration_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,15 @@ func TestMinimalGCE(t *testing.T) {
190190
runTestTerraformGCE(t)
191191
}
192192

193+
// TestMinimalGCESELinux runs a minimal GCE cluster with
194+
// spec.containerd.selinuxEnabled, which enables SELinux mount support in the
195+
// GCP PD CSI driver: the CSIDriver gets seLinuxMount: true and the node driver
196+
// pod gets the extra /etc/selinux host mount it needs.
197+
func TestMinimalGCESELinux(t *testing.T) {
198+
newIntegrationTest("minimal-gce.example.com", "minimal_gce_selinux").
199+
runTestTerraformGCE(t)
200+
}
201+
193202
// TestMinimalGCEPrivate runs tests on a minimal GCE configuration with private topology.
194203
func TestMinimalGCEPrivate(t *testing.T) {
195204
newIntegrationTest("minimal-gce-private.example.com", "minimal_gce_private").
@@ -569,6 +578,15 @@ func TestContainerdCustom(t *testing.T) {
569578
runTestTerraformAWS(t)
570579
}
571580

581+
// TestContainerdSELinux runs the test on a containerd configuration with
582+
// spec.containerd.selinuxEnabled, which enables SELinux mount support in the
583+
// AWS EBS CSI driver: the CSIDriver gets seLinuxMount: true and the node driver
584+
// pod gets the extra host mounts (/etc/selinux, /sys/fs) it needs.
585+
func TestContainerdSELinux(t *testing.T) {
586+
newIntegrationTest("containerd.example.com", "containerd-selinux").
587+
runTestTerraformAWS(t)
588+
}
589+
572590
// TestAPIServerNodes runs a simple configuration with dedicated apiserver nodes
573591
func TestAPIServerNodes(t *testing.T) {
574592
featureflag.ParseFlags("+APIServerNodes")
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
files:
2+
- canonical: https://artifacts.k8s.io/binaries/cloud-provider-aws/v1.37.0/linux/amd64/ecr-credential-provider-linux-amd64
3+
download: https://artifacts.k8s.io/binaries/cloud-provider-aws/v1.37.0/linux/amd64/ecr-credential-provider-linux-amd64
4+
sha: 842e0fd8159f5ed8df2f38e6521e1e4f0a1ee80cf1e1ac119bbf20bf9c20681c
5+
- canonical: https://artifacts.k8s.io/binaries/cloud-provider-aws/v1.37.0/linux/arm64/ecr-credential-provider-linux-arm64
6+
download: https://artifacts.k8s.io/binaries/cloud-provider-aws/v1.37.0/linux/arm64/ecr-credential-provider-linux-arm64
7+
sha: dd4748d167b0167cd4a66779dbbe4964e17a29a076aaa3d2b63cfc36ae84b52c
8+
- canonical: https://artifacts.k8s.io/binaries/kops/1.37.0-beta.1/linux/amd64/nodeup.xz
9+
download: https://artifacts.k8s.io/binaries/kops/1.37.0-beta.1/linux/amd64/nodeup.xz
10+
sha: a899417ddb4fa0bba91c07c8d10b10747088a1067ca3dfa83097c1720eeda9ea
11+
- canonical: https://artifacts.k8s.io/binaries/kops/1.37.0-beta.1/linux/arm64/nodeup.xz
12+
download: https://artifacts.k8s.io/binaries/kops/1.37.0-beta.1/linux/arm64/nodeup.xz
13+
sha: c2e424da38473c3ee1b9309e84e4167857fe8c01ea0df0328f49f6472aebac0e
14+
- canonical: https://dl.k8s.io/release/v1.32.0/bin/linux/amd64/kubectl
15+
download: https://dl.k8s.io/release/v1.32.0/bin/linux/amd64/kubectl
16+
sha: 646d58f6d98ee670a71d9cdffbf6625aeea2849d567f214bc43a35f8ccb7bf70
17+
- canonical: https://dl.k8s.io/release/v1.32.0/bin/linux/amd64/kubelet
18+
download: https://dl.k8s.io/release/v1.32.0/bin/linux/amd64/kubelet
19+
sha: 5ad4965598773d56a37a8e8429c3dc3d86b4c5c26d8417ab333ae345c053dae2
20+
- canonical: https://dl.k8s.io/release/v1.32.0/bin/linux/arm64/kubectl
21+
download: https://dl.k8s.io/release/v1.32.0/bin/linux/arm64/kubectl
22+
sha: ba4004f98f3d3a7b7d2954ff0a424caa2c2b06b78c17b1dccf2acc76a311a896
23+
- canonical: https://dl.k8s.io/release/v1.32.0/bin/linux/arm64/kubelet
24+
download: https://dl.k8s.io/release/v1.32.0/bin/linux/arm64/kubelet
25+
sha: bda9b2324c96693b38c41ecea051bab4c7c434be5683050b5e19025b50dbc0bf
26+
- canonical: https://github.com/containerd/containerd/releases/download/v2.3.4/containerd-2.3.4-linux-amd64.tar.gz
27+
download: https://github.com/containerd/containerd/releases/download/v2.3.4/containerd-2.3.4-linux-amd64.tar.gz
28+
sha: 9d68969855fbf676cdb8ed758e420fb048d61f984f61de3e53eddfebe484d168
29+
- canonical: https://github.com/containerd/containerd/releases/download/v2.3.4/containerd-2.3.4-linux-arm64.tar.gz
30+
download: https://github.com/containerd/containerd/releases/download/v2.3.4/containerd-2.3.4-linux-arm64.tar.gz
31+
sha: a985fbb7e18fc0362d31a055338f5d7b0e087a3e27f14c70d1c5965399a29f95
32+
- canonical: https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-amd64-v1.6.2.tgz
33+
download: https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-amd64-v1.6.2.tgz
34+
sha: b8e811578fb66023f90d2e238d80cec3bdfca4b44049af74c374d4fae0f9c090
35+
- canonical: https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-arm64-v1.6.2.tgz
36+
download: https://github.com/containernetworking/plugins/releases/download/v1.6.2/cni-plugins-linux-arm64-v1.6.2.tgz
37+
sha: 01e0e22acc7f7004e4588c1fe1871cc86d7ab562cd858e1761c4641d89ebfaa4
38+
- canonical: https://github.com/opencontainers/runc/releases/download/v1.4.3/runc.amd64
39+
download: https://github.com/opencontainers/runc/releases/download/v1.4.3/runc.amd64
40+
sha: f6ae8efc0fa40079e1475e97cbe9d1bd3f106a28d6af78a11d9f1bd565515e60
41+
- canonical: https://github.com/opencontainers/runc/releases/download/v1.4.3/runc.arm64
42+
download: https://github.com/opencontainers/runc/releases/download/v1.4.3/runc.arm64
43+
sha: 633301e2e32f8a5ad54031aab4901eb00308bec677dd15faa2751e8f9dab5ca4
44+
images:
45+
- canonical: public.ecr.aws/aws-ec2/aws-node-termination-handler:v1.25.5
46+
download: public.ecr.aws/aws-ec2/aws-node-termination-handler:v1.25.5
47+
- canonical: registry.k8s.io/coredns/coredns:v1.14.2
48+
download: registry.k8s.io/coredns/coredns:v1.14.2
49+
- canonical: registry.k8s.io/cpa/cluster-proportional-autoscaler:v1.9.0
50+
download: registry.k8s.io/cpa/cluster-proportional-autoscaler:v1.9.0
51+
- canonical: registry.k8s.io/etcd-manager/etcd-manager-slim:v3.0.20260707
52+
download: registry.k8s.io/etcd-manager/etcd-manager-slim:v3.0.20260707
53+
- canonical: registry.k8s.io/etcd:v3.5.31
54+
download: registry.k8s.io/etcd:v3.5.31
55+
- canonical: registry.k8s.io/etcd:v3.6.12
56+
download: registry.k8s.io/etcd:v3.6.12
57+
- canonical: registry.k8s.io/etcd:v3.7.0
58+
download: registry.k8s.io/etcd:v3.7.0
59+
- canonical: registry.k8s.io/kops/channels:1.37.0-beta.1
60+
download: registry.k8s.io/kops/channels:1.37.0-beta.1
61+
- canonical: registry.k8s.io/kops/dns-controller:1.37.0-beta.1
62+
download: registry.k8s.io/kops/dns-controller:1.37.0-beta.1
63+
- canonical: registry.k8s.io/kops/kops-controller:1.37.0-beta.1
64+
download: registry.k8s.io/kops/kops-controller:1.37.0-beta.1
65+
- canonical: registry.k8s.io/kops/kube-apiserver-healthcheck:1.37.0-beta.1
66+
download: registry.k8s.io/kops/kube-apiserver-healthcheck:1.37.0-beta.1
67+
- canonical: registry.k8s.io/kube-apiserver:v1.32.0
68+
download: registry.k8s.io/kube-apiserver:v1.32.0
69+
- canonical: registry.k8s.io/kube-controller-manager:v1.32.0
70+
download: registry.k8s.io/kube-controller-manager:v1.32.0
71+
- canonical: registry.k8s.io/kube-proxy:v1.32.0
72+
download: registry.k8s.io/kube-proxy:v1.32.0
73+
- canonical: registry.k8s.io/kube-scheduler:v1.32.0
74+
download: registry.k8s.io/kube-scheduler:v1.32.0
75+
- canonical: registry.k8s.io/pause:3.10.1
76+
download: registry.k8s.io/pause:3.10.1
77+
- canonical: registry.k8s.io/provider-aws/aws-ebs-csi-driver:v1.65.0
78+
download: registry.k8s.io/provider-aws/aws-ebs-csi-driver:v1.65.0
79+
- canonical: registry.k8s.io/provider-aws/cloud-controller-manager:v1.37.0
80+
download: registry.k8s.io/provider-aws/cloud-controller-manager:v1.37.0
81+
- canonical: registry.k8s.io/sig-storage/csi-attacher:v4.12.0
82+
download: registry.k8s.io/sig-storage/csi-attacher:v4.12.0
83+
- canonical: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.17.0
84+
download: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.17.0
85+
- canonical: registry.k8s.io/sig-storage/csi-provisioner:v6.3.0
86+
download: registry.k8s.io/sig-storage/csi-provisioner:v6.3.0
87+
- canonical: registry.k8s.io/sig-storage/csi-resizer:v2.2.1
88+
download: registry.k8s.io/sig-storage/csi-resizer:v2.2.1
89+
- canonical: registry.k8s.io/sig-storage/livenessprobe:v2.19.0
90+
download: registry.k8s.io/sig-storage/livenessprobe:v2.19.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"source":["aws.autoscaling"],"detail-type":["EC2 Instance-terminate Lifecycle Action"]}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"source": ["aws.health"],"detail-type": ["AWS Health Event"],"detail": {"service": ["EC2"],"eventTypeCategory": ["scheduledChange"]}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"source": ["aws.ec2"],"detail-type": ["EC2 Instance State-change Notification"]}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"source": ["aws.ec2"],"detail-type": ["EC2 Spot Instance Interruption Warning"]}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Principal": { "Service": "ec2.amazonaws.com"},
7+
"Action": "sts:AssumeRole"
8+
}
9+
]
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Principal": { "Service": "ec2.amazonaws.com"},
7+
"Action": "sts:AssumeRole"
8+
}
9+
]
10+
}

0 commit comments

Comments
 (0)