# -------------------
# yaml configuration to create a deployment for the Foo server
# -------------------

apiVersion: apps/v1
# Deployment configuration
kind: Deployment

metadata:
  # the namespace is referred
  namespace: foo-bar-nspace
  name: foo-service-deployment
  labels:
    name: foo-service-deployment

spec:
  selector:
    matchLabels:
      name: foo-service
  
  # the template follows the same structure as the Pod configurations
  template:
    metadata:
      labels:
        name:  foo-service
    # container configurations. the image is pulled from the DockerHub
    spec:
      containers:
      - name: foo-service
        image: athiththan11/foo-server:1.0.0

        # resource configurations for containers
        resources:
          limits:
            memory: "128Mi"
            cpu: "125m"
        
        # port configurations
        ports:
          - containerPort: 3000
        
        # environmen var configurations
        env:
          - name: FOO_SERVER_ENV_MESSAGE
            value: A custom message set using the environment variable
