apiVersion: apps/v1
kind: Deployment
metadata:
  name: sampleapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sampleapp
  template:
    metadata:
      labels:
        app: sampleapp
        track: stable
    spec:
      containers:
        - name: sampleapp
          image: bo/sampleapp:latest
          imagePullPolicy: Never
          resources:
            limits:
              cpu: 1000m
              memory: 800Mi
            requests:
              cpu: 500m
              memory: 600Mi
          ports:
            - name: http
              containerPort: 5000
          env:
            - name: debug
              valueFrom:
                configMapKeyRef:
                  name: sampleapp-configmap
                  key: debug
            - name: host
              valueFrom:
                configMapKeyRef:
                  name: sampleapp-configmap
                  key: host
            - name: port
              valueFrom:
                configMapKeyRef:
                  name: sampleapp-configmap
                  key: port
            - name: username
              valueFrom:
                secretKeyRef:
                  name: sampleapp-secrets
                  key: username
            - name: password
              valueFrom:
                secretKeyRef:
                  name: sampleapp-secrets
                  key: password
