hdfs.yaml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. kind: Service
  2. apiVersion: v1
  3. metadata:
  4. name: hdfs-namenode
  5. spec:
  6. ports:
  7. - port: 9820
  8. targetPort: 9820
  9. protocol: TCP
  10. name: nm-rpc
  11. - port: 9870
  12. targetPort: 9870
  13. protocol: TCP
  14. name: nm-web-ui
  15. selector:
  16. name: hdfs-namenode-{{ .Values.hdfs.nametag }}
  17. ---
  18. kind: StatefulSet
  19. apiVersion: apps/v1beta1
  20. metadata:
  21. name: hdfs-namenode-{{ .Values.hdfs.nametag }}
  22. spec:
  23. serviceName: hdfs-namenode-{{ .Values.hdfs.nametag }}
  24. replicas: 1
  25. template:
  26. metadata:
  27. labels:
  28. name: hdfs-namenode-{{ .Values.hdfs.nametag }}
  29. spec:
  30. # initContainers:
  31. # - name: hdfs-namenode-format-{{ .Values.hdfs.nametag }}
  32. # image: kubernetes:5000/cloudera/hdfs-namenode:{{ .Values.hdfs.tag }}
  33. # imagePullPolicy: Always
  34. # command: ['bash', '-c', 'if [ ! -f /dfs/nn/current/VERSION ]; then java -Dnn.hostname=`hostname` org.apache.hadoop.hdfs.server.namenode.NameNode -format; fi']
  35. # volumeMounts:
  36. # - name: hdfs-namenode
  37. # mountPath: /dfs/nn
  38. containers:
  39. - name: hdfs-namenode-{{ .Values.hdfs.nametag }}
  40. image: {{ .Values.registry }}/hdfs-namenode:{{ .Values.hdfs.tag }}
  41. imagePullPolicy: Always
  42. ports:
  43. - containerPort: 9820
  44. protocol: TCP
  45. name: nm-rpc
  46. - containerPort: 9870
  47. protocol: TCP
  48. name: nm-web-ui
  49. # volumeMounts:
  50. # - name: hdfs-namenode
  51. # mountPath: /dfs/nn
  52. # volumes:
  53. # - name: hdfs-namenode
  54. # hostPath:
  55. # path: /tmp/dfs/nn-{{ .Values.hdfs.nametag }}
  56. ---
  57. kind: StatefulSet
  58. apiVersion: apps/v1beta1
  59. metadata:
  60. name: hdfs-datanode-{{ .Values.hdfs.nametag }}
  61. spec:
  62. serviceName: hdfs-datanode-{{ .Values.hdfs.nametag }}
  63. replicas: 1
  64. template:
  65. metadata:
  66. labels:
  67. name: hdfs-datanode-{{ .Values.hdfs.nametag }}
  68. spec:
  69. containers:
  70. - name: hdfs-datanode-{{ .Values.hdfs.nametag }}
  71. image: {{ .Values.registry }}/hdfs-datanode:{{ .Values.hdfs.tag }}
  72. imagePullPolicy: Always
  73. ports:
  74. - containerPort: 9864
  75. protocol: TCP
  76. name: dn-web-ui
  77. volumeMounts:
  78. - name: hdfs-datanode
  79. mountPath: /dfs/dn
  80. volumes:
  81. - name: hdfs-datanode
  82. hostPath:
  83. path: /tmp/dfs/dn-{{ .Values.hdfs.nametag }}