hive-metastore

by Heva

Helm chartv0.2.0App 3.1.3Verified publisher

A Helm chart to deploy Hive Metastore

About this chart

Hive Mestastore

Deploys a Hive Metastore on Kubernetes using Hive3.

Inspired by https://github.com/Gradiant/bigdata-charts and https://github.com/ssl-hep/hive-metastore/tree/main

⚠️ This chart is currently under development. Some features have not been tested yet.

  • Getting started
  • Configuration
    • Docker image
    • Database
    • Secrets
      • Hive site
      • Database password
  • Parameters
    • Common parameters
    • Hive Parameters
    • Database Paramaters

Getting started

helm repo add heva-helm-charts https://hevaweb.github.io/heva-helm-charts/
helm install hive-metastore heva-helm-charts/hive-metastore

Configuration

See values.yaml for full list of options

Docker image

This chart has been tested with hive 3.1.3 using https://github.com/ssl-hep/hive-metastore/ image.

Database

The default behavior of this chart is to create a specific database for Hive Metastore, but it is possible to use an existing database:

postgresql:
  enabled: false

connections:
  database:
    username: hive
    password: some-password
    database: metastore
    host: my-custom.database
    port: 5432

⚠️ Please note that currently only postgresql database is accepted and the database password encryption for hive should be md5.

There are two options to do this:

  • Update postgresql configuration with
    password_encryption=md5
    
  • Or generate a specific md5 encrypted password
    • Define a user and password for hive (e.g. hive and some-password)
    • Run the following command to get the md5 encrypted password (with the concatenation of password and user)
    echo -n "md5"; echo -n "password123hive" | md5sum | awk '{print $1}'
    
    • Manually create user on postgres database with encrypted password
    CREATE USER hive WITH PASSWORD 'md5***';
    
    • Don't forget to give all necessary permissions to hive user on hive database
    CREATE DATABASE metastore OWNER hive;
    \c hive
    GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO hive;
    GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO hive;
    GRANT USAGE ON SCHEMA public TO hive;
    GRANT ALL PRIVILEGES ON DATABASE metastore TO hive;
    
    • In helm-metastore values, use explicit password password123

Secrets

Hive site

Some configuration in hive-site.xml file may contains sensistive value. It is possible to pass those information using a secret which will be converted to hivemetastore-site.xml file with value conf.hiveSiteSecret.

For example, one can create a file hivemetastore-site.xml like this:

<configuration>
    <property>
        <name>fs.s3a.access.key</name>
        <value>***</value>
    </property>
    <property>
        <name>fs.s3a.secret.key</name>
        <value>***</value>
    </property>
</configuration>

Then create a secret

kubectl create secret generic hive-config --from-file=hivemetastore-site.xml

And use it in values:

conf:
  hiveSiteSecret: hive-config

Database password

It is possible to provide database password from a secret by using extraEnvVarsSecret and conf.hiveSiteSecret.

  • This charts expect an environment variable DATABASE_PASSWORD if not explictely provided with connections.database.password.
  • It is also necessary to provide a hive site configuration with the password (using conf.hiveSiteSecret):
<property>
    <name>javax.jdo.option.ConnectionPassword</name>
    <value>***</value>
</property>

Parameters

Common parameters

NameDescriptionValue
image.repositoryDocker image repositorysslhep/hive-metastore
image.pullPolicyDocker image pull policyIfNotPresent
image.tagDocker image tag (immutable tags are recommended)3.1.3
imagePullSecretsDocker registry secret names as an array[]
nameOverrideString to partially override common.names.fullname template (will maintain the release name)""
fullnameOverrideString to fully override common.names.fullname template""
serviceAccount.createEnable creation of ServiceAccount for Airflow podstrue
serviceAccount.nameThe name of the ServiceAccount to use.""
serviceAccount.automountServiceAccountTokenAllows auto mount of ServiceAccountToken on the serviceAccount createdfalse
serviceAccount.annotationsAdditional custom annotations for the ServiceAccount{}
podAnnotationsExtra annotations for Airflow exporter pods{}
podLabelsAdd extra labels to the Airflow web pods{}
podSecurityContextHive pods' Security Context{}
securityContextHive containers' Security Context{}
service.typeHive service typeClusterIP
service.portHive service port9083
ingress.enabledEnable ingress record generation for Hivefalse
ingress.classNameClass that vill be used to implement the Ingress""
ingress.annotationsAdditional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.{}
ingress.hostsList of hosts configuration[]
ingress.tlsEnable TLS configuration for the hosts defined ingress.hosts parameter[]
resourcesSet container requests and limits for different resources like CPU or memory (essential for production workloads){}
nodeSelectorNode labels for Hive pods assignment{}
tolerationsTolerations for Hive pods assignment[]
affinityAffinity for Hive pods assignment (evaluated as a template){}
extraEnvVarsExtra environment variables passed to Hive pods""
extraEnvVarsSecretSecret with extra environment variables""
extraVolumeMountsOptionally specify extra list of additional volumeMounts for Hive pods[]
extraVolumesOptionally specify extra list of additional volumes for Hive pods[]

Hive Parameters

NameDescriptionValue
connections.database.usernameDatabase usernamehive
connections.database.passwordDatabase password. Note that one can use 'DATABASE_PASSWORD' environment variable instead.""
connections.database.databaseHive database namemetastore
connections.database.hostDatabas host{{ .Release.Name }}-postgresql
connections.database.portDatabase port5432
conf.hiveSiteSet of hive-site.xml configuration{}
conf.hiveSiteSecretName of secret containing extra hive-site configuration. Will be mounted as hivemetastore-site.xml file""
conf.hiveSiteSecretKeyKey in secret containing extra hive-site configurationhivemetastore-site.xml
objectStore.sslEnabledValue of fs.s3a.connection.ssl.enabled in hive-site.xml filefalse
objectStore.endpointValue of fs.s3a.endpoint in hive-site.xml filenil
objectStore.accessKeyIdValue of fs.s3a.access.key in hive-site.xml filenil
objectStore.secretAccessKeyValue of fs.s3a.secret.key in hive-site.xml filenil
objectStore.pathStyleValue of fs.s3a.path.style.access in hive-site.xml filetrue
objectStore.implValue of fs.s3a.impl in hive-site.xml fileorg.apache.hadoop.fs.s3a.S3AFileSystem
log.level.metaLog level of logger.meta in log4j propertiesdebug
log.level.hiveLog level of logger.hive in log4j propertiesinfo
log.level.datanucleusorgLog level of logger.datanucleusorg in log4j propertiesinfo
log.level.datanucleusLog level of logger.datanucleus in log4j propertiesinfo
log.level.rootLog level of logger.root in

Deploy hive-metastore with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has hive-metastore on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charthive-metastore is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply