Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle affinity, anti-affinity, and topologySpreadConstraints #96

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion terraform/modules/provision-aws/locals/k8s-locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ locals {
server = data.aws_eks_cluster.main.endpoint
zone_id = aws_route53_zone.cluster.zone_id
zone_role_arn = aws_iam_role.external_dns.arn
launch_template_name = data.aws_launch_template.eks_launch_template.name
launch_template_name = data.aws_launch_template.eks_launch_template.id
vpc_cidr_range = module.vpc.vpc_cidr_block
}
2 changes: 1 addition & 1 deletion terraform/modules/provision-aws/managed-node-groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ resource "helm_release" "karpenter" {
name = "karpenter"
repository = "https://charts.karpenter.sh"
chart = "karpenter"
version = "v0.8.0"
version = "v0.9.1"

dynamic "set" {
for_each = {
Expand Down
4 changes: 2 additions & 2 deletions terraform/modules/provision-k8s/k8s-autoscaler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ resource "helm_release" "autoscaler-provisioner" {
resources:
cpu: 1000
provider:
launchTemplate: <launch-template-name>
launchTemplate: ${local.launch_template_name}
subnetSelector:
karpenter.sh/discovery: <cluster-name>
karpenter.sh/discovery: ${local.cluster_name}
ttlSecondsAfterEmpty: 30
EOF
]
Expand Down
13 changes: 13 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ else
echo FAIL
fi

# Test 4 - autoscaling works
echo -n "Provisioning a resource too big for m4.xlarge"
kubectl apply -f test_specs/autoscaling/pod.yml

echo -n "Waiting for Pod to start..."
if (kubectl wait --for=condition=ready --timeout=600s pod large-app); then
echo PASS
else
retval=1
echo FAIL
fi


#######
## From here down, tests need a KUBECONFIG with an admin user to complete correctly, so let's make a new one
# Grab the name of the cluster for use with the aws CLI
Expand Down
13 changes: 13 additions & 0 deletions test_specs/autoscaling/pod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Pod
metadata:
name: large-app
spec:
containers:
- name: large-app
image: busybox
resources:
requests:
cpu: "5000m"
limits:
cpu: "6000m"