1

The Problem

AWS EKS runs a bootstrap script that reads arguments and environment information to write a kubeconfig file before starting kubelet. I want to change a bit of the garbage collection by setting a custom eviction hard policy (as described here). According to kubernetes I can configure this in two ways:

  1. By passing the --eviction-hard flag to kubelet.
kubelet --eviction-hard memory.available<500Mi,imagefs.available<100Gi
  1. By adding an evictionHard block to the kubeconfig.
evictionHard:
  memory.available: "500Mi"
  imagefs.available: "100Gi"

1 Won't work

According to the kubelet docs this argument is deprecated. Still, I tried passing it in --kubelet-extra-args but EKS overrides it here in the boostrap script by writing an eviction policy directly to the kubeconfig.

bootstrap.sh --kubelet-extra-args '--eviction-hard memory.available<500Mi,imagefs.available<100Gi'

2 Won't work

In EKS, that bootstrap.sh script writes its own kubeconfig file. Using custom user data I can customize the way I call the bootstrap script (as seen above) but once I call it the kubeconfig is out of my hands.

The Question

Is there any way to get option 2 to work in EKS? Is there some way I can call the boostrap and apply my own customizations to the kubeconfig it creates before it starts kubelet?

rayepps
  • 2,072
  • 1
  • 12
  • 22

0 Answers0