<p>I'm trying to run a deployment of my NodeJS application in EKS with a ReplicaSet dictating that 3 pods should be run of the application. However, I'm trying to make some logic exclusive to one of the Pods, calling it the &quot;master&quot; version of the application.</p>
<p>Is it possible to either a) have a different environment like IS_MASTER passed to just that pod or to otherwise tell from within the application that it's running on the &quot;master pod&quot; without multiple deployments?</p>

Fell
<p>You can have a sticky identity for each pods using StatefulSets</p>
<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/</a></p>
<p>Quoting docs</p>
<blockquote>
<p>Like a Deployment, a StatefulSet manages Pods that are based on an identical container spec. Unlike a Deployment, a StatefulSet maintains a sticky identity for each of their Pods. These pods are created from the same spec, but are not interchangeable: each has a persistent identifier that it maintains across any rescheduling.</p>
</blockquote>
<p>Pods will have the hostnames <code>foo-{0..N-1}</code> given N replicas, you can do some sort of check for a master like if the hostname is <code>foo-0</code> then it is master.</p>
