diff --git a/charts/evi-storage-rest-2.1.0/.helmignore b/charts/evi-storage-rest-2.1.0/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/.helmignore @@ -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/ diff --git a/charts/evi-storage-rest-2.1.0/Chart.yaml b/charts/evi-storage-rest-2.1.0/Chart.yaml new file mode 100644 index 0000000..6c86c7e --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +appVersion: 1.16.0 +description: A Helm chart for Kubernetes +name: evi-storage-rest +type: application +version: 2.1.0 diff --git a/charts/evi-storage-rest-2.1.0/templates/_helpers.tpl b/charts/evi-storage-rest-2.1.0/templates/_helpers.tpl new file mode 100644 index 0000000..07d07af --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/_helpers.tpl @@ -0,0 +1,75 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +{{/* +Expand the name of the chart. +*/}} +{{- define "storage-rest.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 "storage-rest.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 "storage-rest.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "storage-rest.labels" -}} +helm.sh/chart: {{ include "storage-rest.chart" . }} +{{ include "storage-rest.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "storage-rest.selectorLabels" -}} +app.kubernetes.io/name: {{ include "storage-rest.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "storage-rest.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "storage-rest.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/evi-storage-rest-2.1.0/templates/configmap.yaml b/charts/evi-storage-rest-2.1.0/templates/configmap.yaml new file mode 100644 index 0000000..fe0dfa9 --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/configmap.yaml @@ -0,0 +1,36 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: {{ .Values.namespace.value }} + name: {{ .Values.configMap.name }} +data: + app.config: | + GP_DATABASE = "hce" + GP_HOST = "{{ .Values.configMap.sqlDB.addr }}" + GP_PORT = "{{ .Values.configMap.sqlDB.port }}" + GP_USER = "hce" + GP_PASSWORD = "" + MIN_GP_CONN_POOL = 10 + MAX_GP_CONN_POOL = 100 + hadoop.config: | + [HDFS] + nnPod0 = "{{ .Values.configMap.hdfs.nnService }}-0" + nnPod1 = "{{ .Values.configMap.hdfs.nnService }}-1" + addr = {{ .Values.configMap.hdfs.addr }} + nnPort = {{ .Values.configMap.hdfs.port }} + user = "" + archivePath = {{ .Values.configMap.hdfs.archivePath }} + diff --git a/charts/evi-storage-rest-2.1.0/templates/deployment.yaml b/charts/evi-storage-rest-2.1.0/templates/deployment.yaml new file mode 100644 index 0000000..1ab25aa --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/deployment.yaml @@ -0,0 +1,82 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: {{ .Values.namespace.value }} + name: evi-storage-rest + labels: + version: v1 + annotations: + container.apparmor.security.beta.kubernetes.io/storage-rest: runtime/default +spec: + replicas: 1 + selector: + matchLabels: + app: storage-rest + version: v1 + template: + metadata: + labels: + app: storage-rest + sidecar.istio.io/inject: "{{ .Values.istioInjection }}" + version: v1 + spec: + nodeSelector: + feature.node.kubernetes.io/cpu-cpuid.AVX512VNNI: 'true' + feature.node.kubernetes.io/cpu-cpuid.AVX2: 'true' + securityContext: + seccompProfile: + type: RuntimeDefault + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.Version }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + #command: ["/bin/sh"] + args: ["-s", "{{ .Values.entrypoint.sleep }}", "-c", "{{ .Values.entrypoint.csvCounts }}"] + livenessProbe: + httpGet: + path: {{ .Values.liveness.path }} + port: {{ .Values.service.port }} + httpHeaders: + - name: {{ .Values.liveness.httpHeaders.name }} + value: {{ .Values.liveness.httpHeaders.value }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} + resources: + requests: + cpu: "20m" + memory: 150Mi + limits: + cpu: "1" + memory: 300Mi + ports: + - containerPort: {{ .Values.service.port }} + volumeMounts: + - name: storage-rest-secret-volume + readOnly: true + mountPath: "/home/rest_api/configure/auth" + - name: storage-rest-cm-volume + mountPath: "/home/rest_api/configure" + securityContext: + {{- toYaml .Values.securityContext | nindent 10 }} + serviceAccountName: {{ .Values.serviceAccount.name }} + volumes: + - name: storage-rest-secret-volume + secret: + secretName: {{ .Values.secret.secretName }} + - name: storage-rest-cm-volume + configMap: + name: {{ .Values.configMap.name }} diff --git a/charts/evi-storage-rest-2.1.0/templates/destinationrule.yaml b/charts/evi-storage-rest-2.1.0/templates/destinationrule.yaml new file mode 100644 index 0000000..e2a54a0 --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/destinationrule.yaml @@ -0,0 +1,26 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +{{- if .Values.namespace.istioInjection.create -}} +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + namespace: {{ .Values.namespace.value }} + name: storage-rest +spec: + host: {{ .Values.service.name }}.{{ .Values.namespace.value }}.svc.cluster.local + subsets: + - name: v1 + labels: + version: v1 +{{- end -}} diff --git a/charts/evi-storage-rest-2.1.0/templates/secret.yaml b/charts/evi-storage-rest-2.1.0/templates/secret.yaml new file mode 100644 index 0000000..725b751 --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/secret.yaml @@ -0,0 +1,22 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.secret.secretName }} + namespace: {{ .Values.namespace.value }} +type: Opaque +data: + GP_PASSWORD: {{ required "A valid secret.auth.password is required!" .Values.secret.auth.password }} + HDFS_USER: {{ required "A valid secret.auth.hdfsUser is required!" .Values.secret.auth.hdfsUser }} diff --git a/charts/evi-storage-rest-2.1.0/templates/service.yaml b/charts/evi-storage-rest-2.1.0/templates/service.yaml new file mode 100644 index 0000000..e44d69a --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/service.yaml @@ -0,0 +1,29 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +apiVersion: v1 +kind: Service +metadata: + namespace: {{ .Values.namespace.value }} + name: {{ .Values.service.name }} + labels: + app: storage-rest +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + name: http + protocol: TCP + targetPort: {{ .Values.service.targetPort }} + selector: + app: storage-rest diff --git a/charts/evi-storage-rest-2.1.0/templates/serviceaccount.yaml b/charts/evi-storage-rest-2.1.0/templates/serviceaccount.yaml new file mode 100644 index 0000000..d5972ac --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/serviceaccount.yaml @@ -0,0 +1,22 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + namespace: {{ .Values.namespace.value }} + name: {{ include "storage-rest.serviceAccountName" . }} + labels: + account: storage-rest +{{- end -}} diff --git a/charts/evi-storage-rest-2.1.0/templates/virtualservice.yaml b/charts/evi-storage-rest-2.1.0/templates/virtualservice.yaml new file mode 100644 index 0000000..2f8e47a --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/templates/virtualservice.yaml @@ -0,0 +1,31 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +{{- if .Values.namespace.istioInjection.create -}} +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + namespace: {{ .Values.namespace.value }} + name: storage-rest +spec: + hosts: + - {{ .Values.service.name }}.{{ .Values.namespace.value }}.svc.cluster.local + http: + - match: + - uri: + prefix: / + route: + - destination: + host: {{ .Values.service.name }}.{{ .Values.namespace.value }}.svc.cluster.local + subset: v1 +{{- end -}} diff --git a/charts/evi-storage-rest-2.1.0/values.yaml b/charts/evi-storage-rest-2.1.0/values.yaml new file mode 100644 index 0000000..de2978f --- /dev/null +++ b/charts/evi-storage-rest-2.1.0/values.yaml @@ -0,0 +1,84 @@ +# INTEL CONFIDENTIAL +# +# Copyright (C) 2022 Intel Corporation. +# +# This software and the related documents are Intel copyrighted materials, and your use of +# them is governed by the express license under which they were provided to you (License). +# Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, +# disclose or transmit this software or the related documents without Intel's prior written permission. +# +# This software and the related documents are provided as is, with no express or implied warranties, +# other than those that are expressly stated in the License. + +--- +# Default values for storage-rest. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +namespace: + create: false + value: storage-rest + istioInjection: + create: false + +istioInjection: true + +image: + repository: storage-rest + Version: configsExpose + pullPolicy: IfNotPresent + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "sa-storage-rest" + +service: + name: evi-storage-rest + type: ClusterIP + port: 9900 + targetPort: 9900 + +configMap: + name: "storage-rest-cm" + sqlDB: + addr: evi-postgresql.postgresql + port: 5432 + hdfs: + nnService: "evi-hbase-hadoop-hdfs-nn" + addr: "evi-hbase-hadoop-hdfs-nn.dev" + port: "9870" + archivePath: "/greenplum/vehicle_archive/" + +# livenessProbe settings for deployment +liveness: + path: "/v1/capture_source/districts" + httpHeaders: + name: Custom-Header + value: Awesome + initialDelaySeconds: 30 + periodSeconds: 60 + timeoutSeconds: 5 + +# secret settings for deployment +secret: + secretName: storage-rest-secret + auth: + # secret.auth.password (required) PostgreSQL DB user password (base64 encoded) + password: "" + # secret.auth.hdfsUser (required) HDFS user (base64 encoded) + hdfsUser: "" + +# all sudo as root to enable modification on /etc/hosts +securityContext: + readOnlyRootFilesystem: false + allowPrivilegeEscalation: true + +# settings of entrypoint.sh args +entrypoint: + sleep: 60 + csvCounts: 10