<p>We have created two machine deployments.</p>
<pre><code>kubectl get machinedeployment -A
NAMESPACE     NAME                       REPLICAS   AVAILABLE-REPLICAS   PROVIDER   OS       KUBELET   AGE
kube-system   abc                        3          3                    hetzner    ubuntu   1.24.9    116m
kube-system   vnr4jdxd6s-worker-tgl65w   1          1                    hetzner    ubuntu   1.24.9    13d
</code></pre>
<pre><code>kubectl get nodes
NAME                                        STATUS   ROLES    AGE   VERSION
abc-b6647d7cb-bcprj                         Ready    &lt;none&gt;   62m   v1.24.9
abc-b6647d7cb-llsq8                         Ready    &lt;none&gt;   65m   v1.24.9
abc-b6647d7cb-mtlsl                         Ready    &lt;none&gt;   58m   v1.24.9
vnr4jdxd6s-worker-tgl65w-59ff7fc46c-d9tm6   Ready    &lt;none&gt;   13d   v1.24.9
</code></pre>
<p>We know that we can add a label to a specific node</p>
<pre><code>kubectl label nodes abc-b6647d7cb-bcprj key=value
</code></pre>
<p>But our nodes are autoscaled.
We would like to install, for example, MariaDB Galera on specific machinedeployment node.
Is it somehow possible to annotate all nodes with a particular machinedeployments?</p>
<p>Is it somehow possible to annotate all nodes with a particular machinedeployments?</p>

portableunit
<p>To annotate all nodes with a particular machinedeployment. You can use the <a href="https://jamesdefabia.github.io/docs/user-guide/kubectl/kubectl_annotate/" rel="nofollow noreferrer">kubectl annotate</a> command to annotate all nodes in a particular machinedeployment with a specific key-value pair. For example, to annotate all nodes with a machinedeployment of nginx-deployment, you can run the following command:</p>
<pre><code>kubectl annotate nodes --all deployment=nginx-deployment key=value
</code></pre>
<p>This will annotate all nodes in the machinedeployment of nginx-deployment with the specified key-value pair.</p>
<p>For more information follow this <a href="https://www.kubermatic.com/blog/annotating-machine-deployment-for-autoscaling/" rel="nofollow noreferrer">blog by Seyi Ewegbemi</a>.</p>
