forked from aws/eks-anywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding autoscaling annotations to nutanix (aws#4314)
* Adding autoscaling annotations to nutanix * Adding test for autoscaling template nutanix
- Loading branch information
Showing
5 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
pkg/providers/nutanix/testdata/eksa-cluster-autoscaler.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: eksa-unit-test | ||
namespace: default | ||
spec: | ||
kubernetesVersion: "1.19" | ||
controlPlaneConfiguration: | ||
name: eksa-unit-test | ||
count: 3 | ||
endpoint: | ||
host: test-ip | ||
machineGroupRef: | ||
name: eksa-unit-test | ||
kind: NutanixMachineConfig | ||
workerNodeGroupConfigurations: | ||
- count: 3 | ||
autoscalingConfiguration: | ||
minCount: 3 | ||
maxCount: 5 | ||
name: eksa-unit-test | ||
machineGroupRef: | ||
name: eksa-unit-test | ||
kind: NutanixMachineConfig | ||
externalEtcdConfiguration: | ||
name: eksa-unit-test | ||
count: 3 | ||
machineGroupRef: | ||
name: eksa-unit-test | ||
kind: NutanixMachineConfig | ||
datacenterRef: | ||
kind: NutanixDatacenterConfig | ||
name: eksa-unit-test | ||
clusterNetwork: | ||
cni: "cilium" | ||
pods: | ||
cidrBlocks: | ||
- 192.168.0.0/16 | ||
services: | ||
cidrBlocks: | ||
- 10.96.0.0/12 | ||
--- | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: NutanixDatacenterConfig | ||
metadata: | ||
name: eksa-unit-test | ||
namespace: default | ||
spec: | ||
endpoint: "prism.nutanix.com" | ||
port: 9440 | ||
--- | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: NutanixMachineConfig | ||
metadata: | ||
name: eksa-unit-test | ||
namespace: default | ||
spec: | ||
vcpusPerSocket: 1 | ||
vcpuSockets: 4 | ||
memorySize: 8Gi | ||
image: | ||
type: "name" | ||
name: "prism-image" | ||
cluster: | ||
type: "name" | ||
name: "prism-cluster" | ||
subnet: | ||
type: "name" | ||
name: "prism-subnet" | ||
systemDiskSize: 40Gi | ||
osFamily: "ubuntu" | ||
users: | ||
- name: "mySshUsername" | ||
sshAuthorizedKeys: | ||
- "mySshAuthorizedKey" |
79 changes: 79 additions & 0 deletions
79
pkg/providers/nutanix/testdata/expected_results_autoscaling_md.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: "eksa-unit-test" | ||
name: "eksa-unit-test-eksa-unit-test" | ||
namespace: "eksa-system" | ||
annotations: | ||
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "3" | ||
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5" | ||
spec: | ||
clusterName: "eksa-unit-test" | ||
replicas: 3 | ||
selector: | ||
matchLabels: {} | ||
template: | ||
metadata: | ||
labels: | ||
cluster.x-k8s.io/cluster-name: "eksa-unit-test" | ||
spec: | ||
bootstrap: | ||
configRef: | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
name: "eksa-unit-test" | ||
clusterName: "eksa-unit-test" | ||
infrastructureRef: | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixMachineTemplate | ||
name: "eksa-unit-test" | ||
version: "v1.19.8-eks-1-19-4" | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 | ||
kind: NutanixMachineTemplate | ||
metadata: | ||
name: "eksa-unit-test" | ||
namespace: "eksa-system" | ||
spec: | ||
template: | ||
spec: | ||
providerID: "nutanix://eksa-unit-test-m1" | ||
vcpusPerSocket: 1 | ||
vcpuSockets: 4 | ||
memorySize: 8Gi | ||
systemDiskSize: 40Gi | ||
image: | ||
type: name | ||
name: "prism-image" | ||
|
||
cluster: | ||
type: name | ||
name: "prism-cluster" | ||
subnet: | ||
- type: name | ||
name: "prism-subnet" | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: "eksa-unit-test" | ||
namespace: "eksa-system" | ||
spec: | ||
template: | ||
spec: | ||
joinConfiguration: | ||
nodeRegistration: | ||
kubeletExtraArgs: | ||
# We have to pin the cgroupDriver to cgroupfs as kubeadm >=1.21 defaults to systemd | ||
# kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726 | ||
#cgroup-driver: cgroupfs | ||
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% | ||
users: | ||
- name: "mySshUsername" | ||
lockPassword: false | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
sshAuthorizedKeys: | ||
- "mySshAuthorizedKey" | ||
|
||
--- |