Skip to content

Commit

Permalink
Make kube-node-ready optional
Browse files Browse the repository at this point in the history
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
  • Loading branch information
mikkeloscar committed Oct 22, 2024
1 parent 9f9fcc0 commit 8fd1571
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
3 changes: 3 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
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 }}
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 }}
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

0 comments on commit 8fd1571

Please sign in to comment.