apiVersion: apps/v1
kind: Deployment
metadata:
  name: 
    sbdemo-appserver-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sbdemo-appserver
  template:
    metadata:
      labels:
        app: sbdemo-appserver
    spec:
      containers:
      - name: appserver
        image: ajeebpeter/eksdemo:appserver
        imagePullPolicy: Always
        resources:
          requests:
            cpu: 500m
            memory: 512Mi
          limits:
            cpu: 500m
            memory: 512Mi
          
        ports:
        - containerPort: 8080
        env:
          - name: SPRING_PROFILES_ACTIVE
            value: "prd"
          - name: POSTGRES_HOST
            valueFrom:
              configMapKeyRef:
                name: postgres-config-demo
                key: POSTGRES_HOST
          - name: POSTGRES_USER
            valueFrom:
              secretKeyRef:
                name: database-credentials
                key: username
          - name: POSTGRES_PASSWORD
            valueFrom:
              secretKeyRef:
                name: database-credentials
                key: password  
            #"jdbc:postgresql://sbdemo-postgres-service:5432/demodb"
            #?user=postgres&password=postgres
            #"jdbc:postgresql://apdbcluster.cluster-cr7nxqakqtei.us-east-2.rds.amazonaws.com:5432/demodb?user=octankdb&password=ajeepp11"
          - name: PIC_DIR
            value: "/opt/picDir"
          - name: REDIS_HOST
            value: "sbdemo-redis-service"
          - name: REDIS_PORT
            value: "6379"