Skip to content

Commit 54fffe9

Browse files
committed
hive initial commit
1 parent 036ea17 commit 54fffe9

File tree

9 files changed

+236
-0
lines changed

9 files changed

+236
-0
lines changed

charts/hive/.helmignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

charts/hive/Chart.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
appVersion: 2.3.6
3+
description: The Apache Hive ™ data warehouse software facilitates reading, writing, and managing large datasets
4+
residing in distributed storage using SQL. Structure can be projected onto data already in storage. A command
5+
line tool and JDBC driver are provided to connect users to Hive.
6+
home: https://hive.apache.org/
7+
icon: https://hive.apache.org/images/hive_logo_medium.jpg
8+
maintainers:
9+
- email: cgiraldo@gradiant.org
10+
name: cgiraldo
11+
name: hive
12+
sources:
13+
- https://github.com/apache/hive
14+
- https://github.com/gradiant/charts
15+
- https://github.com/big-data-europe/docker-hive
16+
version: 0.1.0

charts/hive/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
hive
2+
====
3+
The Apache Hive ™ data warehouse software facilitates reading, writing, and managing large datasets residing in distributed storage using SQL. Structure can be projected onto data already in storage. A command line tool and JDBC driver are provided to connect users to Hive.
4+
5+
Current chart version is `0.1.0`
6+
7+
Source code can be found [here](https://github.com/gradiant/charts/charts/hive)
8+
9+
## Chart Requirements
10+
11+
| Repository | Name | Version |
12+
|------------|------|---------|
13+
| https://kubernetes-charts.storage.googleapis.com | postgresql | ~8.6.0 |
14+
15+
## Chart Values
16+
17+
| Key | Type | Default | Description |
18+
|-----|------|---------|-------------|
19+
| conf.hiveSite.hive_metastore_uris | string | `"thrift://hive-metastore:9083"` | |
20+
| image.pullPolicy | string | `"IfNotPresent"` | |
21+
| image.repository | string | `"bde2020/hive"` | |
22+
| image.tag | string | `"2.3.2-postgresql-metastore"` | |
23+
| postgresql.initdbScriptsConfigMap | string | `"hive-metastore-postgresql-init"` | |
24+
| postgresql.postgresqlDatabase | string | `"metastore"` | |
25+
| postgresql.postgresqlPassword | string | `"hive"` | |
26+
| postgresql.postgresqlUsername | string | `"hive"` | |
27+
| resources | object | `{}` | |

charts/hive/requirements.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dependencies:
2+
- name: hive-metastore
3+
alias: metastore
4+
version: ~0.1.0
5+
repository: file://../hive-metastore
6+
condition: metastore.enabled
7+
- name: hdfs
8+
version: ~0.1.0
9+
repository: file://../hdfs
10+
condition: hdfs.enabled

charts/hive/templates/_helpers.tpl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "hive.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 54 chars because some Kubernetes name fields are limited to 63 (by the DNS naming spec),
12+
as we append -datanode or -namenode to the names
13+
If release name contains chart name it will be used as a full name.
14+
*/}}
15+
{{- define "hive.fullname" -}}
16+
{{- if .Values.fullnameOverride -}}
17+
{{- .Values.fullnameOverride | trunc 54 | trimSuffix "-" -}}
18+
{{- else -}}
19+
{{- $name := default .Chart.Name .Values.nameOverride -}}
20+
{{- if contains $name .Release.Name -}}
21+
{{- .Release.Name | trunc 54 | trimSuffix "-" -}}
22+
{{- else -}}
23+
{{- printf "%s-%s" .Release.Name $name | trunc 54 | trimSuffix "-" -}}
24+
{{- end -}}
25+
{{- end -}}
26+
{{- end -}}
27+
28+
{{/*
29+
Standard Labels from Helm documentation https://helm.sh/docs/chart_best_practices/#labels-and-annotations
30+
*/}}
31+
32+
{{- define "hive.labels" -}}
33+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
34+
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
35+
app.kubernetes.io/instance: {{ .Release.Name | quote }}
36+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
37+
app.kubernetes.io/part-of: {{ .Chart.Name }}
38+
{{- end -}}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "hive.fullname" . }}
5+
labels:
6+
app.kubernetes.io/name: {{ include "hive.name" . }}
7+
{{- include "hive.labels" . | nindent 4 }}
8+
data:
9+
hive-site.xml: |
10+
<?xml version="1.0"?>
11+
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
12+
<configuration>
13+
{{- if not (index .Values.conf "hiveSite" "hive.metastore.uris") }}
14+
<property>
15+
<name>hive.metastore.uris</name>
16+
<value>{{- printf "thrift://%s-metastore" .Release.Name }}:9083</value>
17+
</property>
18+
{{- end }}
19+
{{- if index .Values.conf "hiveSite" }}
20+
{{- range $key, $value := index .Values.conf "hiveSite" }}
21+
<property><name>{{ $key }}</name><value>{{ $value }}</value></property>
22+
{{- end }}
23+
{{- end }}
24+
</configuration>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ include "hive.fullname" . }}-server
5+
labels:
6+
app.kubernetes.io/name: {{ include "hive.name" . }}
7+
app.kubernetes.io/component: server
8+
{{- include "hive.labels" . | nindent 4 }}
9+
spec:
10+
selector:
11+
matchLabels:
12+
app.kubernetes.io/name: {{ include "hive.name" . }}
13+
app.kubernetes.io/component: server
14+
{{- include "hive.labels" . | nindent 6 }}
15+
serviceName: {{ include "hive.fullname" . }}-server
16+
replicas: 1
17+
template:
18+
metadata:
19+
labels:
20+
app.kubernetes.io/name: {{ include "hive.name" . }}
21+
app.kubernetes.io/component: server
22+
{{- include "hive.labels" . | nindent 8 }}
23+
spec:
24+
containers:
25+
- name: server
26+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
27+
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
28+
resources:
29+
{{ toYaml .Values.resources | indent 10 }}
30+
env:
31+
# TODO change this to use hadoop Configmap instead of env variables
32+
- name: CORE_CONF_fs_defaultFS
33+
{{- if not (index .Values.conf "coreSite" "fs.defaultFS") }}
34+
value: hdfs://{{.Release.Name}}-hdfs-namenode:8020
35+
{{- else }}
36+
value: {{ index .Values.conf "coreSite" "fs.defaultFS" }}
37+
{{- end }}
38+
readinessProbe:
39+
httpGet:
40+
path: /
41+
port: 10002
42+
initialDelaySeconds: 5
43+
timeoutSeconds: 2
44+
livenessProbe:
45+
httpGet:
46+
path: /
47+
port: 10002
48+
initialDelaySeconds: 10
49+
timeoutSeconds: 2
50+
volumeMounts:
51+
- name: hive-config
52+
mountPath: /opt/hive/conf
53+
volumes:
54+
- name: hive-config
55+
configMap:
56+
name: {{ include "hive.fullname" . }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# A headless service to create DNS records
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ include "hive.fullname" . }}-server
6+
labels:
7+
app.kubernetes.io/name: {{ include "hive.name" . }}
8+
app.kubernetes.io/component: server
9+
{{- include "hive.labels" . | nindent 4 }}
10+
spec:
11+
ports:
12+
- name: thrift
13+
port: 10000
14+
protocol: TCP
15+
- name: ui
16+
port: 10002
17+
protocol: TCP
18+
selector:
19+
app.kubernetes.io/name: {{ include "hive.name" . }}
20+
app.kubernetes.io/component: server
21+
app.kubernetes.io/instance: {{ .Release.Name }}

charts/hive/values.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# The base hadoop image to use for all components.
2+
# See this repo for image build details: https://github.com/Comcast/kube-yarn/tree/master/image
3+
4+
5+
image:
6+
repository: bde2020/hive
7+
tag: 2.3.2-postgresql-metastore
8+
pullPolicy: IfNotPresent
9+
10+
resources: {}
11+
12+
conf:
13+
coreSite:
14+
fs.defaultFS: # default is hdfs://{{.Release.Name}}-hdfs-namenode:8020
15+
hiveSite:
16+
hive.metastore.uris: # default is "thrift://{{.Release.Name}}-metastore:9083"
17+
18+
metastore:
19+
enabled: true
20+
21+
hdfs:
22+
enabled: true
23+

0 commit comments

Comments
 (0)