diff --git a/cluster/config-defaults.yaml b/cluster/config-defaults.yaml index d940dda514..57dd1ee571 100644 --- a/cluster/config-defaults.yaml +++ b/cluster/config-defaults.yaml @@ -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" diff --git a/cluster/manifests/deletions.yaml b/cluster/manifests/deletions.yaml index eaad055f02..401057c9a8 100644 --- a/cluster/manifests/deletions.yaml +++ b/cluster/manifests/deletions.yaml @@ -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 }} diff --git a/cluster/manifests/kube-node-ready/01-rbac.yaml b/cluster/manifests/kube-node-ready/01-rbac.yaml index e38976084d..e6d2d09cab 100644 --- a/cluster/manifests/kube-node-ready/01-rbac.yaml +++ b/cluster/manifests/kube-node-ready/01-rbac.yaml @@ -1,3 +1,4 @@ +# {{ if eq .Cluster.ConfigItems.kube_node_ready_enabled "true" }} apiVersion: v1 kind: ServiceAccount metadata: @@ -5,3 +6,4 @@ metadata: namespace: kube-system annotations: iam.amazonaws.com/role: "{{ .Cluster.LocalID }}-kube-node-ready" +# {{ end }} diff --git a/cluster/manifests/kube-node-ready/daemonset.yaml b/cluster/manifests/kube-node-ready/daemonset.yaml index fc7594203b..65f2e4d12b 100644 --- a/cluster/manifests/kube-node-ready/daemonset.yaml +++ b/cluster/manifests/kube-node-ready/daemonset.yaml @@ -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 }} @@ -65,3 +66,4 @@ spec: runAsUser: 1000 securityContext: fsGroup: 65534 +# {{ end }} diff --git a/cluster/manifests/kube-node-ready/service.yaml b/cluster/manifests/kube-node-ready/service.yaml index 27681e9759..5a9fb3a838 100644 --- a/cluster/manifests/kube-node-ready/service.yaml +++ b/cluster/manifests/kube-node-ready/service.yaml @@ -1,3 +1,4 @@ +# {{ if eq .Cluster.ConfigItems.kube_node_ready_enabled "true" }} kind: Service apiVersion: v1 metadata: @@ -16,3 +17,4 @@ spec: protocol: TCP selector: component: kube-node-ready +# {{ end }} diff --git a/cluster/node-pools/worker-combined/stack.yaml b/cluster/node-pools/worker-combined/stack.yaml index 632dbaf667..38a0d1e285 100644 --- a/cluster/node-pools/worker-combined/stack.yaml +++ b/cluster/node-pools/worker-combined/stack.yaml @@ -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 @@ -182,3 +183,4 @@ Resources: HeartbeatTimeout: '600' LifecycleTransition: 'autoscaling:EC2_INSTANCE_LAUNCHING' Type: 'AWS::AutoScaling::LifecycleHook' +# {{ end }} diff --git a/cluster/node-pools/worker-splitaz/stack.yaml b/cluster/node-pools/worker-splitaz/stack.yaml index 43a20bc1ce..10dafb3811 100644 --- a/cluster/node-pools/worker-splitaz/stack.yaml +++ b/cluster/node-pools/worker-splitaz/stack.yaml @@ -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}} @@ -133,6 +134,7 @@ Resources: HeartbeatTimeout: '600' LifecycleTransition: 'autoscaling:EC2_INSTANCE_LAUNCHING' Type: 'AWS::AutoScaling::LifecycleHook' +# {{ end }} {{ end }} {{ end }} {{ end }}