apiVersion: v1
kind: ReplicationController
metadata: 
  name: spring-controller
spec: 
  replicas: 1
  selector: 
    app: springboot
  template: 
    metadata: 
      labels: 
        app: springboot
    spec: 
      containers: 
        - 
          env: 
            - 
              name: MONGO_DB_HOSTNAME
              value: mongo
            - 
              name: MONGO_INITDB_ROOT_USERNAME
              valueFrom: 
                configMapKeyRef: 
                  key: username
                  name: springapp-configmap
            - 
              name: MONGO_INITDB_ROOT_PASSWORD
              valueFrom: 
                configMapKeyRef: 
                  key: password
                  name: springapp-configmap
          image: dockerhandson/spring-boot-mongo
          name: springboot
          ports: 
            - 
              containerPort: 8080
