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

dev to alpha #8429

Merged
merged 14 commits into from
Oct 22, 2024
Merged
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
9 changes: 9 additions & 0 deletions cluster/config-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ kubernetes_lifecycle_metrics_mem_min: "120Mi"
kube_node_ready_controller_cpu: "50m"
kube_node_ready_controller_memory: "200Mi"

# Enable kube-node-ready ASG lifecycle hook feature.
kube_node_ready_enabled: "true"

# Enable deployment of aws-cloud-controller-manager
aws_cloud_controller_manager_enabled: "true"
aws_cloud_controller_manager_cpu: "125m"
Expand Down Expand Up @@ -1146,3 +1149,9 @@ control_plane_graceful_shutdown: "true"
# fs.aio-max-nr = 8388608
# fs.inotify.max_user_watches = 100000
sysctl_settings: ""



# scheduling_controls
teapot_admission_controller_scheduling_controls_enabled: "false"
teapot_admission_controller_scheduling_controls_default_architecture: "amd64"
2 changes: 2 additions & 0 deletions cluster/manifests/01-admission-control/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ data:
{{- end}}

pod.env-inject.node-options.enable: "{{ .Cluster.ConfigItems.teapot_admission_controller_inject_node_options_environment_variable }}"
pod.scheduling-controls.enable: "{{ .Cluster.ConfigItems.teapot_admission_controller_scheduling_controls_enabled }}"
pod.scheduling-controls.default-architecture: "{{ .Cluster.ConfigItems.teapot_admission_controller_scheduling_controls_default_architecture }}"

podfactory.container-resource-check.enable: "{{ .Cluster.ConfigItems.teapot_admission_controller_validate_pod_template_resources }}"
podfactory.application-label-check.enable: "{{ .Cluster.ConfigItems.teapot_admission_controller_validate_application_label }}"
Expand Down
11 changes: 11 additions & 0 deletions cluster/manifests/deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,14 @@ post_apply:
kind: DaemonSet
namespace: kube-system
{{- end }}
{{- if ne .Cluster.ConfigItems.kube_node_ready_enabled "true" }}
- name: kube-node-ready
kind: DaemonSet
namespace: kube-system
- name: kube-node-ready
kind: ServiceAccount
namespace: kube-system
- name: kube-node-ready
kind: Service
namespace: kube-system
{{- end }}
2 changes: 2 additions & 0 deletions cluster/manifests/kube-node-ready/01-rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# {{ if eq .Cluster.ConfigItems.kube_node_ready_enabled "true" }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-node-ready
namespace: kube-system
annotations:
iam.amazonaws.com/role: "{{ .Cluster.LocalID }}-kube-node-ready"
# {{ end }}
2 changes: 2 additions & 0 deletions cluster/manifests/kube-node-ready/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# {{ if eq .Cluster.ConfigItems.kube_node_ready_enabled "true" }}
# {{ $image := "container-registry.zalando.net/teapot/kube-node-ready:master-34" }}
# {{ $version := index (split $image ":") 1 }}

