mirror of https://github.com/kubernetes/kops.git
Add more create_cluster integration tests
This commit is contained in:
parent
161d30b743
commit
29a7268442
|
@ -50,6 +50,9 @@ func TestCreateClusterMinimal(t *testing.T) {
|
||||||
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.21", "v1alpha2")
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.21", "v1alpha2")
|
||||||
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.22", "v1alpha2")
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.22", "v1alpha2")
|
||||||
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.23", "v1alpha2")
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.23", "v1alpha2")
|
||||||
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.24", "v1alpha2")
|
||||||
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.25", "v1alpha2")
|
||||||
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/minimal-1.26", "v1alpha2")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestCreateClusterOverride tests the override flag
|
// TestCreateClusterOverride tests the override flag
|
||||||
|
@ -133,6 +136,11 @@ func TestCreateClusterIPv6(t *testing.T) {
|
||||||
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ipv6", "v1alpha2")
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/ipv6", "v1alpha2")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestCreateClusterDifferentAMIs runs kops create cluster with different AMI inputs
|
||||||
|
func TestCreateClusterDifferentAMIs(t *testing.T) {
|
||||||
|
runCreateClusterIntegrationTest(t, "../../tests/integration/create_cluster/different-amis", "v1alpha2")
|
||||||
|
}
|
||||||
|
|
||||||
// TestCreateClusterKarpenter runs kops create cluster --instance-manager=karpenter
|
// TestCreateClusterKarpenter runs kops create cluster --instance-manager=karpenter
|
||||||
func TestCreateClusterKarpenter(t *testing.T) {
|
func TestCreateClusterKarpenter(t *testing.T) {
|
||||||
featureflag.ParseFlags("+Karpenter")
|
featureflag.ParseFlags("+Karpenter")
|
||||||
|
|
|
@ -0,0 +1,135 @@
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
name: amis.example.com
|
||||||
|
spec:
|
||||||
|
api:
|
||||||
|
loadBalancer:
|
||||||
|
class: Classic
|
||||||
|
type: Public
|
||||||
|
authorization:
|
||||||
|
rbac: {}
|
||||||
|
channel: stable
|
||||||
|
cloudProvider: aws
|
||||||
|
configBase: memfs://tests/amis.example.com
|
||||||
|
etcdClusters:
|
||||||
|
- cpuRequest: 200m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: main
|
||||||
|
- cpuRequest: 100m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: events
|
||||||
|
iam:
|
||||||
|
allowContainerRegistry: true
|
||||||
|
legacy: false
|
||||||
|
kubelet:
|
||||||
|
anonymousAuth: false
|
||||||
|
kubernetesApiAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
kubernetesVersion: v1.24.0
|
||||||
|
masterPublicName: api.amis.example.com
|
||||||
|
networkCIDR: 172.20.0.0/16
|
||||||
|
networking:
|
||||||
|
cni: {}
|
||||||
|
nonMasqueradeCIDR: 100.64.0.0/10
|
||||||
|
sshAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
subnets:
|
||||||
|
- cidr: 172.20.32.0/19
|
||||||
|
name: us-test-1a
|
||||||
|
type: Private
|
||||||
|
zone: us-test-1a
|
||||||
|
- cidr: 172.20.0.0/22
|
||||||
|
name: utility-us-test-1a
|
||||||
|
type: Utility
|
||||||
|
zone: us-test-1a
|
||||||
|
topology:
|
||||||
|
bastion:
|
||||||
|
bastionPublicName: bastion.amis.example.com
|
||||||
|
dns:
|
||||||
|
type: Public
|
||||||
|
masters: private
|
||||||
|
nodes: private
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: amis.example.com
|
||||||
|
name: bastions
|
||||||
|
spec:
|
||||||
|
image: ami-image
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 1
|
||||||
|
httpTokens: required
|
||||||
|
machineType: t2.micro
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: bastions
|
||||||
|
role: Bastion
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: amis.example.com
|
||||||
|
name: master-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: ami-control-plane
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 3
|
||||||
|
httpTokens: required
|
||||||
|
machineType: m3.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: master-us-test-1a
|
||||||
|
role: Master
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: amis.example.com
|
||||||
|
name: nodes-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: ami-worker-image
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 1
|
||||||
|
httpTokens: required
|
||||||
|
machineType: t2.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: nodes-us-test-1a
|
||||||
|
role: Node
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
|
@ -0,0 +1,11 @@
|
||||||
|
ClusterName: amis.example.com
|
||||||
|
Zones:
|
||||||
|
- us-test-1a
|
||||||
|
CloudProvider: aws
|
||||||
|
Networking: cni
|
||||||
|
KubernetesVersion: v1.24.0
|
||||||
|
Image: ami-image
|
||||||
|
MasterImage: ami-control-plane
|
||||||
|
NodeImage: ami-worker-image
|
||||||
|
Bastion: true
|
||||||
|
Topology: private
|
|
@ -0,0 +1,103 @@
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
name: minimal.example.com
|
||||||
|
spec:
|
||||||
|
api:
|
||||||
|
dns: {}
|
||||||
|
authorization:
|
||||||
|
rbac: {}
|
||||||
|
channel: stable
|
||||||
|
cloudProvider: aws
|
||||||
|
configBase: memfs://tests/minimal.example.com
|
||||||
|
etcdClusters:
|
||||||
|
- cpuRequest: 200m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: main
|
||||||
|
- cpuRequest: 100m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: events
|
||||||
|
iam:
|
||||||
|
allowContainerRegistry: true
|
||||||
|
legacy: false
|
||||||
|
kubelet:
|
||||||
|
anonymousAuth: false
|
||||||
|
kubernetesApiAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
kubernetesVersion: v1.24.0
|
||||||
|
masterPublicName: api.minimal.example.com
|
||||||
|
networkCIDR: 172.20.0.0/16
|
||||||
|
networking:
|
||||||
|
cni: {}
|
||||||
|
nonMasqueradeCIDR: 100.64.0.0/10
|
||||||
|
sshAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
subnets:
|
||||||
|
- cidr: 172.20.32.0/19
|
||||||
|
name: us-test-1a
|
||||||
|
type: Public
|
||||||
|
zone: us-test-1a
|
||||||
|
topology:
|
||||||
|
dns:
|
||||||
|
type: Public
|
||||||
|
masters: public
|
||||||
|
nodes: public
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: minimal.example.com
|
||||||
|
name: master-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20220615
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 3
|
||||||
|
httpTokens: required
|
||||||
|
machineType: m3.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: master-us-test-1a
|
||||||
|
role: Master
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: minimal.example.com
|
||||||
|
name: nodes-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20220615
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 1
|
||||||
|
httpTokens: required
|
||||||
|
machineType: t2.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: nodes-us-test-1a
|
||||||
|
role: Node
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
|
@ -0,0 +1,6 @@
|
||||||
|
ClusterName: minimal.example.com
|
||||||
|
Zones:
|
||||||
|
- us-test-1a
|
||||||
|
CloudProvider: aws
|
||||||
|
Networking: cni
|
||||||
|
KubernetesVersion: v1.24.0
|
|
@ -0,0 +1,103 @@
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
name: minimal.example.com
|
||||||
|
spec:
|
||||||
|
api:
|
||||||
|
dns: {}
|
||||||
|
authorization:
|
||||||
|
rbac: {}
|
||||||
|
channel: stable
|
||||||
|
cloudProvider: aws
|
||||||
|
configBase: memfs://tests/minimal.example.com
|
||||||
|
etcdClusters:
|
||||||
|
- cpuRequest: 200m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: main
|
||||||
|
- cpuRequest: 100m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: events
|
||||||
|
iam:
|
||||||
|
allowContainerRegistry: true
|
||||||
|
legacy: false
|
||||||
|
kubelet:
|
||||||
|
anonymousAuth: false
|
||||||
|
kubernetesApiAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
kubernetesVersion: v1.25.0
|
||||||
|
masterPublicName: api.minimal.example.com
|
||||||
|
networkCIDR: 172.20.0.0/16
|
||||||
|
networking:
|
||||||
|
cni: {}
|
||||||
|
nonMasqueradeCIDR: 100.64.0.0/10
|
||||||
|
sshAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
subnets:
|
||||||
|
- cidr: 172.20.32.0/19
|
||||||
|
name: us-test-1a
|
||||||
|
type: Public
|
||||||
|
zone: us-test-1a
|
||||||
|
topology:
|
||||||
|
dns:
|
||||||
|
type: Public
|
||||||
|
masters: public
|
||||||
|
nodes: public
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: minimal.example.com
|
||||||
|
name: master-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20220615
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 3
|
||||||
|
httpTokens: required
|
||||||
|
machineType: m3.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: master-us-test-1a
|
||||||
|
role: Master
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: minimal.example.com
|
||||||
|
name: nodes-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20220615
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 1
|
||||||
|
httpTokens: required
|
||||||
|
machineType: t2.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: nodes-us-test-1a
|
||||||
|
role: Node
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
|
@ -0,0 +1,6 @@
|
||||||
|
ClusterName: minimal.example.com
|
||||||
|
Zones:
|
||||||
|
- us-test-1a
|
||||||
|
CloudProvider: aws
|
||||||
|
Networking: cni
|
||||||
|
KubernetesVersion: v1.25.0
|
|
@ -0,0 +1,103 @@
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: Cluster
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
name: minimal.example.com
|
||||||
|
spec:
|
||||||
|
api:
|
||||||
|
dns: {}
|
||||||
|
authorization:
|
||||||
|
rbac: {}
|
||||||
|
channel: stable
|
||||||
|
cloudProvider: aws
|
||||||
|
configBase: memfs://tests/minimal.example.com
|
||||||
|
etcdClusters:
|
||||||
|
- cpuRequest: 200m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: main
|
||||||
|
- cpuRequest: 100m
|
||||||
|
etcdMembers:
|
||||||
|
- encryptedVolume: true
|
||||||
|
instanceGroup: master-us-test-1a
|
||||||
|
name: a
|
||||||
|
memoryRequest: 100Mi
|
||||||
|
name: events
|
||||||
|
iam:
|
||||||
|
allowContainerRegistry: true
|
||||||
|
legacy: false
|
||||||
|
kubelet:
|
||||||
|
anonymousAuth: false
|
||||||
|
kubernetesApiAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
kubernetesVersion: v1.26.0
|
||||||
|
masterPublicName: api.minimal.example.com
|
||||||
|
networkCIDR: 172.20.0.0/16
|
||||||
|
networking:
|
||||||
|
cni: {}
|
||||||
|
nonMasqueradeCIDR: 100.64.0.0/10
|
||||||
|
sshAccess:
|
||||||
|
- 0.0.0.0/0
|
||||||
|
- ::/0
|
||||||
|
subnets:
|
||||||
|
- cidr: 172.20.32.0/19
|
||||||
|
name: us-test-1a
|
||||||
|
type: Public
|
||||||
|
zone: us-test-1a
|
||||||
|
topology:
|
||||||
|
dns:
|
||||||
|
type: Public
|
||||||
|
masters: public
|
||||||
|
nodes: public
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: minimal.example.com
|
||||||
|
name: master-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20220615
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 3
|
||||||
|
httpTokens: required
|
||||||
|
machineType: m3.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: master-us-test-1a
|
||||||
|
role: Master
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: kops.k8s.io/v1alpha2
|
||||||
|
kind: InstanceGroup
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2017-01-01T00:00:00Z"
|
||||||
|
labels:
|
||||||
|
kops.k8s.io/cluster: minimal.example.com
|
||||||
|
name: nodes-us-test-1a
|
||||||
|
spec:
|
||||||
|
image: 099720109477/ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-20220615
|
||||||
|
instanceMetadata:
|
||||||
|
httpPutResponseHopLimit: 1
|
||||||
|
httpTokens: required
|
||||||
|
machineType: t2.medium
|
||||||
|
manager: CloudGroup
|
||||||
|
maxSize: 1
|
||||||
|
minSize: 1
|
||||||
|
nodeLabels:
|
||||||
|
kops.k8s.io/instancegroup: nodes-us-test-1a
|
||||||
|
role: Node
|
||||||
|
subnets:
|
||||||
|
- us-test-1a
|
|
@ -0,0 +1,6 @@
|
||||||
|
ClusterName: minimal.example.com
|
||||||
|
Zones:
|
||||||
|
- us-test-1a
|
||||||
|
CloudProvider: aws
|
||||||
|
Networking: cni
|
||||||
|
KubernetesVersion: v1.26.0
|
Loading…
Reference in New Issue