# Persistent Server Name Metadata When Deploying SQL Server in Kubernetes

DevFeed: [Persistent Server Name Metadata When Deploying SQL Server in Kubernetes](<https://devfeed.tech/articles/persistent-server-name-metadata-when-deploying-sql-server-in-kubernetes-17527.md>)

Original publisher: [Read original article](<https://www.nocentino.com/posts/2020-10-31-persistent-servername-when-deploying-sql-server-in-kubernetes/>)

Author: Anthony Nocentino

Published: 2020-10-31T13:52:43Z

Content type: tutorial

Language: en

Sources: [Kubernetes on Anthony Nocentino's Blog](<https://devfeed.tech/sources/kubernetes-on-anthony-nocentino-s-blog.md>)

Topics: [Kubernetes](<https://devfeed.tech/topics/kubernetes.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>), [Deployment](<https://devfeed.tech/topics/deployment.md>)

Tags: [configuration](<https://devfeed.tech/tags/configuration.md>), [containers](<https://devfeed.tech/tags/containers.md>), [kubernetes](<https://devfeed.tech/tags/kubernetes.md>), [linux](<https://devfeed.tech/tags/linux.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>)

## AI overview

This post explains how Kubernetes Pod names and hostnames are generated when SQL Server runs under a Deployment, and how the Pod hostname is used to set SQL Server server name metadata. It examines what happens to that metadata when a Pod is replaced.

## Source excerpt

In this post, we will explore how a Pod name is generated, Pod Name lifecycle, how it's used inside a Pod to set the system hostname, and how the system hostname is used by SQL Server to set its server name metadata. Pod Naming in Deployments When deploying SQL Server in Kubernetes using a Deployment, the Pod created by the Deployment Controller will have a name with a structure of <DeploymentName>-<PodTemplateHash>-<PodID> for example, mssql-deployment-8cbdc8ddd-9n7jh.