-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update:
autoscaling-karpenter
to v0.32.1 (#129)
- Loading branch information
1 parent
6b9cc95
commit 7ba827a
Showing
5 changed files
with
154 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package karpenter | ||
|
||
import ( | ||
"github.com/awslabs/eksdemo/pkg/manifest" | ||
"github.com/awslabs/eksdemo/pkg/resource" | ||
"github.com/awslabs/eksdemo/pkg/template" | ||
) | ||
|
||
type NodePoolOptions struct { | ||
resource.CommonOptions | ||
*KarpenterOptions | ||
} | ||
|
||
func karpenterDefaultNodePool(o *KarpenterOptions) *resource.Resource { | ||
res := &resource.Resource{ | ||
Options: &NodePoolOptions{ | ||
CommonOptions: resource.CommonOptions{ | ||
Name: "karpenter-default-nodepool", | ||
}, | ||
KarpenterOptions: o, | ||
}, | ||
|
||
Manager: &manifest.ResourceManager{ | ||
Template: &template.TextTemplate{ | ||
Template: yamlTemplate, | ||
}, | ||
}, | ||
} | ||
return res | ||
} | ||
|
||
const yamlTemplate = `--- | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
requirements: | ||
- key: kubernetes.io/arch | ||
operator: In | ||
values: ["amd64"] | ||
- key: kubernetes.io/os | ||
operator: In | ||
values: ["linux"] | ||
- key: karpenter.sh/capacity-type | ||
operator: In | ||
values: ["on-demand", "spot"] | ||
- key: karpenter.k8s.aws/instance-category | ||
operator: In | ||
values: ["c", "m", "r"] | ||
- key: karpenter.k8s.aws/instance-generation | ||
operator: Gt | ||
values: ["2"] | ||
nodeClassRef: | ||
name: default | ||
limits: | ||
cpu: 1000 | ||
disruption: | ||
consolidationPolicy: WhenUnderutilized | ||
expireAfter: {{ .ExpireAfter }} | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: default | ||
spec: | ||
amiFamily: {{ .AMIFamily }} | ||
role: KarpenterNodeRole-{{ .ClusterName }} | ||
subnetSelectorTerms: | ||
- tags: | ||
Name: eksctl-{{ .ClusterName }}-cluster/SubnetPrivate* | ||
securityGroupSelectorTerms: | ||
- tags: | ||
aws:eks:cluster-name: {{ .ClusterName }} | ||
` |
64 changes: 0 additions & 64 deletions
64
pkg/application/autoscaling/karpenter/default_provisioner.go
This file was deleted.
Oops, something went wrong.
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