Commit eccd7af8 authored by Artem Dobrynin (EPAM)'s avatar Artem Dobrynin (EPAM)
Browse files

GONRG-1001: Deploy Search into Anthos Service

https://jiraeu.epam.com/browse/GONRG-1001

* Added config files for kubernetes deployment
* Added missing values into properties
parent 18c7c6d3
FROM openjdk:8-slim
WORKDIR /app
COPY ../target/search-reference-0.0.5-SNAPSHOT-spring-boot.jar search-reference.jar
# Run the web service on container startup.
CMD java -Djava.security.egd=file:/dev/./urandom -Dserver.port=8080 -jar /app/search-reference.jar
\ No newline at end of file
version: "3"
services:
os-search-app:
build:
args:
JAR_FILE: target/search-reference-0.0.5-SNAPSHOT-spring-boot.jar
context: ""
dockerfile: ../Dockerfile
image: gcr.io/osdu-anthos-02/os-search/search-reference
ports:
- "8080:8080"
apiVersion: v1
data:
MONGO_DB_URL: ${MONGO_DB_URL}
MONGO_DB_USER: ${MONGO_DB_USER}
ELASTIC_DATASTORE_KIND: ${ELASTIC_DATASTORE_KIND}
ELASTIC_DATASTORE_ID: ${ELASTIC_DATASTORE_ID}
REDIS_SEARCH_HOST: ${REDIS_SEARCH_HOST}
REDIS_SEARCH_PORT: ${REDIS_SEARCH_PORT}
REDIS_GROUP_HOST: ${REDIS_GROUP_HOST}
spring.jackson.deserialization.fail-on-unknown-properties: "true"
security.https.certificate.trust: "false"
SCHEMA_CACHE_EXPIRATION: ${SCHEMA_CACHE_EXPIRATION}
INDEX_CACHE_EXPIRATION: ${INDEX_CACHE_EXPIRATION}
ELASTIC_CACHE_EXPIRATION: ${ELASTIC_CACHE_EXPIRATION}
CURSOR_CACHE_EXPIRATION: ${CURSOR_CACHE_EXPIRATION}
KINDS_CACHE_EXPIRATION: ${KINDS_CACHE_EXPIRATION}
ATTRIBUTES_CACHE_EXPIRATION: ${ATTRIBUTES_CACHE_EXPIRATION}
KINDS_REDIS_DATABASE: ${KINDS_REDIS_DATABASE}
CRON_INDEX_CLEANUP_THRESHOLD_DAYS: ${CRON_INDEX_CLEANUP_THRESHOLD_DAYS}
CRON_EMPTY_INDEX_CLEANUP_THRESHOLD_DAYS: ${CRON_EMPTY_INDEX_CLEANUP_THRESHOLD_DAYS}
QUERY_DEFAULT_LIMIT: ${QUERY_DEFAULT_LIMIT}
QUERY_LIMIT_MAXIMUM: ${QUERY_LIMIT_MAXIMUM}
AGGREGATION_SIZE: ${AGGREGATION_SIZE}
ENVIRONMENT: ${ENVIRONMENT}
kind: ConfigMap
metadata:
labels:
app: search-reference
name: search-config
namespace: default
---
apiVersion: "apps/v1"
kind: "Deployment"
metadata:
name: "search-reference"
namespace: "default"
labels:
app: "search-reference"
spec:
selector:
matchLabels:
app: "search-reference"
template:
metadata:
labels:
app: "search-reference"
spec:
containers:
- env:
- name: MONGO_DB_URL
valueFrom:
configMapKeyRef:
key: MONGO_DB_URL
name: search-config
- name: MONGO_DB_USER
valueFrom:
configMapKeyRef:
key: MONGO_DB_USER
name: search-config
- name: ELASTIC_DATASTORE_KIND
valueFrom:
configMapKeyRef:
key: ELASTIC_DATASTORE_KIND
name: search-config
- name: ELASTIC_DATASTORE_ID
valueFrom:
configMapKeyRef:
key: ELASTIC_DATASTORE_ID
name: search-config
- name: MONGO_DB_PASSWORD
valueFrom:
secretKeyRef:
name: search-secret
key: mongo.db.password
- name: ELASTIC_HOST
valueFrom:
secretKeyRef:
name: search-secret
key: reference.elastic.host
- name: ELASTIC_PORT
valueFrom:
secretKeyRef:
name: search-secret
key: reference.elastic.port
- name: ELASTIC_USER_PASSWORD
valueFrom:
secretKeyRef:
name: search-secret
key: reference.elastic.user.password
- name: REDIS_GROUP_HOST
valueFrom:
configMapKeyRef:
key: REDIS_GROUP_HOST
name: search-config
- name: REDIS_SEARCH_HOST
valueFrom:
configMapKeyRef:
key: REDIS_SEARCH_HOST
name: search-config
- name: REDIS_SEARCH_PORT
valueFrom:
configMapKeyRef:
key: REDIS_SEARCH_PORT
name: search-config
- name: spring.jackson.deserialization.fail-on-unknown-properties
valueFrom:
configMapKeyRef:
key: spring.jackson.deserialization.fail-on-unknown-properties
name: search-config
- name: SECURITY_HTTPS_CERTIFICATE_TRUST
valueFrom:
configMapKeyRef:
key: security.https.certificate.trust
name: search-config
- name: SCHEMA_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
key: SCHEMA_CACHE_EXPIRATION
name: search-config
- name: INDEX_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
key: INDEX_CACHE_EXPIRATION
name: search-config
- name: ELASTIC_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
key: ELASTIC_CACHE_EXPIRATION
name: search-config
- name: CURSOR_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
key: CURSOR_CACHE_EXPIRATION
name: search-config
- name: KINDS_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
key: KINDS_CACHE_EXPIRATION
name: search-config
- name: ATTRIBUTES_CACHE_EXPIRATION
valueFrom:
configMapKeyRef:
key: ATTRIBUTES_CACHE_EXPIRATION
name: search-config
- name: KINDS_REDIS_DATABASE
valueFrom:
configMapKeyRef:
key: KINDS_REDIS_DATABASE
name: search-config
- name: CRON_INDEX_CLEANUP_THRESHOLD_DAYS
valueFrom:
configMapKeyRef:
key: CRON_INDEX_CLEANUP_THRESHOLD_DAYS
name: search-config
- name: CRON_EMPTY_INDEX_CLEANUP_THRESHOLD_DAYS
valueFrom:
configMapKeyRef:
key: CRON_EMPTY_INDEX_CLEANUP_THRESHOLD_DAYS
name: search-config
- name: QUERY_DEFAULT_LIMIT
valueFrom:
configMapKeyRef:
key: QUERY_DEFAULT_LIMIT
name: search-config
- name: QUERY_LIMIT_MAXIMUM
valueFrom:
configMapKeyRef:
key: QUERY_LIMIT_MAXIMUM
name: search-config
- name: AGGREGATION_SIZE
valueFrom:
configMapKeyRef:
key: AGGREGATION_SIZE
name: search-config
- name: ENVIRONMENT
valueFrom:
configMapKeyRef:
key: ENVIRONMENT
name: search-config
name: "search-reference-sha256-1"
image: "gcr.io/osdu-anthos-02/os-search/search-reference@sha256:57448c37d7716d44f32db7c17b201d685b6d1843058fd956eb22c174d0f7fcb6"
---
apiVersion: v1
kind: Service
metadata:
name: search-reference
namespace: default
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
selector:
app: search-reference
type: LoadBalancer
---
apiVersion: v1
kind: Secret
type: Opaque
data:
mongo.db.password: ${MONGO_DB_PASSWORD}
reference.elastic.user.password: ${ELASTIC_USER_PASSWORD}
reference.elastic.host: ${ELASTIC_HOST}
reference.elastic.port: ${ELASTIC_PORT}
metadata:
name: search-secret
namespace: default
steps:
# deploy container image to GKE
- name: "gcr.io/cloud-builders/gke-deploy"
args:
- run
- --filename=deployment-os-search-service.yml
- --location=us-central1-c
- --cluster=anthos-test
\ No newline at end of file
......@@ -42,4 +42,9 @@ mongo.db.url={MONGO_DB_URL}
mongo.db.user={MONGO_DB_USER}
mongo.db.password={MONGO_DB_PASSWORD}
ENVIRONMENT=dev
\ No newline at end of file
ENVIRONMENT=dev
REDIS_GROUP_HOST=${REDIS_GROUP_HOST}
REDIS_STORAGE_HOST=${REDIS_STORAGE_HOST}
REDIS_SEARCH_HOST=${REDIS_SEARCH_HOST}
REDIS_SEARCH_PORT=${REDIS_SEARCH_PORT}
\ No newline at end of file
LOG_PREFIX=search
server.servlet.contextPath=/api/search/v2/
logging.level.org.springframework.web=DEBUG
server.port=8080
JAVA_HEAP_OPTS=-Xms4096M -Xmx4096M
JAVA_GC_OPTS=-XX:+UseG1GC -XX:+UseStringDeduplication -XX:InitiatingHeapOccupancyPercent=45
spring.jackson.deserialization.fail-on-unknown-properties=true
security.https.certificate.trust=false
ELASTIC_DATASTORE_ID=search-service
ELASTIC_DATASTORE_KIND=SearchSettings
ELASTIC_HOST=${reference.elastic.host}
ELASTIC_PORT=${reference.elastic.port}
ELASTIC_USER_PASSWORD=${reference.elastic.user}:${reference.elastic.password}
#Default Cache Settings
SCHEMA_CACHE_EXPIRATION=60
INDEX_CACHE_EXPIRATION=60
ELASTIC_CACHE_EXPIRATION=1440
CURSOR_CACHE_EXPIRATION=60
# Kinds Cache expiration 2*24*60
KINDS_CACHE_EXPIRATION=2880
# Attributes Cache expiration 2*24*60
ATTRIBUTES_CACHE_EXPIRATION=2880
KINDS_REDIS_DATABASE=1
CRON_INDEX_CLEANUP_THRESHOLD_DAYS=3
CRON_EMPTY_INDEX_CLEANUP_THRESHOLD_DAYS=7
# Search query properties
QUERY_DEFAULT_LIMIT=10
QUERY_LIMIT_MAXIMUM=1000
AGGREGATION_SIZE=1000
mongo.db.url={MONGO_DB_URL}
mongo.db.user={MONGO_DB_USER}
mongo.db.password={MONGO_DB_PASSWORD}
ENVIRONMENT=dev
REDIS_GROUP_HOST=${REDIS_GROUP_HOST}
REDIS_STORAGE_HOST=${REDIS_STORAGE_HOST}
REDIS_SEARCH_HOST=${REDIS_SEARCH_HOST}
REDIS_SEARCH_PORT=${REDIS_SEARCH_PORT}
\ No newline at end of file
apiVersion: skaffold/v2beta9
kind: Config
metadata:
name: search-reference
build:
artifacts:
- image: gcr.io/osdu-anthos-02/os-search/search-reference
deploy:
kubectl:
manifests:
- kubernetes/deployments/deployment-os-search-service.yml
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment