---
title: Couchbase Pod Templating
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbase/docs-operator/edit/release/2.9/modules/ROOT/pages/concept-pod-templating.adoc
  xref: xref:operator::concept-pod-templating.adoc[]
---

[Consult the llms.txt file for a full list of contents](/llms.txt)
[View original HTML](/operator/current/concept-pod-templating.html)

# Couchbase Pod Templating

> The Kubernetes Operator allows users to define a pod template to use when creating pods for a Couchbase Server class. Modifying pod metadata such as labels and annotations will update the pod in-place. Any other modification will result in a cluster upgrade in order to fulfill the request. The Operator reserves the right to modify or replace any field. 

## [](#operators-attribute-modifications)Operators Attribute Modifications

Some of the attributes in the pod template are overridden by the Kubernetes Operator. The following attributes are overridden:

### [](#metadata)Metadata

* `metadata.name` \- The name of the pod is overridden by the Kubernetes Operator.
* `metadata.labels` \- The Kubernetes Operator adds labels to the pod to identify the pod as part of a operator managed Couchbase cluster.
* `metadata.annotaions` \- The Kubernetes Operator adds annotations to the pod to identify the pod as part of a operator managed Couchbase cluster.

### [](#spec)Spec

* `spec.containers` \- The Kubernetes Operator overrides any containers to run the Couchbase Server process and any other required containers.
* `spec.restartPolicy` \- The Kubernetes Operator overrides the restart policy to `Never`.
* `spec.hostname` \- The Kubernetes Operator overrides the hostname to the pod name.
* `spec.subdomain` \- The Kubernetes Operator overrides the subdomain to the cluster name.
* `spec.terminationGracePeriodSeconds` \- The Kubernetes Operator overrides the termination grace period to 1200 seconds.
* `spec.securityContext` \- The Kubernetes Operator overrides the security context to the security context provided in `cluster.spec.security.podSecurityContext`.
* `spec.readinessGates` \- The Kubernetes Operator overrides the readiness gates to manage the readiness of the pods.
* `spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution` \- The Kubernetes Operator adds a pod anti-affinity rule to ensure that pods are not scheduled on the same node if `cluster.spec.antiAffinity` is set to `true`.
* `spec.nodeSelector` \- The Kubernetes Operator adds a node selector to ensure that pods are scheduled on the correct Availability Zone if they are enabled for the pods server class.
* `spec.hostAliases` \- The Kubernetes Operator overrides any host aliases to map `127.0.0.1` to `localhost` the pod DNS name, unless istio mode is enabled.
* `spec.volumes` \- The Kubernetes Operator adds any required volumes to the pod.