---
apiVersion: v1
kind: Service
metadata:
  labels:
    io.kompose.service: another-namenode
  name: another-namenode
spec:
  ports:
    - name: "50070"
      port: 50070
      targetPort: 50070
    - name: "8020"
      port: 8020
      targetPort: 8020
  selector:
    io.kompose.service: another-namenode

---
apiVersion: v1
kind: Service
metadata:
  labels:
    io.kompose.service: namenode
  name: namenode
spec:
  ports:
    - name: "50070"
      port: 50070
      targetPort: 50070
    - name: "8020"
      port: 8020
      targetPort: 8020
  selector:
    io.kompose.service: namenode

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: another-namenode
  name: another-namenode
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: another-namenode
  template:
    metadata:
      labels:
        io.kompose.service: another-namenode
    spec:
      containers:
        - envFrom:
            - configMapRef:
                name: hadoop-hive-namenode-env
          image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8
          name: another-namenode
          ports:
            - containerPort: 50070
              protocol: TCP
            - containerPort: 8020
              protocol: TCP
      restartPolicy: Always

---
apiVersion: v1
data:
  BAR: FOO
  FOO: BAR
kind: ConfigMap
metadata:
  labels:
    io.kompose.service: another-namenode-hadoop-hive-namenode-env
  name: hadoop-hive-namenode-env

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: namenode
  name: namenode
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: namenode
  template:
    metadata:
      labels:
        io.kompose.service: namenode
    spec:
      containers:
        - env:
            - name: CLUSTER_NAME
              value: test
          envFrom:
            - configMapRef:
                name: hadoop-hive-namenode-env
          image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8
          name: namenode
          ports:
            - containerPort: 50070
              protocol: TCP
            - containerPort: 8020
              protocol: TCP
      restartPolicy: Always

