apiVersion: apps/v1
kind: Deployment
metadata:
    name: server-deployment
spec:
    replicas: 1
    selector:
        matchLabels:
            component: transportation-server
    template:
        metadata:
            labels:
                component: transportation-server
        spec:
            containers:
                - name: transportation
                  image: bananaforscale/transportation
                  imagePullPolicy: Never
                  ports:
                      - containerPort: 8080
                  env:
                      - name: DATASOURCE_HOST
                        value: postgres-cluster-ip-service
                      - name: DATASOURCE_PORT
                        value: '5432'
                      - name: DATASOURCE_DATABASE
                        value: mydb
                      - name: DATASOURCE_USER
                        valueFrom: 
                            secretKeyRef:
                                name: postgres-secret
                                key: username
                      - name: DATASOURCE_PASSWORD
                        valueFrom: 
                            secretKeyRef:
                                name: postgres-secret
                                key: password

