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: uxioandrade/tutorial-api
                    ports:
                        -   containerPort: 8080
                    env:
                        -   name: PG_HOST
                            value: postgres-cluster-ip-service
                        -   name: PG_PORT
                            value: '5432'
                        -   name: PGUSER
                            value: postgres
                        -   name: PGDATABASE
                            value: postgres