apiVersion: apps/v1
kind: Deployment
metadata:
  name: awesome-app-deployment
  labels:
    app: awesome-app
spec:
  replicas: 3
  selector:
    matchLabels:
      component: awesome-app
  template:
    metadata:
      labels:
        component: awesome-app
    spec:
      serviceAccountName: awesome-app-sa
      containers:
        - name: awesome-app
          image: bespinian/awesome-image
          imagePullPolicy: Always
          env:
            - name: APP_TITLE
              valueFrom:
                configMapKeyRef:
                  name: awesome-config
                  key: appTitle
            - name: DB_HOST
              valueFrom:
                configMapKeyRef:
                  name: awesome-config
                  key: dbHost
            - name: APP_VERSION
              valueFrom:
                configMapKeyRef:
                  name: awesome-config
                  key: appVersion
          ports:
            - containerPort: 8080
