apiVersion: apps/v1
kind: Deployment
metadata:
  name: server-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      component: server
  template:
    metadata:
      labels:
        component: server
    spec:
      containers:
        - name: server
          image: reysmerwvr/multi-server
          ports:
            - containerPort: 5000
          env:
            - name: REDIS_HOST
              value: redis-cluster-ip-service
            - name: REDIS_PORT
              value: '6379'
            - name: PG_USER
              value: postgres
            - name: PG_HOST
              value: postgres-cluster-ip-service
            - name: PG_PORT
              value: '5432'
            - name: PG_DATABASE
              value: postgres
            - name: PG_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: pgpassword
                  key: PG_PASSWORD
