Applications often require external configuration and a place to store data that outlives a single container instance. While Deployments and Pods are effective for managing application logic, they do not inherently solve the problems of handling configuration files, credentials, or persistent data.
This chapter introduces the Kubernetes objects designed for these purposes. We will first address application configuration, showing how to separate it from container images. You will learn to use ConfigMaps to handle non-sensitive data and Secrets to manage sensitive information, such as a database password or an $API_KEY.
Next, we will address data persistence. The filesystem of a container is ephemeral and is lost when the container stops. To manage stateful applications, you need a way to store data in a more durable location. We will examine the Kubernetes storage architecture, specifically PersistentVolumes (PVs) and PersistentVolumeClaims (PVCs), which allow applications to request and connect to stable storage resources.
By the end of this chapter, you will be able to inject configuration into your applications and provide them with persistent storage, completing the set of skills needed to manage complex, stateful services in a Kubernetes cluster.
5.1 Managing Configuration with ConfigMaps
5.2 Handling Credentials with Secrets
5.3 Kubernetes Storage Concepts
5.4 PersistentVolumes and PersistentVolumeClaims
5.5 Attaching Volumes to Pods
5.6 Practice: Injecting Configuration and Mounting a Volume
© 2026 ApX Machine LearningEngineered with