Skip to content

Commit

Permalink
chore: forceful expiration updates (#6430)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal authored Jul 2, 2024
1 parent a057ec7 commit 09530a7
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 794 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/aws/aws-sdk-go v1.54.11
github.com/aws/karpenter-provider-aws/tools/kompat v0.0.0-20240410220356-6b868db24881
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647
github.com/awslabs/operatorpkg v0.0.0-20240605172541-88cf99023fa4
github.com/awslabs/operatorpkg v0.0.0-20240701195752-116cbcffbcb4
github.com/go-logr/zapr v1.3.0
github.com/imdario/mergo v0.3.16
github.com/jonathan-innis/aws-sdk-go-prometheus v0.1.0
Expand All @@ -31,7 +31,7 @@ require (
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
knative.dev/pkg v0.0.0-20231010144348-ca8c009405dd
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/karpenter v0.37.1-0.20240627203024-f66fd07b6fbb
sigs.k8s.io/karpenter v0.37.1-0.20240629051434-89a81c3ae853
sigs.k8s.io/yaml v1.4.0
)

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ github.com/aws/karpenter-provider-aws/tools/kompat v0.0.0-20240410220356-6b868db
github.com/aws/karpenter-provider-aws/tools/kompat v0.0.0-20240410220356-6b868db24881/go.mod h1:+Mk5k0b6HpKobxNq+B56DOhZ+I/NiPhd5MIBhQMSTSs=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647 h1:8yRBVsjGmI7qQsPWtIrbWP+XfwHO9Wq7gdLVzjqiZFs=
github.com/awslabs/amazon-eks-ami/nodeadm v0.0.0-20240229193347-cfab22a10647/go.mod h1:9NafTAUHL0FlMeL6Cu5PXnMZ1q/LnC9X2emLXHsVbM8=
github.com/awslabs/operatorpkg v0.0.0-20240605172541-88cf99023fa4 h1:EVFVrteX0PQuofO9Ah4rf4aGyUkBM3lLuKgzwilAEAg=
github.com/awslabs/operatorpkg v0.0.0-20240605172541-88cf99023fa4/go.mod h1:OR0NDOTl6XUXKgcksUab5d7mCnpaZf7Ko4eWEbheJTY=
github.com/awslabs/operatorpkg v0.0.0-20240701195752-116cbcffbcb4 h1:mD24yp98VHBV3PympU2jTKAzKq1IIgpdZd9+aJOuxv8=
github.com/awslabs/operatorpkg v0.0.0-20240701195752-116cbcffbcb4/go.mod h1:oQUBEhsmTceyAkUb7XRIYsMKvJkidoU3UpAa+beK/0w=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand Down Expand Up @@ -763,8 +763,8 @@ sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHv
sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/karpenter v0.37.1-0.20240627203024-f66fd07b6fbb h1:FZWiUjcJ52G8qcSKg0VeYxWtRDMfLWCQQ31tCqgfEME=
sigs.k8s.io/karpenter v0.37.1-0.20240627203024-f66fd07b6fbb/go.mod h1:b2WP5LvtWNjec0JaTuzoxYnp6XXoBG9Bed1VzQwlaSw=
sigs.k8s.io/karpenter v0.37.1-0.20240629051434-89a81c3ae853 h1:WAFMsZJpnScxrsXBsbou0hsZJOQRFS1RxRXb4Ee/cs4=
sigs.k8s.io/karpenter v0.37.1-0.20240629051434-89a81c3ae853/go.mod h1:jPA1J954ZvzJelythD9EtkrQXZLPUrZaMhQJ4MBRQ/Q=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
Expand Down
128 changes: 11 additions & 117 deletions pkg/apis/crds/karpenter.sh_nodeclaims.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ spec:
- jsonPath: .metadata.labels.node\.kubernetes\.io/instance-type
name: Type
type: string
- jsonPath: .metadata.labels.karpenter\.sh/capacity-type
name: Capacity
type: string
- jsonPath: .metadata.labels.topology\.kubernetes\.io/zone
name: Zone
type: string
Expand All @@ -32,8 +35,8 @@ spec:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
- jsonPath: .metadata.labels.karpenter\.sh/capacity-type
name: Capacity
- jsonPath: .status.providerID
name: ID
priority: 1
type: string
- jsonPath: .metadata.labels.karpenter\.sh/nodepool
Expand Down Expand Up @@ -69,124 +72,10 @@ spec:
spec:
description: NodeClaimSpec describes the desired state of the NodeClaim
properties:
kubelet:
description: |-
Kubelet defines args to be used when configuring kubelet on provisioned nodes.
They are a subset of the upstream types, recognizing not all options may be supported.
Wherever possible, the types and names should reflect the upstream kubelet types.
properties:
clusterDNS:
description: |-
clusterDNS is a list of IP addresses for the cluster DNS server.
Note that not all providers may use all addresses.
items:
type: string
type: array
cpuCFSQuota:
description: CPUCFSQuota enables CPU CFS quota enforcement for containers that specify CPU limits.
type: boolean
evictionHard:
additionalProperties:
type: string
pattern: ^((\d{1,2}(\.\d{1,2})?|100(\.0{1,2})?)%||(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?)$
description: EvictionHard is the map of signal names to quantities that define hard eviction thresholds
type: object
x-kubernetes-validations:
- message: valid keys for evictionHard are ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available']
rule: self.all(x, x in ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available'])
evictionMaxPodGracePeriod:
description: |-
EvictionMaxPodGracePeriod is the maximum allowed grace period (in seconds) to use when terminating pods in
response to soft eviction thresholds being met.
format: int32
type: integer
evictionSoft:
additionalProperties:
type: string
pattern: ^((\d{1,2}(\.\d{1,2})?|100(\.0{1,2})?)%||(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?)$
description: EvictionSoft is the map of signal names to quantities that define soft eviction thresholds
type: object
x-kubernetes-validations:
- message: valid keys for evictionSoft are ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available']
rule: self.all(x, x in ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available'])
evictionSoftGracePeriod:
additionalProperties:
type: string
description: EvictionSoftGracePeriod is the map of signal names to quantities that define grace periods for each eviction signal
type: object
x-kubernetes-validations:
- message: valid keys for evictionSoftGracePeriod are ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available']
rule: self.all(x, x in ['memory.available','nodefs.available','nodefs.inodesFree','imagefs.available','imagefs.inodesFree','pid.available'])
imageGCHighThresholdPercent:
description: |-
ImageGCHighThresholdPercent is the percent of disk usage after which image
garbage collection is always run. The percent is calculated by dividing this
field value by 100, so this field must be between 0 and 100, inclusive.
When specified, the value must be greater than ImageGCLowThresholdPercent.
format: int32
maximum: 100
minimum: 0
type: integer
imageGCLowThresholdPercent:
description: |-
ImageGCLowThresholdPercent is the percent of disk usage before which image
garbage collection is never run. Lowest disk usage to garbage collect to.
The percent is calculated by dividing this field value by 100,
so the field value must be between 0 and 100, inclusive.
When specified, the value must be less than imageGCHighThresholdPercent
format: int32
maximum: 100
minimum: 0
type: integer
kubeReserved:
additionalProperties:
type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
description: KubeReserved contains resources reserved for Kubernetes system components.
type: object
x-kubernetes-validations:
- message: valid keys for kubeReserved are ['cpu','memory','ephemeral-storage','pid']
rule: self.all(x, x=='cpu' || x=='memory' || x=='ephemeral-storage' || x=='pid')
- message: kubeReserved value cannot be a negative resource quantity
rule: self.all(x, !self[x].startsWith('-'))
maxPods:
description: |-
MaxPods is an override for the maximum number of pods that can run on
a worker node instance.
format: int32
minimum: 0
type: integer
podsPerCore:
description: |-
PodsPerCore is an override for the number of pods that can run on a worker node
instance based on the number of cpu cores. This value cannot exceed MaxPods, so, if
MaxPods is a lower value, that value will be used.
format: int32
minimum: 0
type: integer
systemReserved:
additionalProperties:
type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
description: SystemReserved contains resources reserved for OS system daemons and kernel memory.
type: object
x-kubernetes-validations:
- message: valid keys for systemReserved are ['cpu','memory','ephemeral-storage','pid']
rule: self.all(x, x=='cpu' || x=='memory' || x=='ephemeral-storage' || x=='pid')
- message: systemReserved value cannot be a negative resource quantity
rule: self.all(x, !self[x].startsWith('-'))
type: object
x-kubernetes-validations:
- message: imageGCHighThresholdPercent must be greater than imageGCLowThresholdPercent
rule: 'has(self.imageGCHighThresholdPercent) && has(self.imageGCLowThresholdPercent) ? self.imageGCHighThresholdPercent > self.imageGCLowThresholdPercent : true'
- message: evictionSoft OwnerKey does not have a matching evictionSoftGracePeriod
rule: has(self.evictionSoft) ? self.evictionSoft.all(e, (e in self.evictionSoftGracePeriod)):true
- message: evictionSoftGracePeriod OwnerKey does not have a matching evictionSoft
rule: has(self.evictionSoftGracePeriod) ? self.evictionSoftGracePeriod.all(e, (e in self.evictionSoft)):true
nodeClassRef:
description: NodeClassRef is a reference to an object that defines provider specific configuration
properties:
apiVersion:
group:
description: API version of the referent
type: string
kind:
Expand All @@ -196,6 +85,8 @@ spec:
description: 'Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names'
type: string
required:
- group
- kind
- name
type: object
requirements:
Expand Down Expand Up @@ -361,6 +252,9 @@ spec:
- nodeClassRef
- requirements
type: object
x-kubernetes-validations:
- message: spec is immutable
rule: self == oldSelf
status:
description: NodeClaimStatus defines the observed state of NodeClaim
properties:
Expand Down
Loading

0 comments on commit 09530a7

Please sign in to comment.