Expand Down Expand Up @@ -65,3 +66,4 @@ spec:
runAsUser: 1000
securityContext:
fsGroup: 65534
# {{ end }}
2 changes: 2 additions & 0 deletions cluster/manifests/kube-node-ready/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# {{ if eq .Cluster.ConfigItems.kube_node_ready_enabled "true" }}
kind: Service
apiVersion: v1
metadata:
Expand All @@ -16,3 +17,4 @@ spec:
protocol: TCP
selector:
component: kube-node-ready
# {{ end }}
4 changes: 3 additions & 1 deletion cluster/manifests/kube2iam/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ spec:
effect: NoExecute
hostNetwork: true
containers:
- image: container-registry.zalando.net/teapot/kube2iam:0.11.2-master-18.patched
- image: container-registry.zalando.net/teapot/kube2iam:0.12.0-master-19.patched
name: kube2iam
args:
- --auto-discover-base-arn
- --verbose
- --node=$(NODE_NAME)
env:
- name: AWS_DEFAULT_REGION
value: "{{.Cluster.Region}}"
- name: NODE_NAME
valueFrom:
fieldRef:
Expand Down
6 changes: 3 additions & 3 deletions cluster/node-pools/master-default/userdata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ write_files:
name: admission-controller-kubeconfig
readOnly: true
- name: skipper-admission-webhook
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/skipper:v0.21.222
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/skipper:v0.21.223
args:
- webhook
- --address=:9085
Expand Down Expand Up @@ -424,7 +424,7 @@ write_files:
value: {{ .Cluster.ConfigItems.apiserver_business_partner_ids }}
{{ end }}
- name: skipper-proxy
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/skipper:v0.21.222
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/skipper:v0.21.223
args:
- skipper
- -access-log-strip-query
Expand Down Expand Up @@ -475,7 +475,7 @@ write_files:
name: ssl-certs-kubernetes
readOnly: true
- name: skipper-metrics
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/skipper:v0.21.222
image: 926694233939.dkr.ecr.eu-central-1.amazonaws.com/production_namespace/teapot/skipper:v0.21.223
args:
- skipper
- -access-log-strip-query
Expand Down
2 changes: 2 additions & 0 deletions cluster/node-pools/worker-combined/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ Resources:
Roles:
- !ImportValue '{{ .Cluster.ID }}:worker-iam-role'
Type: 'AWS::IAM::InstanceProfile'
# {{ if eq .Cluster.ConfigItems.kube_node_ready_enabled "true" }}
AutoscalingLifecycleHook:
Properties:
AutoScalingGroupName: !Ref AutoScalingGroup
Expand All @@ -182,3 +183,4 @@ Resources:
HeartbeatTimeout: '600'
LifecycleTransition: 'autoscaling:EC2_INSTANCE_LAUNCHING'
Type: 'AWS::AutoScaling::LifecycleHook'
# {{ end }}
29 changes: 23 additions & 6 deletions cluster/node-pools/worker-karpenter/provisioners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ spec:
- "c7in"
- "m7in"
- "r7in"
#{{ else if (gt (len .NodePool.InstanceTypes) 0) }}
- key: "node.kubernetes.io/instance-type"
operator: In
values:
# {{ range $type := .NodePool.InstanceTypes }}
- "{{ $type }}"
# {{ end }}
#{{ end }}

# safety guards to prevent the use of unwanted instance types in case the user has not specified any specific instance types
#{{ if or (eq .NodePool.KarpenterInstanceTypeStrategy "default-for-karpenter") (eq .NodePool.KarpenterInstanceTypeStrategy "not-specified") }}
# exclude unwanted sizes
- key: "karpenter.k8s.aws/instance-size"
operator: "NotIn"
values:
Expand All @@ -166,14 +178,19 @@ spec:
- "c5d.large"
- "m5d.large"
- "r5d.large"
#{{ else }}
- key: "node.kubernetes.io/instance-type"
operator: In
#{{end}}

#{{ if (index .NodePool.ConfigItems "requirements") }}
# {{ range $requirement := .NodePool.KarpenterRequirements }}
- key: "{{ $requirement.Key }}"
operator: "{{ $requirement.Operator }}"
values:
# {{ range $type := .NodePool.InstanceTypes }}
- "{{ $type }}"
# {{ end }}
# {{ range $value := $requirement.Values }}
- "{{ $value}}"
# {{ end }}
# {{ end }}
#{{ end }}
# other configuration
- key: "karpenter.sh/capacity-type"
operator: In
values:
Expand Down
2 changes: 2 additions & 0 deletions cluster/node-pools/worker-splitaz/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Resources:
VPCZoneIdentifier:
- "{{ index $data.Values.subnets $az }}"
Type: 'AWS::AutoScaling::AutoScalingGroup'
# {{ if eq $data.Cluster.ConfigItems.kube_node_ready_enabled "true" }}
AutoscalingLifecycleHook{{$azID}}:
Properties:
AutoScalingGroupName: !Ref AutoScalingGroup{{$azID}}
Expand All @@ -133,6 +134,7 @@ Resources:
HeartbeatTimeout: '600'
LifecycleTransition: 'autoscaling:EC2_INSTANCE_LAUNCHING'
Type: 'AWS::AutoScaling::LifecycleHook'
# {{ end }}
{{ end }}
{{ end }}
{{ end }}
Expand Down