# kubectl apply -f ./deployments/election-deployment-v1.yaml -n dev
apiVersion: apps/v1
kind: Deployment
metadata:
  name: election-v1
  namespace: dev
spec:
  replicas: 2
  strategy: {}
  selector:
    matchLabels:
      app: election
      version: v1
  template:
    metadata:
      labels:
        app: election
        version: v1
    spec:
      containers:
      - name: election-v1
        image: garystafford/spring-postgresql-demo:1.1.0
        env:
        - name: SPRING_PROFILES_ACTIVE
          value: dev
        - name: SPRING_DATASOURCE_HIKARI_MAXIMUM-POOL-SIZE
          value: '2'
        - name: SPRING_DATASOURCE_URL
          valueFrom:
            secretKeyRef:
              name: postgresql-conn-info
              key: url
        - name: SPRING_DATASOURCE_USERNAME
          valueFrom:
            secretKeyRef:
              name: postgresql-conn-info
              key: username
        - name: SPRING_DATASOURCE_PASSWORD
          valueFrom:
            secretKeyRef:
              name: postgresql-conn-info
              key: password
        ports:
        - containerPort: 8080
      restartPolicy: Always
