phase 14-15: docker build validation and helm deployment
This commit is contained in:
@@ -6,6 +6,7 @@ metadata:
|
||||
labels:
|
||||
app: hive-metastore
|
||||
app.kubernetes.io/part-of: stonks-oracle
|
||||
stonks-oracle/tier: analytics
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
@@ -15,22 +16,121 @@ spec:
|
||||
metadata:
|
||||
labels:
|
||||
app: hive-metastore
|
||||
stonks-oracle/tier: analytics
|
||||
spec:
|
||||
automountServiceAccountToken: false
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
fsGroup: 1000
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
initContainers:
|
||||
- name: hive-config-init
|
||||
image: busybox:1.36
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- |
|
||||
cat > /hive-config/core-site.xml <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<property>
|
||||
<name>fs.s3a.endpoint</name>
|
||||
<value>http://minio.minio-service.svc.cluster.local:80</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.access.key</name>
|
||||
<value>${MINIO_ACCESS_KEY}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.secret.key</name>
|
||||
<value>${MINIO_SECRET_KEY}</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.path.style.access</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.impl</name>
|
||||
<value>org.apache.hadoop.fs.s3a.S3AFileSystem</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.connection.ssl.enabled</name>
|
||||
<value>false</value>
|
||||
</property>
|
||||
</configuration>
|
||||
EOF
|
||||
cat > /hive-config/metastore-site.xml <<EOF
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<property>
|
||||
<name>metastore.thrift.uris</name>
|
||||
<value>thrift://0.0.0.0:9083</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>metastore.task.threads.always</name>
|
||||
<value>org.apache.hadoop.hive.metastore.events.EventCleanerTask</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>metastore.expression.proxy</name>
|
||||
<value>org.apache.hadoop.hive.metastore.DefaultPartitionExpressionProxy</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>javax.jdo.option.ConnectionDriverName</name>
|
||||
<value>org.apache.derby.jdbc.EmbeddedDriver</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>javax.jdo.option.ConnectionURL</name>
|
||||
<value>jdbc:derby:/opt/hive/data/metastore_db;create=true</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>metastore.warehouse.dir</name>
|
||||
<value>s3a://stonks-lakehouse/warehouse</value>
|
||||
</property>
|
||||
</configuration>
|
||||
EOF
|
||||
env:
|
||||
- name: MINIO_ACCESS_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: stonks-core-secrets
|
||||
key: MINIO_ACCESS_KEY
|
||||
- name: MINIO_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: stonks-core-secrets
|
||||
key: MINIO_SECRET_KEY
|
||||
volumeMounts:
|
||||
- name: hive-config
|
||||
mountPath: /hive-config
|
||||
containers:
|
||||
- name: hive-metastore
|
||||
image: apache/hive:4.0.0
|
||||
ports:
|
||||
- containerPort: 9083
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
env:
|
||||
- name: SERVICE_NAME
|
||||
value: metastore
|
||||
- name: DB_DRIVER
|
||||
value: derby
|
||||
- name: SERVICE_OPTS
|
||||
value: "-Djavax.jdo.option.ConnectionURL=jdbc:derby:/opt/hive/data/metastore_db;create=true"
|
||||
volumeMounts:
|
||||
- name: hive-data
|
||||
mountPath: /opt/hive/data
|
||||
- name: hive-config
|
||||
mountPath: /opt/hive/conf/core-site.xml
|
||||
subPath: core-site.xml
|
||||
- name: hive-config
|
||||
mountPath: /opt/hive/conf/metastore-site.xml
|
||||
subPath: metastore-site.xml
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
@@ -42,6 +142,8 @@ spec:
|
||||
- name: hive-data
|
||||
persistentVolumeClaim:
|
||||
claimName: hive-metastore-data
|
||||
- name: hive-config
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
Reference in New Issue
Block a user