Skip to content

Commit

Permalink
Add bottlerocket integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed Sep 1, 2020
1 parent 5751e9b commit 72e8bf6
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 31 deletions.
7 changes: 4 additions & 3 deletions cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ func TestHighAvailabilityGCE(t *testing.T) {

// TestComplex runs the test on a more complex configuration, intended to hit more of the edge cases
func TestComplex(t *testing.T) {
newIntegrationTest("complex.example.com", "complex").withoutSSHKey().runTestTerraformAWS(t)
newIntegrationTest("complex.example.com", "complex").withoutSSHKey().runTestCloudformation(t)
newIntegrationTest("complex.example.com", "complex").withoutSSHKey().withVersion("legacy-v1alpha2").runTestTerraformAWS(t)
ig := []string{"nodes-bottlerocket"}
newIntegrationTest("complex.example.com", "complex").withoutSSHKey().withAdditionalInstanceGroups(ig).runTestTerraformAWS(t)
newIntegrationTest("complex.example.com", "complex").withoutSSHKey().withAdditionalInstanceGroups(ig).runTestCloudformation(t)
newIntegrationTest("complex.example.com", "complex").withoutSSHKey().withVersion("legacy-v1alpha2").withAdditionalInstanceGroups(ig).runTestTerraformAWS(t)
}

// TestExternalPolicies tests external policies output
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/update_cluster/complex/cloudformation.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@
"Value": "fib+baz",
"PropagateAtLaunch": true
},
{
"Key": "k8s.io/cluster-autoscaler/node-template/label/foo",
"Value": "bar",
"PropagateAtLaunch": true
},
{
"Key": "k8s.io/role/node",
"Value": "1",
Expand Down Expand Up @@ -459,6 +464,10 @@
"Key": "foo/bar",
"Value": "fib+baz"
},
{
"Key": "k8s.io/cluster-autoscaler/node-template/label/foo",
"Value": "bar"
},
{
"Key": "k8s.io/role/node",
"Value": "1"
Expand Down Expand Up @@ -492,6 +501,10 @@
"Key": "foo/bar",
"Value": "fib+baz"
},
{
"Key": "k8s.io/cluster-autoscaler/node-template/label/foo",
"Value": "bar"
},
{
"Key": "k8s.io/role/node",
"Value": "1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,12 @@ Resources.AWSEC2LaunchTemplatenodesbottlerocketcomplexexamplecom.Properties.Laun
[settings]
[settings.kubernetes]
api-server = "api.internal.complex.example.com"
cluster-certificate = "-----BEGIN CERTIFICATE-----\nMIIBaDCCARKgAwIBAgIMFjC/criEQFBRT5ptMA0GCSqGSIb3DQEBCwUAMBUxEzAR\nBgNVBAMTCmt1YmVybmV0ZXMwHhcNMjAwODMwMTkyNjA3WhcNMzAwODMwMTkyNjA3\nWjAVMRMwEQYDVQQDEwprdWJlcm5ldGVzMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB\nAKK1m+ixWmtlG5dPJeI/yE93DVYPKjipM/EaHatZV4eVfmlDxI8ofvQ3P+NPPvnr\nQOEzFQMrqAIxpSSOkwSRhksCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\nEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJgAjrE7QotdxHlqF8A2QmFs5nrfMA0GCSqG\nSIb3DQEBCwUAA0EAR13lyvMWZVi6SXjLYJxb9wF7z4PvNp6WMKaldVBvDvV9Z7cz\nVFvzypAy7SYuE4jK9NfSWHg/4kyGEMZlMWV3nw==\n-----END CERTIFICATE-----\n"
api-server = "https://api.internal.complex.example.com"
cluster-certificate = "-----BEGIN CERTIFICATE-----\nMIIBaDCCARKgAwIBAgIMFjC/phPwLjA1aCDzMA0GCSqGSIb3DQEBCwUAMBUxEzAR\nBgNVBAMTCmt1YmVybmV0ZXMwHhcNMjAwODMwMTkyOTQ3WhcNMzAwODMwMTkyOTQ3\nWjAVMRMwEQYDVQQDEwprdWJlcm5ldGVzMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB\nAKzcWrpoi4IV884Cb8+YCEMEzdvicES8KtccGUceESKLFPcPSxdzufI4gpmrBj4C\njLhpmGgP4LeDtbfkza4AdnkCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\nEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJX8vo483+oqusJpGprCMQLkIfedMA0GCSqG\nSIb3DQEBCwUAA0EAigQ6xDdyAU4ILJybYxJnKSk7GhBv0EpQGHrO8QQtyolZPNC+\nYgqAfE+3+hGrm+iwjrT4rMMIm14KYrvNAGjlEg==\n-----END CERTIFICATE-----\n"
cluster-name = "complex.example.com"
[settings.kubernetes.node-labels]
foo = "bar"
Resources.AWSEC2LaunchTemplatenodescomplexexamplecom.Properties.LaunchTemplateData.UserData: |
Content-Type: multipart/mixed; boundary="MIMEBOUNDARY"
MIME-Version: 1.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[settings]

[settings.kubernetes]
api-server = "api.internal.complex.example.com"
cluster-certificate = "-----BEGIN CERTIFICATE-----\nMIIBaDCCARKgAwIBAgIMFjC/cvb4s0hO6w4PMA0GCSqGSIb3DQEBCwUAMBUxEzAR\nBgNVBAMTCmt1YmVybmV0ZXMwHhcNMjAwODMwMTkyNjA4WhcNMzAwODMwMTkyNjA4\nWjAVMRMwEQYDVQQDEwprdWJlcm5ldGVzMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB\nAOYT646d0JR+zrjoop6oJ6d4vtIvhJzx1txpqsFjOeAi1brftka69LRNhLGoM/af\nG9OOainu+m5msF7Q4pRYb78CAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\nEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMt3mYPW1yZTicIC0NG1vVA+ZWxRMA0GCSqG\nSIb3DQEBCwUAA0EAacOAi5CVyh4HXNEFkQoELu78cwn1H2pjYMB/My0nhkcwqYuR\nFgfTw674+NEqSItiXd+73Cb3oyNY3A1/HqCb7A==\n-----END CERTIFICATE-----\n"
api-server = "https://api.internal.complex.example.com"
cluster-certificate = "-----BEGIN CERTIFICATE-----\nMIIBaDCCARKgAwIBAgIMFjC/pj/z/MiMIXA0MA0GCSqGSIb3DQEBCwUAMBUxEzAR\nBgNVBAMTCmt1YmVybmV0ZXMwHhcNMjAwODMwMTkyOTQ4WhcNMzAwODMwMTkyOTQ4\nWjAVMRMwEQYDVQQDEwprdWJlcm5ldGVzMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJB\nANJi9BfBettZ7914VlgsjdekR0LIEExZ+KUoHkSQEa+jWA4mrBmjLkhVJZPTa3rj\nXX+bglsg8ggaaEOaOWt5AccCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\nEwEB/wQFMAMBAf8wHQYDVR0OBBYEFOyHFrtrdYXSUYs4oioq2GR/o+/TMA0GCSqG\nSIb3DQEBCwUAA0EAyRbmfdYz3x0DvxR1vKydKuWX4CcCVyeeEb569PVjq3h2Devo\n2GsmSzLur8voNJ7Ep7S7yrNoa7hk5J0r/KxCVw==\n-----END CERTIFICATE-----\n"
cluster-name = "complex.example.com"

[settings.kubernetes.node-labels]
foo = "bar"
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ spec:
associatePublicIp: true
suspendProcesses:
- AZRebalance
image: 092701018921/bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-e0ddf1b
image: bottlerocket/bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-e0ddf1b
imageFamily: bottlerocket
machineType: t2.medium
maxSize: 2
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/update_cluster/complex/in-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ spec:
associatePublicIp: true
suspendProcesses:
- AZRebalance
image: 092701018921/bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-e0ddf1b
image: bottlerocket/bottlerocket-aws-k8s-1.17-x86_64-v0.5.0-e0ddf1b
imageFamily: bottlerocket
machineType: t2.medium
maxSize: 2
Expand Down
50 changes: 29 additions & 21 deletions tests/integration/update_cluster/complex/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ resource "aws_autoscaling_group" "nodes-bottlerocket-complex-example-com" {
propagate_at_launch = true
value = "fib+baz"
}
tag {
key = "k8s.io/cluster-autoscaler/node-template/label/foo"
propagate_at_launch = true
value = "bar"
}
tag {
key = "k8s.io/role/node"
propagate_at_launch = true
Expand Down Expand Up @@ -427,35 +432,38 @@ resource "aws_launch_template" "nodes-bottlerocket-complex-example-com" {
tag_specifications {
resource_type = "instance"
tags = {
"KubernetesCluster" = "complex.example.com"
"Name" = "nodes-bottlerocket.complex.example.com"
"Owner" = "John Doe"
"foo/bar" = "fib+baz"
"k8s.io/role/node" = "1"
"kops.k8s.io/instancegroup" = "nodes-bottlerocket"
"kubernetes.io/cluster/complex.example.com" = "owned"
"KubernetesCluster" = "complex.example.com"
"Name" = "nodes-bottlerocket.complex.example.com"
"Owner" = "John Doe"
"foo/bar" = "fib+baz"
"k8s.io/cluster-autoscaler/node-template/label/foo" = "bar"
"k8s.io/role/node" = "1"
"kops.k8s.io/instancegroup" = "nodes-bottlerocket"
"kubernetes.io/cluster/complex.example.com" = "owned"
}
}
tag_specifications {
resource_type = "volume"
tags = {
"KubernetesCluster" = "complex.example.com"
"Name" = "nodes-bottlerocket.complex.example.com"
"Owner" = "John Doe"
"foo/bar" = "fib+baz"
"k8s.io/role/node" = "1"
"kops.k8s.io/instancegroup" = "nodes-bottlerocket"
"kubernetes.io/cluster/complex.example.com" = "owned"
"KubernetesCluster" = "complex.example.com"
"Name" = "nodes-bottlerocket.complex.example.com"
"Owner" = "John Doe"
"foo/bar" = "fib+baz"
"k8s.io/cluster-autoscaler/node-template/label/foo" = "bar"
"k8s.io/role/node" = "1"
"kops.k8s.io/instancegroup" = "nodes-bottlerocket"
"kubernetes.io/cluster/complex.example.com" = "owned"
}
}
tags = {
"KubernetesCluster" = "complex.example.com"
"Name" = "nodes-bottlerocket.complex.example.com"
"Owner" = "John Doe"
"foo/bar" = "fib+baz"
"k8s.io/role/node" = "1"
"kops.k8s.io/instancegroup" = "nodes-bottlerocket"
"kubernetes.io/cluster/complex.example.com" = "owned"
"KubernetesCluster" = "complex.example.com"
"Name" = "nodes-bottlerocket.complex.example.com"
"Owner" = "John Doe"
"foo/bar" = "fib+baz"
"k8s.io/cluster-autoscaler/node-template/label/foo" = "bar"
"k8s.io/role/node" = "1"
"kops.k8s.io/instancegroup" = "nodes-bottlerocket"
"kubernetes.io/cluster/complex.example.com" = "owned"
}
user_data = filebase64("${path.module}/data/aws_launch_template_nodes-bottlerocket.complex.example.com_user_data")
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/update_cluster/public-jwks/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ resource "aws_iam_instance_profile" "nodes-minimal-example-com" {

resource "aws_iam_openid_connect_provider" "minimal-example-com" {
client_id_list = ["amazonaws.com"]
thumbprint_list = ["8b7ad6465ac95e10e413948f5b47e34a4ecfd9d8"]
thumbprint_list = ["30f4acf29d87745daf7e1a47f437876274f04430"]
url = "https://api.minimal.example.com"
}

Expand Down

0 comments on commit 72e8bf6

Please sign in to comment.