A name is just a unique identifier, and all naming conventions are good; however, it is recommended to look up and identify the container image. For example:
- memcached-pod1
- haproxy.us-west
- my-project1.mysql
On the other hand, the following examples do not work because of Kubernetes restrictions:
- Memcache-pod1 (contains uppercase)
- haproxy.us_west (contains underscore)
- my-project1.mysql. (dot in the last)
Note that Kubernetes supports a label that allows assigning a key=value style identifier. It also allows duplication. Therefore, if you want to assign something like the following information, use a label instead:
- Environment (for example: staging, production)
- Version (for example: v1.2)
- Application role (for example: frontend, worker)
In addition, Kubernetes also supports names that have different Namespaces. This means that you can use the same name in different Namespaces (for example: nginx). Therefore, if you want to assign just an application name, use Namespaces instead.