content/operate/kubernetes/7.22/reference/yaml/basic-deployment.md
This page provides complete YAML examples for a basic Redis Enterprise deployment on Kubernetes. These examples include all the essential components you need to deploy a Redis Enterprise cluster and create a database.
For complete deployment instructions, see [Deploy on Kubernetes]({{< relref "/operate/kubernetes/7.22/deployment/quick-start" >}}).
The service account provides an identity for the Redis Enterprise operator.
{{<embed-yaml "k8s/service_account.md" "service-account.yaml">}}
Service account configuration:
name: The service account name used by the operatorlabels: Standard labels for Redis Enterprise resourcesThe Role defines the permissions needed by the Redis Enterprise operator within the namespace.
{{<embed-yaml "k8s/role.md" "role.yaml">}}
Role configuration:
name: Must match the role name referenced in the role bindingrules: Comprehensive permissions for managing Redis Enterprise resourcesapiGroups: Includes core Kubernetes APIs and Redis Enterprise custom resourcesKey permissions:
app.redislabs.com: Full access to Redis Enterprise custom resourcessecrets: Manage TLS certificates and database credentialsservices: Create and manage service endpointspods: Monitor and manage Redis Enterprise podspersistentvolumeclaims: Manage persistent storageThe RoleBinding connects the service account to the role, granting the necessary permissions.
{{<embed-yaml "k8s/role_binding.md" "role-binding.yaml">}}
Role binding configuration:
subjects.name: Must match the service account nameroleRef.name: Must match the role namenamespace: Apply in the same namespace as other resourcesThe RedisEnterpriseCluster (REC) custom resource defines the cluster specification.
{{<embed-yaml "k8s/rec.md" "redis-enterprise-cluster.yaml">}}
Cluster configuration:
metadata.name: Cluster name (cannot be changed after creation)spec.nodes: Number of Redis Enterprise nodes (minimum 3)persistentSpec.volumeSize: Storage size per noderedisEnterpriseNodeResources: CPU and memory allocation per nodeEdit the values in the downloaded YAML file based on your requirements, such as increasing the number of nodes, adjusting storage size, or modifying resource allocation.
The RedisEnterpriseDatabase (REDB) custom resource defines the database specification.
{{<embed-yaml "k8s/redb.md" "redis-enterprise-database.yaml">}}
Database configuration:
metadata.name: Database namespec.memorySize: Memory allocation for the databasespec.shardCount: Number of shards (affects performance and scalability)spec.replication: Enable/disable database replicationEdit the values in the downloaded YAML file based on your requirements, such as increasing memory for larger datasets, adding more shards for better performance, enabling replication for high availability, or adding Redis modules.
To deploy these YAML files, follow [Deploy on Kubernetes]({{< relref "/operate/kubernetes/7.22/deployment/quick-start" >}}), which provides step-by-step instructions for creating namespaces, deploying the operator, and applying these configuration files.