Skip to content
Snippets Groups Projects
Commit c0b522d3 authored by Krisztian Molnar (EPAM)'s avatar Krisztian Molnar (EPAM) Committed by Mikhail Piatliou (EPAM)
Browse files

GONRG-5020: Refactor variables to camelCase

parent 256d5739
No related branches found
No related tags found
2 merge requests!378No more retry attempts for schema not found,!347GONRG-5020: Refactor variables to camelCase
Showing
with 207 additions and 75 deletions
root = true
[*]
insert_final_newline = true
<!--- Configmap -->
# Configmap helm chart
## Introduction
This chart bootstraps a configmap deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh) package manager.
## Prerequisites
The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6)
> It is possible to use other versions, but it hasn't been tested
### Operation system
The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported.
### Packages
Packages are only needed for installation from a local computer.
* **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/)
* **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
## Installation
First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below.
### Common variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**entitlementsHost** | entitlements host | string | "http://entitlements" | yes
**indexerQueueHost** | indexer-queue host | string | "http://indexer-queue" | yes
**logLevel** | logging level | string | INFO | yes
**partitionHost** | partition host | string | "http://partition" | yes
**redisGroupHost** | redis group host | string | redis-group-master | yes
**redisSearchHost** | redis search host | string | redis-search-master | yes
**schemaHost** | schema host | string | "http://schema" | yes
**securityHttpsCertificateTrust** | whether https is enabled | boolean | true | yes
**springProfilesActive** | active spring profile | string | gcp | yes
**storageHost** | storage host | string | "http://storage" | yes
### GCP variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**googleAudiences** | your GCP client ID | string | - | yes
### Config variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**configmap** | configmap to be used | string | indexer-config | yes
**appName** | name of the app | string | indexer | yes
**onPremEnabled** | whether on-prem is enabled | boolean | false | yes
### Install the helm chart
Run this command from within this directory:
```console
helm install gcp-indexer-configmap .
```
## Uninstalling the Chart
To uninstall the helm deployment:
```console
helm uninstall gcp-indexer-configmap
```
[Move-to-Top](#configmap-helm-chart)
......@@ -2,20 +2,20 @@ apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: "{{ .Values.conf.app_name }}"
app: "{{ .Values.conf.appName }}"
name: "{{ .Values.conf.configmap }}"
namespace: "{{ .Release.Namespace }}"
data:
ENTITLEMENTS_HOST: "{{ .Values.data.entitlements_host }}"
INDEXER_QUEUE_BASE_HOST: "{{ .Values.data.indexer_queue_base_host }}"
LOG_LEVEL: "{{ .Values.data.log_level }}"
PARTITION_HOST: "{{ .Values.data.partition_host }}"
REDIS_GROUP_HOST: "{{ .Values.data.redis_group_host }}"
REDIS_SEARCH_HOST: "{{ .Values.data.redis_search_host }}"
SCHEMA_BASE_HOST: "{{ .Values.data.schema_base_host }}"
SECURITY_HTTPS_CERTIFICATE_TRUST: "{{ .Values.data.security_https_certificate_trust }}"
SPRING_PROFILES_ACTIVE: "{{ .Values.data.spring_profiles_active }}"
STORAGE_HOST: "{{ .Values.data.storage_host }}"
{{- if not .Values.conf.on_prem_enabled }}
GOOGLE_AUDIENCES: "{{ .Values.data.google_audiences }}"
ENTITLEMENTS_HOST: "{{ .Values.data.entitlementsHost }}"
INDEXER_QUEUE_BASE_HOST: "{{ .Values.data.indexerQueueHost }}"
LOG_LEVEL: "{{ .Values.data.logLevel }}"
PARTITION_HOST: "{{ .Values.data.partitionHost }}"
REDIS_GROUP_HOST: "{{ .Values.data.redisGroupHost }}"
REDIS_SEARCH_HOST: "{{ .Values.data.redisSearchHost }}"
SCHEMA_BASE_HOST: "{{ .Values.data.schemaHost }}"
SECURITY_HTTPS_CERTIFICATE_TRUST: "{{ .Values.data.securityHttpsCertificateTrust }}"
SPRING_PROFILES_ACTIVE: "{{ .Values.data.springProfilesActive }}"
STORAGE_HOST: "{{ .Values.data.storageHost }}"
{{- if not .Values.conf.onPremEnabled }}
GOOGLE_AUDIENCES: "{{ .Values.data.googleAudiences }}"
{{- end }}
......@@ -4,19 +4,19 @@
data:
# common
entitlements_host: "http://entitlements"
indexer_queue_base_host: "http://indexer-queue"
log_level: "INFO"
partition_host: "http://partition"
redis_group_host: "redis-group-master"
redis_search_host: "redis-search-master"
schema_base_host: "http://schema"
security_https_certificate_trust: "true"
spring_profiles_active: "gcp"
storage_host: "http://storage"
entitlementsHost: "http://entitlements"
indexerQueueHost: "http://indexer-queue"
logLevel: "INFO"
partitionHost: "http://partition"
redisGroupHost: "redis-group-master"
redisSearchHost: "redis-search-master"
schemaHost: "http://schema"
securityHttpsCertificateTrust: "true"
springProfilesActive: "gcp"
storageHost: "http://storage"
# gcp
google_audiences: ""
googleAudiences: ""
conf:
app_name: "indexer"
appName: "indexer"
configmap: "indexer-config"
on_prem_enabled: false
onPremEnabled: false
<!--- Deploy -->
# Deploy helm chart
## Introduction
This chart bootstraps a deployment on a [Kubernetes](https://kubernetes.io) cluster using [Helm](https://helm.sh) package manager.
## Prerequisites
The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6)
> It is possible to use other versions, but it hasn't been tested
### Operation system
The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported.
### Packages
Packages are only needed for installation from a local computer.
* **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/)
* **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
## Installation
Before installing deploy Helm chart you need to install [configmap Helm chart](../configmap).
First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below.
### Common variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**requestsCpu** | amount of requested CPU | string | 0.1 | yes
**requestsMemory** | amount of requested memory| string | 640M | yes
**limitsCpu** | CPU limit | string | 1 | yes
**limitsMemory** | memory limit | string | 1G | yes
**image** | service image | string | - | yes
**imagePullPolicy** | when to pull image | string | IfNotPresent | yes
**serviceAccountName** | name of your service account | string | indexer | yes
### Config variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
**appName** | name of the app | string | `indexer` | yes
**configmap** | configmap to be used | string | `indexer-config` | yes
**elasticSecretName** | secret for elastic | string | `indexer-elastic-secret` | yes
**keycloakSecretName** | secret for keycloak | string | `indexer-keycloak-secret` | yes
**rabbitmqSecretName** | secret for rabbitmq | string | `rabbitmq-secret` | yes
**onPremEnabled** | whether on-prem is enabled | boolean | false | yes
**domain** | your domain | string | - | yes
### Install the helm chart
Run this command from within this directory:
```console
helm install gcp-indexer-deploy .
```
## Uninstalling the Chart
To uninstall the helm deployment:
```console
helm uninstall gcp-indexer-deploy
```
[Move-to-Top](#deploy-helm-chart)
......@@ -2,35 +2,35 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: "{{ .Values.conf.app_name }}"
name: "{{ .Values.conf.app_name }}"
app: "{{ .Values.conf.appName }}"
name: "{{ .Values.conf.appName }}"
namespace: "{{ .Release.Namespace }}"
spec:
selector:
matchLabels:
app: "{{ .Values.conf.app_name }}"
app: "{{ .Values.conf.appName }}"
replicas: 1
template:
metadata:
labels:
app: "{{ .Values.conf.app_name }}"
app: "{{ .Values.conf.appName }}"
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec:
containers:
- name: "{{ .Values.conf.app_name }}"
- name: "{{ .Values.conf.appName }}"
image: "{{ .Values.data.image }}"
imagePullPolicy: "{{ .Values.data.imagePullPolicy }}"
envFrom:
- configMapRef:
name: "{{ .Values.conf.configmap }}"
- secretRef:
name: "{{ .Values.conf.elastic_secret_name }}"
{{- if .Values.conf.on_prem_enabled }}
name: "{{ .Values.conf.elasticSecretName }}"
{{- if .Values.conf.onPremEnabled }}
- secretRef:
name: "{{ .Values.conf.keycloak_secret_name }}"
name: "{{ .Values.conf.keycloakSecretName }}"
- secretRef:
name: "{{ .Values.conf.rabbitmq_secret_name }}"
name: "{{ .Values.conf.rabbitmqSecretName }}"
{{- end }}
securityContext:
allowPrivilegeEscalation: false
......@@ -39,9 +39,9 @@ spec:
- containerPort: 8080
resources:
requests:
cpu: "{{ .Values.data.requests_cpu }}"
memory: "{{ .Values.data.requests_memory }}"
cpu: "{{ .Values.data.requestsCpu }}"
memory: "{{ .Values.data.requestsMemory }}"
limits:
cpu: "{{ .Values.data.limits_cpu }}"
memory: "{{ .Values.data.limits_memory }}"
cpu: "{{ .Values.data.limitsCpu }}"
memory: "{{ .Values.data.limitsMemory }}"
serviceAccountName: "{{ .Values.data.serviceAccountName }}"
{{- if .Values.conf.on_prem_enabled }}
{{- if .Values.conf.onPremEnabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
......
apiVersion: v1
kind: Service
metadata:
{{- if not .Values.conf.on_prem_enabled }}
{{- if not .Values.conf.onPremEnabled }}
annotations:
cloud.google.com/neg: '{"ingress": true}'
{{- end }}
name: "{{ .Values.conf.app_name }}"
name: "{{ .Values.conf.appName }}"
namespace: "{{ .Release.Namespace }}"
spec:
ports:
......@@ -14,4 +14,4 @@ spec:
targetPort: 8080
name: http
selector:
app: "{{ .Values.conf.app_name }}"
app: "{{ .Values.conf.appName }}"
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: "{{ .Values.conf.app_name }}"
name: "{{ .Values.conf.appName }}"
namespace: "{{ .Release.Namespace }}"
spec:
hosts:
{{- if .Values.conf.domain }}
{{- if and .Values.conf.domain .Values.conf.onPremEnabled }}
- {{ printf "osdu.%s" .Values.conf.domain | quote }}
{{- else if .Values.conf.domain }}
- {{ .Values.conf.domain | quote }}
{{- else }}
- "*"
{{- end }}
......@@ -20,4 +22,4 @@ spec:
- destination:
port:
number: 80
host: "{{ .Values.conf.app_name }}.{{ .Release.Namespace }}.svc.cluster.local"
host: "{{ .Values.conf.appName }}.{{ .Release.Namespace }}.svc.cluster.local"
......@@ -3,18 +3,18 @@
# Declare variables to be passed into your templates.
data:
requests_cpu: "0.1"
requests_memory: "640M"
limits_cpu: "1"
limits_memory: "1G"
requestsCpu: "0.1"
requestsMemory: "640M"
limitsCpu: "1"
limitsMemory: "1G"
image: ""
imagePullPolicy: "IfNotPresent"
serviceAccountName: "indexer"
conf:
app_name: "indexer"
appName: "indexer"
configmap: "indexer-config"
elastic_secret_name: "indexer-elastic-secret"
keycloak_secret_name: "indexer-keycloak-secret"
on_prem_enabled: false
rabbitmq_secret_name: "rabbitmq-secret"
elasticSecretName: "indexer-elastic-secret"
keycloakSecretName: "indexer-keycloak-secret"
rabbitmqSecretName: "rabbitmq-secret"
onPremEnabled: false
domain: ""
FROM openjdk:8-slim
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.profiles.active=kuber","/app.jar"]
EXPOSE 8080
version: "3"
services:
os-indexer-app:
build:
args:
JAR_FILE: target/indexer-gcp-1.0.4-SNAPSHOT-spring-boot.jar
context: ..
dockerfile: docker/Dockerfile
image: gcr.io/opendes/os-indexer-app
ports:
- "8080:8080"
......@@ -3,4 +3,4 @@ service.token.provider=OPENID
partition-auth-enabled=false
openid.provider-url=
openid.provider-client-id=
openid.provider-client-secret=
\ No newline at end of file
openid.provider-client-secret=
oqmDriver=pubsub
service.token.provider=GCP
partition-auth-enabled=true
\ No newline at end of file
partition-auth-enabled=true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment