hive.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. apiVersion: v1
  2. kind: Secret
  3. metadata:
  4. name: hive-metastore-db-secrets
  5. type: Opaque
  6. data:
  7. hive-metastore-db-root-password: {{ .Values.hive.metastore_db_root_password | b64enc }}
  8. hive-metastore-db-user: {{ .Values.hive.metastore_db_user | b64enc }}
  9. hive-metastore-db-password: {{ .Values.hive.metastore_db_password | b64enc }}
  10. hive-metastore-db-name: {{ .Values.hive.metastore_db_name | b64enc }}
  11. ---
  12. apiVersion: v1
  13. kind: Service
  14. metadata:
  15. name: hive
  16. spec:
  17. selector:
  18. hadoop: hive
  19. ports:
  20. - protocol: TCP
  21. port: 3306
  22. targetPort: 3306
  23. name: a
  24. - protocol: TCP
  25. port: 9083
  26. targetPort: 9083
  27. name: b
  28. ---
  29. apiVersion: extensions/v1beta1
  30. kind: Deployment
  31. metadata:
  32. labels:
  33. hadoop: hive
  34. name: hive
  35. namespace: default
  36. spec:
  37. replicas: 1
  38. selector:
  39. matchLabels:
  40. hadoop: hive
  41. template:
  42. metadata:
  43. labels:
  44. hadoop: hive
  45. spec:
  46. restartPolicy: Always
  47. containers:
  48. - image: mysql:5.7
  49. imagePullPolicy: Always
  50. name: mysql
  51. resources: {}
  52. env:
  53. - name: MYSQL_ROOT_PASSWORD
  54. valueFrom:
  55. secretKeyRef:
  56. name: hive-metastore-db-secrets
  57. key: hive-metastore-db-root-password
  58. - name: MYSQL_USER
  59. value: metastore
  60. - name: MYSQL_PASSWORD
  61. valueFrom:
  62. secretKeyRef:
  63. name: hive-metastore-db-secrets
  64. key: hive-metastore-db-password
  65. - name: MYSQL_DATABASE
  66. valueFrom:
  67. secretKeyRef:
  68. name: hive-metastore-db-secrets
  69. key: hive-metastore-db-name
  70. - image: {{ .Values.registry }}/hive-server:{{ .Values.hive.tag }}
  71. imagePullPolicy: Always
  72. name: hive-server
  73. resources: {}
  74. command: ['bash', '-c', '/opt/hive/init.sh; hive --service metastore --hiveconf hive.root.logger=INFO,console']
  75. env:
  76. - name: MYSQL_USER
  77. valueFrom:
  78. secretKeyRef:
  79. name: hive-metastore-db-secrets
  80. key: hive-metastore-db-user
  81. - name: MYSQL_PASSWORD
  82. valueFrom:
  83. secretKeyRef:
  84. name: hive-metastore-db-secrets
  85. key: hive-metastore-db-password
  86. - name: MYSQL_DATABASE
  87. valueFrom:
  88. secretKeyRef:
  89. name: hive-metastore-db-secrets
  90. key: hive-metastore-db-name
  91. volumes:
  92. - name: hive-metastore-mysql
  93. hostPath:
  94. path: /tmp/hive-metastore-mysql2