How to pass environment variables to CNI Addon?

0
  • We use Terraform to automate the creation of our EKS Clusters.
  • We use the CNI aws_eks_addon to setup CNI on our EKS Nodes.
  • We need to configure various environment variables on the CNI Node (ex. WARM_IP_TARGET).
  • We strive to avoid null resources, and are looking for a way to configure these variables directly via the AWS Addon.
  • What is the best way to set these environment variables as part of our Terraform Configuration? Would you consider extending the Addon API endpoint to allow customization of these variables?
질문됨 2년 전975회 조회
1개 답변
-1

Hello there,

You can set these environment variables as part of your Terraform Configuration. To have flexibility in configuring the env of the CNI, you can set the env outside of your Terraform Configuration as well. You can also write a script that will generate all the env you want to set using the kubectl command. Use Terraform to launch the script. To set WARM_IP_TARGET to 5 for example, you can use the command below:

kubectl set env ds aws-node -n kube-system WARM_IP_TARGET=5

See more info on the CNI ENVs

AWS
Olawale
답변함 2년 전
  • Hey Olawale! Unfortunately, this isn't an answer to my question.

    You can set these environment variables as part of your Terraform Configuration.

    The Terraform resource corresponding to the CNI Daemonset is aws_eks_addon, which doesn't have any mechanism for passing/defining environment variables.

    You can also write a script that will generate all the env you want to set using the kubectl command. Use Terraform to launch the script.

    Unfortunately, this doesn't work either- Kubectl is not available in our Terraform environment (Atlantis).

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