Configure Karpenter resources.

This commit is contained in:
Dan Ports 2023-09-15 21:57:13 -04:00
parent bd6c6852dc
commit 32b0416547
14 changed files with 112 additions and 22 deletions

View File

@ -1505,6 +1505,12 @@ spec:
karpenter: karpenter:
description: Karpenter defines the Karpenter configuration. description: Karpenter defines the Karpenter configuration.
properties: properties:
cpuRequest:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
enabled: enabled:
type: boolean type: boolean
image: image:
@ -1513,6 +1519,18 @@ spec:
type: string type: string
logLevel: logLevel:
type: string type: string
memoryLimit:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
memoryRequest:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object type: object
keyStore: keyStore:
description: KeyStore is the VFS path to where SSL keys and certificates description: KeyStore is the VFS path to where SSL keys and certificates

View File

@ -254,10 +254,13 @@ type ScalewaySpec struct {
} }
type KarpenterConfig struct { type KarpenterConfig struct {
Enabled bool `json:"enabled,omitempty"` Enabled bool `json:"enabled,omitempty"`
LogEncoding string `json:"logFormat,omitempty"` LogEncoding string `json:"logFormat,omitempty"`
LogLevel string `json:"logLevel,omitempty"` LogLevel string `json:"logLevel,omitempty"`
Image string `json:"image,omitempty"` Image string `json:"image,omitempty"`
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
} }
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer. // ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.

View File

@ -261,10 +261,13 @@ type PodIdentityWebhookSpec struct {
} }
type KarpenterConfig struct { type KarpenterConfig struct {
Enabled bool `json:"enabled,omitempty"` Enabled bool `json:"enabled,omitempty"`
LogEncoding string `json:"logEncoding,omitempty"` LogEncoding string `json:"logEncoding,omitempty"`
LogLevel string `json:"logLevel,omitempty"` LogLevel string `json:"logLevel,omitempty"`
Image string `json:"image,omitempty"` Image string `json:"image,omitempty"`
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
} }
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer. // ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.

View File

@ -4605,6 +4605,9 @@ func autoConvert_v1alpha2_KarpenterConfig_To_kops_KarpenterConfig(in *KarpenterC
out.LogEncoding = in.LogEncoding out.LogEncoding = in.LogEncoding
out.LogLevel = in.LogLevel out.LogLevel = in.LogLevel
out.Image = in.Image out.Image = in.Image
out.MemoryLimit = in.MemoryLimit
out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest
return nil return nil
} }
@ -4618,6 +4621,9 @@ func autoConvert_kops_KarpenterConfig_To_v1alpha2_KarpenterConfig(in *kops.Karpe
out.LogEncoding = in.LogEncoding out.LogEncoding = in.LogEncoding
out.LogLevel = in.LogLevel out.LogLevel = in.LogLevel
out.Image = in.Image out.Image = in.Image
out.MemoryLimit = in.MemoryLimit
out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest
return nil return nil
} }

View File

@ -1368,7 +1368,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
if in.Karpenter != nil { if in.Karpenter != nil {
in, out := &in.Karpenter, &out.Karpenter in, out := &in.Karpenter, &out.Karpenter
*out = new(KarpenterConfig) *out = new(KarpenterConfig)
**out = **in (*in).DeepCopyInto(*out)
} }
if in.PodIdentityWebhook != nil { if in.PodIdentityWebhook != nil {
in, out := &in.PodIdentityWebhook, &out.PodIdentityWebhook in, out := &in.PodIdentityWebhook, &out.PodIdentityWebhook
@ -2735,6 +2735,21 @@ func (in *InstanceRequirementsSpec) DeepCopy() *InstanceRequirementsSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KarpenterConfig) DeepCopyInto(out *KarpenterConfig) { func (in *KarpenterConfig) DeepCopyInto(out *KarpenterConfig) {
*out = *in *out = *in
if in.MemoryLimit != nil {
in, out := &in.MemoryLimit, &out.MemoryLimit
x := (*in).DeepCopy()
*out = &x
}
if in.MemoryRequest != nil {
in, out := &in.MemoryRequest, &out.MemoryRequest
x := (*in).DeepCopy()
*out = &x
}
if in.CPURequest != nil {
in, out := &in.CPURequest, &out.CPURequest
x := (*in).DeepCopy()
*out = &x
}
return return
} }

View File

@ -250,10 +250,13 @@ type ScalewaySpec struct {
} }
type KarpenterConfig struct { type KarpenterConfig struct {
Enabled bool `json:"enabled,omitempty"` Enabled bool `json:"enabled,omitempty"`
LogEncoding string `json:"logEncoding,omitempty"` LogEncoding string `json:"logEncoding,omitempty"`
LogLevel string `json:"logLevel,omitempty"` LogLevel string `json:"logLevel,omitempty"`
Image string `json:"image,omitempty"` Image string `json:"image,omitempty"`
MemoryLimit *resource.Quantity `json:"memoryLimit,omitempty"`
MemoryRequest *resource.Quantity `json:"memoryRequest,omitempty"`
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
} }
// ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer. // ServiceAccountIssuerDiscoveryConfig configures an OIDC Issuer.

View File

@ -4998,6 +4998,9 @@ func autoConvert_v1alpha3_KarpenterConfig_To_kops_KarpenterConfig(in *KarpenterC
out.LogEncoding = in.LogEncoding out.LogEncoding = in.LogEncoding
out.LogLevel = in.LogLevel out.LogLevel = in.LogLevel
out.Image = in.Image out.Image = in.Image
out.MemoryLimit = in.MemoryLimit
out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest
return nil return nil
} }
@ -5011,6 +5014,9 @@ func autoConvert_kops_KarpenterConfig_To_v1alpha3_KarpenterConfig(in *kops.Karpe
out.LogEncoding = in.LogEncoding out.LogEncoding = in.LogEncoding
out.LogLevel = in.LogLevel out.LogLevel = in.LogLevel
out.Image = in.Image out.Image = in.Image
out.MemoryLimit = in.MemoryLimit
out.MemoryRequest = in.MemoryRequest
out.CPURequest = in.CPURequest
return nil return nil
} }

