Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
release hive metastore 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fcomte committed Mar 8, 2021
1 parent 5e47ced commit 9ea0a62
Show file tree
Hide file tree
Showing 9 changed files with 414 additions and 0 deletions.
31 changes: 31 additions & 0 deletions charts/hive-metastore/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: v2
name: hive-metastore
description: A hive metastore manage the metadata of persistent relational entities (e.g. databases, tables, columns, partitions) in a relational database (for fast access).
icon: https://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/Apache_Hive_logo.svg/1200px-Apache_Hive_logo.svg.png
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1
dependencies:
- name: postgres
version: 0.1.5
repository: https://inseefrlab.github.io/helm-charts-datascience
enabled: true



1 change: 1 addition & 0 deletions charts/hive-metastore/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1. Get the application URL by running these commands:
113 changes: 113 additions & 0 deletions charts/hive-metastore/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hive-metastore.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "hive-metastore.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "hive-metastore.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "hive-metastore.labels" -}}
helm.sh/chart: {{ include "hive-metastore.chart" . }}
{{ include "hive-metastore.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "hive-metastore.selectorLabels" -}}
app.kubernetes.io/name: {{ include "hive-metastore.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "hive-metastore.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "hive-metastore.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}



{{/*
Create the name of the config map S3 to use
*/}}
{{- define "hive-metastore.configMapNameS3" -}}
{{- if .Values.s3.create }}
{{- $name:= (printf "%s-configmaps3" (include "hive-metastore.fullname" .) ) }}
{{- default $name .Values.s3.configMapName }}
{{- else }}
{{- default "default" .Values.s3.configMapName }}
{{- end }}
{{- end }}

{{/*
Create the name of the config map Vault to use
*/}}
{{- define "hive-metastore.configMapNameVault" -}}
{{- if .Values.vault.create }}
{{- $name:= (printf "%s-configmapvault" (include "hive-metastore.fullname" .) ) }}
{{- default $name .Values.vault.configMapName }}
{{- else }}
{{- default "default" .Values.vault.configMapName }}
{{- end }}
{{- end }}

{{/*
Create the name of the config map Git to use
*/}}
{{- define "hive-metastore.configMapNameGit" -}}
{{- if .Values.vault.create }}
{{- $name:= (printf "%s-configmapgit" (include "hive-metastore.fullname" .) ) }}
{{- default $name .Values.git.configMapName }}
{{- else }}
{{- default "default" .Values.git.configMapName }}
{{- end }}
{{- end }}

{{/*
ingress annotations
*/}}
{{- define "hive-metastore.ingress.annotations" -}}
{{- with .Values.ingress.annotations }}
{{- toYaml . }}
{{- end }}
{{- if .Values.security.whitelist.enable }}
nginx.ingress.kubernetes.io/whitelist-source-range: {{ .Values.security.whitelist.ip }}
{{- end }}
{{- end }}
28 changes: 28 additions & 0 deletions charts/hive-metastore/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "hive-metastore.fullname" . }}
labels:
{{- include "hive-metastore.labels" . | nindent 4 }}
data:
hive-site.xml: |
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:postgresql://{{ .Release.Name }}-postgres:5432/defaultdb</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>org.postgresql.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>{{ .Values.postgres.postgresql.username }}</value>
</property>
<property>
<name> javax.jdo.option.ConnectionPassword</name>
<value>{{ .Values.postgres.postgresql.password }}</value>
</property>
</configuration>
70 changes: 70 additions & 0 deletions charts/hive-metastore/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{{- $fullName := include "hive-metastore.fullname" . -}}
{{- $volumeName := printf "%s-%s" $fullName "data" | trunc 63 | trimSuffix "-" -}}
{{- $initContainerName := printf "%s-%s" $fullName "init-data" | trunc 63 | trimSuffix "-" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hive-metastore.fullname" . }}
labels:
{{- include "hive-metastore.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "hive-metastore.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "hive-metastore.selectorLabels" . | nindent 8 }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.service.image.repository }}:{{ .Values.service.image.tag | default .Chart.AppVersion }}"
command: ["/bin/sh","-c"]
args: ["$HIVE_HOME/bin/schematool -dbType postgres -initSchema ; $HIVE_HOME/bin/hiveserver2 --service metastore"]
imagePullPolicy: {{ .Values.service.image.pullPolicy }}
ports:
- name: thrift
containerPort: 9083
protocol: TCP
readinessProbe:
tcpSocket:
port: 9083
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 9083
initialDelaySeconds: 15
periodSeconds: 20
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: hive-config
mountPath: /opt/hive/conf
volumes:
- name: hive-config
configMap:
name: {{ include "hive-metastore.fullname" . }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/hive-metastore/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.security.networkPolicy.enable -}}
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ include "hive-metastore.fullname" . }}
spec:
podSelector:
matchLabels:
{{- include "hive-metastore.selectorLabels" . | nindent 6 }}
ingress:
- from:
- podSelector: {}
policyTypes:
- Ingress
{{- end }}
18 changes: 18 additions & 0 deletions charts/hive-metastore/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "hive-metastore.fullname" . }}
labels:
{{- include "hive-metastore.labels" . | nindent 4 }}
spec:
type: {{ .Values.networking.type }}
{{- if .Values.networking.clusterIP }}
clusterIP: {{ .Values.networking.clusterIP }}
{{- end }}
ports:
- port: {{ .Values.networking.port }}
targetPort: thrift
protocol: TCP
name: thrift
selector:
{{- include "hive-metastore.selectorLabels" . | nindent 4 }}
35 changes: 35 additions & 0 deletions charts/hive-metastore/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"postgres": {
"description": "postgres specific configuration",
"type": "object",
"properties": {
"postgresql": {
"description": "postgres specific configuration",
"type": "object",
"properties": {
"username": {
"description": "Postgres user name.",
"type": "string",
"default": "admin",
"x-form": {
"value": "{{user.idep}}"
}
},
"password": {
"description": "Postgres password.",
"type": "string",
"default": "changeme",
"x-form": {
"value": "{{user.password}}"
}
}
}
}
}
}
}

}
Loading

0 comments on commit 9ea0a62

Please sign in to comment.