Deploying a Kubernetes application
Deploying an application on Kubernetes is fundamentally similar to deploying an application outside of Kubernetes. All applications, whether containerized or not, must consider the following configuration details:
- Networking
- Persistent storage and file mounts
- Resource allocation
- Availability and redundancy
- Runtime configuration
- Security
Configuring these details on Kubernetes is done by interacting with the Kubernetes application programming interface (API). The Kubernetes API serves as a set of endpoints that can be interacted with to view, modify, or delete different Kubernetes resources, many of which are used to configure different details of an application.
There are many different Kubernetes API resources, but the following table shows some of the most common ones:
Resource Name |
Definition |
Pod |
The smallest deployable unit in Kubernetes. Encapsulates one or more containers. |
|
Used to deploy and manage a set of Pods. Maintains the desired amount of Pod replicas (1 by default). |
|
Similar to a Deployment resource, except a StatefulSet maintains a sticky identity for each Pod replica and can also provision PersistentVolumeClaims resources (explained further down in this table) unique to each Pod. |
|
Used to load-balance between Pod replicas. |
|
Provides external access to services within the cluster. |
|
Stores application configuration to decouple configuration from code. |
|
Used to store sensitive data such as credentials and keys. Data stored in Secrets resources are only obfuscated using Base64 encoding, so administrators must ensure that proper access controls are in place. |
|
A request for storage by a user. Used to provide persistence for running Pods. |
|
Represents a set of permissions to be allowed against the Kubernetes API. |
|
Grants the permissions defined in a role to a user or set of users. |
Table 1.1 – Common Kubernetes resources
Creating resources is central to deploying and managing an application on Kubernetes, but what does a user need to do to create them? We will explore this question further in the next section.