-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd68dd2
commit 37df5e5
Showing
24 changed files
with
937 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
set -ex | ||
|
||
# Set Hive connection details | ||
HIVE_PORT="10000" | ||
|
||
# Attempt to connect to Hive using curl | ||
curl -s -o /dev/null -w "%{http_code}" http://${HIVE_HOST_IP}:${HIVE_PORT} | ||
|
||
# Check the HTTP status code | ||
if [ $? -eq 0 ]; then | ||
echo "Hive connection successful" | ||
exit 0 | ||
else | ||
echo "Hive connection failed" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v2 | ||
name: gravitino-playground | ||
description: A Helm chart for Gravitino Playground | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "1.0.0" | ||
maintainers: | ||
- name: Your Name | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../healthcheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "gravitino-playground.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "gravitino-playground.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "gravitino-playground.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "gravitino-playground.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "gravitino-playground.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 "gravitino-playground.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 "gravitino-playground.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "gravitino-playground.labels" -}} | ||
helm.sh/chart: {{ include "gravitino-playground.chart" . }} | ||
{{ include "gravitino-playground.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "gravitino-playground.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "gravitino-playground.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "gravitino-playground.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "gravitino-playground.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.gravitino.serviceName }} | ||
namespace: {{ .Values.global.namespace }} | ||
labels: | ||
app: {{ .Values.gravitino.serviceName }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.gravitino.serviceName }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Values.gravitino.serviceName }} | ||
spec: | ||
containers: | ||
- name: gravitino | ||
image: "{{ .Values.gravitino.image.repository }}:{{ .Values.gravitino.image.tag }}" | ||
ports: | ||
- containerPort: 8090 | ||
- containerPort: 9001 | ||
command: ["/bin/bash", "/tmp/gravitino/init.sh"] | ||
env: | ||
{{- toYaml .Values.gravitino.env | nindent 12 }} | ||
volumeMounts: | ||
- name: init-script | ||
mountPath: /tmp/gravitino | ||
- name: healthcheck-script | ||
mountPath: /tmp/healthcheck | ||
readinessProbe: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- /tmp/healthcheck/gravitino-healthcheck.sh | ||
initialDelaySeconds: 10 | ||
periodSeconds: 5 | ||
failureThreshold: 3 | ||
resources: | ||
{{- toYaml .Values.gravitino.resources | nindent 12 }} | ||
volumes: | ||
- name: init-script | ||
configMap: | ||
name: gravitino-init-script | ||
defaultMode: 0755 | ||
- name: healthcheck-script | ||
configMap: | ||
name: gravitino-healthcheck-script | ||
defaultMode: 0755 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.gravitino.serviceName }} | ||
spec: | ||
selector: | ||
app: {{ .Values.gravitino.serviceName }} | ||
ports: | ||
- port: 8090 | ||
targetPort: 8090 | ||
name: api | ||
- port: 9001 | ||
targetPort: 9001 | ||
name: debug | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: gravitino-init-script | ||
data: | ||
{{- range $path, $_ := .Files.Glob "init/gravitino/*" }} | ||
{{ base $path }}: |- | ||
{{- $.Files.Get $path | nindent 4 }} | ||
{{- end }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: gravitino-healthcheck-script | ||
data: | ||
gravitino-healthcheck.sh: |- | ||
{{ .Files.Get "healthcheck/gravitino-healthcheck.sh" | indent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# templates/hive.yaml | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Values.hive.serviceName }} | ||
namespace: {{ .Values.global.namespace }} | ||
labels: | ||
app: {{ .Values.hive.serviceName }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: {{ .Values.hive.serviceName }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Values.hive.serviceName }} | ||
spec: | ||
containers: | ||
- name: hive | ||
image: "{{ .Values.hive.image.repository }}:{{ .Values.hive.image.tag }}" | ||
ports: | ||
- containerPort: 3306 | ||
- containerPort: 9000 | ||
- containerPort: 9083 | ||
- containerPort: 50070 | ||
readinessProbe: | ||
exec: | ||
command: ["/tmp/check-status.sh"] | ||
periodSeconds: 10 | ||
timeoutSeconds: 60 | ||
failureThreshold: 5 | ||
env: | ||
{{- toYaml .Values.hive.env | nindent 12 }} | ||
volumeMounts: | ||
- name: hive-init-script | ||
mountPath: /tmp/hive | ||
resources: | ||
{{- toYaml .Values.hive.resources | nindent 12 }} | ||
command: ["/bin/bash", "/tmp/hive/init.sh"] | ||
volumes: | ||
- name: hive-init-script | ||
configMap: | ||
name: hive-init-script | ||
defaultMode: 0755 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Values.hive.serviceName }} | ||
spec: | ||
selector: | ||
app: {{ .Values.hive.serviceName }} | ||
ports: | ||
- port: 3306 | ||
targetPort: 3306 | ||
name: mysql | ||
- port: 9000 | ||
targetPort: 9000 | ||
name: hdfs | ||
- port: 9083 | ||
targetPort: 9083 | ||
name: metastore | ||
- port: 50070 | ||
targetPort: 50070 | ||
name: namenode | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: hive-init-script | ||
data: | ||
{{- range $path, $_ := .Files.Glob "init/hive/*" }} | ||
{{ base $path }}: |- | ||
{{- $.Files.Get $path | nindent 4 }} | ||
{{- end }} |
Oops, something went wrong.