Mark As Completed Discussion

Kubernetes configuration

All of the necessary configuration to deploy a Kubernetes cluster is done with .yaml files where all the necessary information about the nodes, pods, and the cluster itself are specified.

The basic configuration should consist of a few files, but the most important ones are the Service ,Deployment, and Ingress files. The deployment file takes care of the deployment itself, the service file tells the cluster how your pods can be accessed, and the ingress file opens up the pods to be accessed externally.

Kubernetes configuration

The yaml configuration files consist of 3 main parts: metadata, specification, and status. The attributes of the specification file are different based on the type of file (Service/Deployment). The status part is automatically discovered by Kubernetes, and it is automatically filled. That information comes from the etcd.

In the following snippet we can see an example of a deployment file:

SNIPPET
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4  name: nginx-deployment
5  labels:
6    app: nginx
7spec:
8  replicas: 3
9  selector:
10    matchLabels:
11      app: nginx
12  template:
13    metadata:
14      labels:
15        app: nginx