apiVersion: v1
kind: ReplicationController
metadata:
    name: om2m-middleware
spec:
    replicas: 1
    selector:
      app: om2m-middle-ware
    template:
      metadata:
        name: om2m-middleware
        labels:
          app: om2m-middle-ware
      spec:
        containers:
        - name: om2m-middle-ware
          image: huanphan/web_service:0.2
          ports:
          - containerPort: 9090
          - containerPort: 8081
          env:
          - name: ONEM2M_HOST_NAME
            valueFrom:
              configMapKeyRef:
                name: om2m-middleware
                key: onem2m-host-name
          - name: ONEM2M_PORT
            valueFrom:
              configMapKeyRef:
                name: om2m-middleware
                key: onem2m-port
          - name: SELF_PORT
            valueFrom:
              configMapKeyRef:
                name: om2m-middleware
                key: self-port
          - name: SELF_PROTOCOL
            valueFrom:
              configMapKeyRef:
                name: om2m-middleware
                key: self-protocol
          - name: INFLUXDB_HOST_NAME
            valueFrom:
              configMapKeyRef:
                name: om2m-middleware
                key: influxdb-host-name
          - name: INFLUXDB_PORT
            valueFrom:
              configMapKeyRef:
                name: om2m-middleware
                key: influxdb-port
