<p>We have our eks kubernetes cluster and a ec2 instance with harbor registry. This registry has a self signed certificate, which needs to be in the worker nodes to be able to pull/push to this docker registry. The problem is that i have to autoscale my eks nodes depending on the load, but new scaled nodes must have the signed certificate to be able to contact the registry. Any ideas? Is it possible to make AMI image or are there other ways?</p>

abdel2020
<p>The above queries could be resolved in multiple ways. I will share the 2 of them here -</p>
<p>IF you are using EKS managed Nodegroup or custom nodegroup.</p>
<blockquote>
<p>If you are using AWS Managed nodegroup.</p>
</blockquote>
<p>a) On this case, please create an ami image of the node that has the registry script running, please ensure you have it running at bootup before you create the ami image.</p>
<p>b) Once you are done with the point in (a), please provision the AWS managed nodegroup to use the ami image that you created. If you are using terraform or any other infra provision tool, you can make the changes.</p>
<blockquote>
<blockquote>
<p>Custom Nodegroup - If you are using custom nodegroup</p>
</blockquote>
</blockquote>
<p>a) Create an ami image of that node.</p>
<pre><code># aws --profile $PROFILE --region $REGION ec2 create-image --instance-id ${INSTANCE_ID} --name ${INSTANCE_NAME}-image-at-${BUILD_TIMESTAMP} --description 'Snapshot of ${INSTANCE_NAME} taken at ${BUILD_TIMESTAMP}' --no-reboot --output text&quot;
</code></pre>
<p>b) Create a new Launch configuration by running the following command:</p>
<pre><code># aws autoscaling create-launch-configuration --launch-configuration-name &lt;${LAUNCH_TEMPLATE_NAME}&gt; --image-id &lt;${image-id}&gt; --instance-id &lt;${instance-id}&gt;
</code></pre>
<p>c) Update the autoscaling group</p>
<pre><code># aws --profile &lt;$PROFILE&gt; --region &lt;$REGION&gt; autoscaling update-auto-scaling-group --auto-scaling-group-name &lt;$ASG_NAME&gt; --launch-configuration-name &lt;LAUNCH_TEMPLATE_NAME&gt;&quot;
</code></pre>
<p>Incase of custom managed nodegroup, you can also set bootstrap parameters.
unlike AWS Managed nodegroup. as I write today, till date, there is no way to bootstrap argument to the managed nondegroup. it may come on the later phase but we dont have that options as of now in the time of this writing.</p>
