Hi CKADers, quick questions 1. Does anyone know the difference between these 2 f . . .

Satyam Sareen:
Hi CKADers, quick questions

  1. Does anyone know the difference between these 2 fields in a pod spec: serviceAccount and serviceAccountName and which field to set out of these 2 while adding a serviceaccount to a pod as both have the same values as far as I noticed
  2. What’s the best way to include an already running pod (ARP) when creating a deployment. What I do is I add the pod-template-hash label to the ARP, and the deployment always terminates some other pod. Is it possible that the ARP to which we just added the label may get terminated?
    Thank you!

Tej_Singh_Rana:
Hello, @Satyam Sareen
Both are the same. Only one difference is, serviceAccount is deprecated and replaced with serviceAccountName.

[email protected]:~# kubectl explain pod.spec.serviceAccount
KIND:  Pod
VERSION: v1

FIELD:  serviceAccount <string>

DESCRIPTION:
   DeprecatedServiceAccount is a depreciated alias for ServiceAccountName.
   Deprecated: Use serviceAccountName instead.

AFAIK, even if you write serviceAccount instead of serviceAccountName. It will work. But follow the latest one.

Satyam Sareen:
Great, thanks

Satyam Sareen:
Any answers for the 2nd question.