apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: web-app
  template:
    metadata:
      labels:
        app: web-app
    spec:
      containers:
        - name: api
          image: nginx:latest
          ports:
            - containerPort: 80
          env:
            - name: NGINX_VERSION
              valueFrom:
                configMapKeyRef:
                  name: web-app-config
                  key: NGINX_VERSION