View File

@ -1263,7 +1263,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
if in.Karpenter != nil { if in.Karpenter != nil {
in, out := &in.Karpenter, &out.Karpenter in, out := &in.Karpenter, &out.Karpenter
*out = new(KarpenterConfig) *out = new(KarpenterConfig)
**out = **in (*in).DeepCopyInto(*out)
} }
return return
} }
@ -2704,6 +2704,21 @@ func (in *InstanceRootVolumeSpec) DeepCopy() *InstanceRootVolumeSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KarpenterConfig) DeepCopyInto(out *KarpenterConfig) { func (in *KarpenterConfig) DeepCopyInto(out *KarpenterConfig) {
*out = *in *out = *in
if in.MemoryLimit != nil {
in, out := &in.MemoryLimit, &out.MemoryLimit
x := (*in).DeepCopy()
*out = &x
}
if in.MemoryRequest != nil {
in, out := &in.MemoryRequest, &out.MemoryRequest
x := (*in).DeepCopy()
*out = &x
}
if in.CPURequest != nil {
in, out := &in.CPURequest, &out.CPURequest
x := (*in).DeepCopy()
*out = &x
}
return return
} }

View File

@ -1360,7 +1360,7 @@ func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
if in.Karpenter != nil { if in.Karpenter != nil {
in, out := &in.Karpenter, &out.Karpenter in, out := &in.Karpenter, &out.Karpenter
*out = new(KarpenterConfig) *out = new(KarpenterConfig)
**out = **in (*in).DeepCopyInto(*out)
} }
return return
} }
@ -2867,6 +2867,21 @@ func (in *InstanceRootVolumeSpec) DeepCopy() *InstanceRootVolumeSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KarpenterConfig) DeepCopyInto(out *KarpenterConfig) { func (in *KarpenterConfig) DeepCopyInto(out *KarpenterConfig) {
*out = *in *out = *in
if in.MemoryLimit != nil {
in, out := &in.MemoryLimit, &out.MemoryLimit
x := (*in).DeepCopy()
*out = &x
}
if in.MemoryRequest != nil {
in, out := &in.MemoryRequest, &out.MemoryRequest
x := (*in).DeepCopy()
*out = &x
}
if in.CPURequest != nil {
in, out := &in.CPURequest, &out.CPURequest
x := (*in).DeepCopy()
*out = &x
}
return return
} }

View File

@ -55,10 +55,13 @@ spec:
legacy: false legacy: false
useServiceAccountExternalPermissions: true useServiceAccountExternalPermissions: true
karpenter: karpenter:
cpuRequest: 100m
enabled: true enabled: true
image: public.ecr.aws/karpenter/controller:v0.28.1 image: public.ecr.aws/karpenter/controller:v0.28.1
logEncoding: console logEncoding: console
logLevel: debug logLevel: debug
memoryLimit: 2Gi
memoryRequest: 500Mi
keyStore: memfs://clusters.example.com/minimal.example.com/pki keyStore: memfs://clusters.example.com/minimal.example.com/pki
kubeAPIServer: kubeAPIServer:
allowPrivileged: true allowPrivileged: true

View File

@ -120,7 +120,7 @@ spec:
version: 9.99.0 version: 9.99.0
- id: k8s-1.19 - id: k8s-1.19
manifest: karpenter.sh/k8s-1.19.yaml manifest: karpenter.sh/k8s-1.19.yaml
manifestHash: ff8aea6ec871d9b7d8482dab9831d002de4466243c9df7c10b363e47ccc58601 manifestHash: 83732936b11b5830020d8af7bf0955c4b6334c7a1ba93bf051b40bb79294075d
name: karpenter.sh name: karpenter.sh
prune: prune:
kinds: kinds:

View File

@ -1744,10 +1744,10 @@ spec:
timeoutSeconds: 30 timeoutSeconds: 30
resources: resources:
limits: limits:
memory: 1Gi memory: 2Gi
requests: requests:
cpu: 500m cpu: 100m
memory: 1Gi memory: 500Mi
volumeMounts: volumeMounts:
- mountPath: /var/run/secrets/amazonaws.com/ - mountPath: /var/run/secrets/amazonaws.com/
name: token-amazonaws-com name: token-amazonaws-com

View File

@ -21,7 +21,10 @@ spec:
iam: iam:
useServiceAccountExternalPermissions: true useServiceAccountExternalPermissions: true
karpenter: karpenter:
cpuRequest: 100m
enabled: true enabled: true
memoryRequest: 500Mi
memoryLimit: 2Gi
kubelet: kubelet:
anonymousAuth: false anonymousAuth: false
kubernetesVersion: v1.25.0 kubernetesVersion: v1.25.0

View File

@ -1526,10 +1526,10 @@ spec:
port: http port: http
resources: resources:
limits: limits:
memory: 1Gi memory: {{ or .Karpenter.MemoryLimit "1Gi" }}
requests: requests:
cpu: 500m cpu: {{ or .Karpenter.CPURequest "500m" }}
memory: 1Gi memory: {{ or .Karpenter.MemoryRequest "1Gi" }}
nodeSelector: null nodeSelector: null
# The template below patches the .Values.affinity to add a default label selector where not specificed # The template below patches the .Values.affinity to add a default label selector where not specificed
affinity: affinity: