apiVersion: apps/v1 #Indicate the version of Kubernetes
kind: Deployment #Type of resource 
metadata:
  name: secret #Name of the recourse
  labels:
    app: nginx
spec:
  replicas: 3 #Specify a ReplicaSet in the deployment
  selector: #Filter the pods by label. Independently the container in which they are
    matchLabels:
      app: nginx
  template: #Specify the pods in the deployment
    metadata:
      labels:
        app: nginx #Label of the pod
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
        env: #Environment variables for the pod
        - name: USERNAME #1) Environment variable configured directly in the .yaml
          value: pablo
        - name: SECRET #2) Environment variable configured from a secret
          valueFrom:
            secretKeyRef: # Indicate that it's from a secret reference
              name: secret #Name of the secret
              key: password #Each secret could have several registers. Key of the register into the secret.
