apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: api
  template:
    metadata:
      labels:
        component: api
    spec: 
      containers:
        - name: api
          image: vipulagarwal23/books-api:1.0
          ports:
            - containerPort: 3000
          env:
            - name: HOST
              value: mariadb-cluster-ip-service
            - name: USER_NAME
              value: root
            - name: MARIA_DB
              value: books
            - name: PASSWORD
              value: changeme