forked from sunbird-cb/sunbird-devops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sunbird-cb#232 from thejk726/dev-4.8.20
Dev 4.8.20 Service added: cb-discussion-service
- Loading branch information
Showing
8 changed files
with
271 additions
and
2 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
5 changes: 5 additions & 0 deletions
5
kubernetes/helm_charts/igot-deploy/cb-discussion-service/Chart.yaml
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,5 @@ | ||
apiVersion: v1 | ||
appVersion: "1.0" | ||
description: A Helm chart for Kubernetes | ||
name: cb-discussion-service | ||
version: 0.1.0 |
43 changes: 43 additions & 0 deletions
43
kubernetes/helm_charts/igot-deploy/cb-discussion-service/files/ansible_vars.yaml
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,43 @@ | ||
--- | ||
# vars file for deploy-lex-core-service | ||
|
||
# For script | ||
release_name: "{{ network_alias_cb_discussion_service }}" | ||
template_compose_file_name: cb-discussion-service.j2 | ||
template_env_file_name: cb-discussion-service-env.j2 | ||
compose_file_name: "{{ service_cb_discussion_service }}.yml" | ||
env_file_name: "{{ service_cb_discussion_service }}.env" | ||
helm_env_file_location: "../helm_charts/igot-deploy/templates/" | ||
helm_env_file_name: "{{ helm_env_file_location }}/{{ service_cb_discussion_service }}.env" | ||
#chart_path: "../kubernetes-deploy/cb-discussion-service" | ||
|
||
env_file_deployment_location: "{{ env_files_dir }}/{{ env_file_name }}" | ||
compose_file_deployment_location: "{{ compose_files_dir }}/{{ compose_file_name }}" | ||
user_friendly_name: content validation service | ||
|
||
# For service | ||
application_port: "{{ service_cb_discussion_port }}" | ||
image_name: "{{ image_cb_discussion_service }}" | ||
tag: "{{ tags_cb_discussion_service }}" | ||
host_port: "{{ application_port }}" | ||
docker_port: "{{ application_port }}" | ||
replicas: "{{ service_replicas_cb_discussion_service }}" | ||
reserved_memory: "{{ service_mem_reserved_cb_discussion_service }}" | ||
limited_memory: "{{ service_mem_limit_cb_discussion_service }}" | ||
#limited_memory: 2048M | ||
health_check_endpoint: http://127.0.0.1:{{ docker_port }}/contentValidation/actuator/health | ||
network_alias_name: "{{ network_alias_cb_discussion_service }}" | ||
docker_service_stack_name: lms | ||
docker_service_name: "{{ service_cb_discussion_service }}" | ||
force_reload: "{{ force_reload_cb_discussion_service }}" | ||
|
||
# For application | ||
server_connection_timeout: 5000 | ||
tomcat_max_threads: 400 | ||
tomcat_min_spare_threads: 20 | ||
servlet_multipart_max_file_size: 100Mb | ||
servlet_multipart_max_request_size: 100Mb | ||
|
||
content_service_url: http://{{ network_alias_content_service }}:{{ service_content_service_port }} | ||
|
||
infosys_lex_core_ip: http://{{ network_alias_sb_cb_ext_service }}:{{ service_sb_cb_ext_port }} |
53 changes: 53 additions & 0 deletions
53
kubernetes/helm_charts/igot-deploy/cb-discussion-service/files/cb-discussion-service-env.j2
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,53 @@ | ||
server.connection-timeout=5000 | ||
server.tomcat.max-threads=2048 | ||
server.tomcat.min-spare-threads=20 | ||
server.tomcat.max-connections=15000 | ||
server.tomcat.accept-count=500 | ||
server.port={{ application_port }} | ||
|
||
#spring data jpa for postgres | ||
spring.datasource.url=jdbc:postgresql://{{ postgresql_host }}:{{ postgresql_port }}/sunbird | ||
spring.datasource.username={{postgresql_username_sunbird }} | ||
spring.datasource.password={{ postgresql_password_sunbird }} | ||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect | ||
spring.jpa.properties.hibernate.format_sql=true | ||
spring.jpa.show-sql=false | ||
# Hibernate ddl auto (create, create-drop, validate, update) | ||
spring.jpa.hibernate.ddl-auto = update | ||
|
||
spring.data.cassandra.startupTimeoutInSeconds=100000 | ||
spring.data.cassandra.contact-points={{ sunbird_cassandra_db_host }} | ||
spring.data.cassandra.port=9042 | ||
spring.data.cassandra.keyspace-name={{ keyspace_sunbird }} | ||
spring.data.cassandra.username={{ cassandra_username }} | ||
spring.data.cassandra.password={{ cassandra_password }} | ||
spring.data.cassandra.local-datacenter=DC1 | ||
|
||
cassandra.config.host={{ sunbird_cassandra_db_host }} | ||
|
||
spring.redis.host={{ kp_redis_ip }} | ||
spring.redis.port=6379 | ||
spring.redis.password= | ||
spring.redis.cacheTtl= 60000 | ||
search.result.redis.ttl=600 | ||
|
||
elasticsearch.host={{ elasticsearch_host }} | ||
elasticsearch.port={{ elasticsearch_http_port }} | ||
elasticsearch.username={{ elasticsearch_username }} | ||
elasticsearch.password={{ elasticsearch_password }} | ||
elastic.required.field.discussion.json.path=/EsFieldsmapping/discussionEsMapping.json | ||
|
||
#kafka Server | ||
spring.kafka.bootstrap.servers={{ kafka_servers_list }} | ||
#kafka properties | ||
kakfa.offset.reset.value=latest | ||
kafka.max.poll.interval.ms=15000 | ||
kafka.max.poll.records=100 | ||
kafka.auto.commit.interval.ms=10000 | ||
|
||
sso.url==https://{{ domain_name }}/auth/ | ||
sso.realm={{ keycloak_sso_realm }} | ||
sso.connection.pool.size=20 | ||
sso.enabled=true | ||
|
||
accesstoken.publickey.basepath=/keys/ |
11 changes: 11 additions & 0 deletions
11
kubernetes/helm_charts/igot-deploy/cb-discussion-service/templates/configmap.yaml
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,11 @@ | ||
--- | ||
{{- $keys := .Files.Glob "keys/*" }} | ||
{{ if $keys }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: cb-discussion-access-keys | ||
type: Opaque | ||
data: | ||
{{ (.Files.Glob "keys/*").AsSecrets | indent 2 }} | ||
{{ end }} |
81 changes: 81 additions & 0 deletions
81
kubernetes/helm_charts/igot-deploy/cb-discussion-service/templates/deployment.yaml
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,81 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Chart.Name }} | ||
namespace: {{ .Values.namespace }} | ||
annotations: | ||
reloader.stakater.com/auto: "true" | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: {{ .Values.strategy.maxsurge }} | ||
maxUnavailable: {{ .Values.strategy.maxunavailable }} | ||
selector: | ||
matchLabels: | ||
app: {{ .Chart.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Chart.Name }} | ||
spec: | ||
{{- if .Values.imagepullsecrets }} | ||
imagePullSecrets: | ||
- name: {{ .Values.imagepullsecrets }} | ||
{{- end }} | ||
volumes: | ||
# - name: {{ .Chart.Name }}-xml-config | ||
# configMap: | ||
# name: {{ .Chart.Name }}-xml-config | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}" | ||
imagePullPolicy: Always | ||
env: | ||
- name: JAVA_OPTIONS | ||
value: {{ .Values.env.javaoptions | quote }} | ||
- name: _JAVA_OPTIONS | ||
value: -Dlog4j2.formatMsgNoLookups=true | ||
envFrom: | ||
- configMapRef: | ||
name: {{ .Chart.Name }}-config | ||
resources: | ||
{{ toYaml .Values.resources | indent 10 }} | ||
ports: | ||
- containerPort: {{ .Values.network.port }} | ||
{{- if .Values.healthcheck }} | ||
livenessProbe: | ||
{{ toYaml .Values.livenessProbe | indent 10 }} | ||
readinessProbe: | ||
{{ toYaml .Values.readinessProbe | indent 10 }} | ||
{{- end }} | ||
volumeMounts: | ||
{{- $keys := .Files.Glob "keys/*" }} | ||
{{- if $keys }} | ||
- mountPath: {{ .Values.cb_discussion_backend_basepath }} | ||
name: access-keys | ||
{{- end }} | ||
volumes: | ||
{{- $keys := .Files.Glob "keys/*" }} | ||
{{- if $keys }} | ||
- name: access-keys | ||
secret: | ||
secretName: cb-discussion-access-keys | ||
{{- end }} | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ .Chart.Name }} | ||
namespace: {{ .Values.namespace }} | ||
labels: | ||
app: {{ .Chart.Name }} | ||
spec: | ||
ports: | ||
- name: http-{{ .Chart.Name }} | ||
protocol: TCP | ||
port: {{ .Values.network.targetport }} | ||
selector: | ||
app: {{ .Chart.Name }} |
31 changes: 31 additions & 0 deletions
31
kubernetes/helm_charts/igot-deploy/cb-discussion-service/templates/hpa.yaml
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,31 @@ | ||
{{- if .Values.autoscaling.enabled }} | ||
apiVersion: autoscaling/v2 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ .Chart.Name }} | ||
namespace: {{ .Values.namespace }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ .Chart.Name }} | ||
minReplicas: {{ .Values.autoscaling.minReplicas }} | ||
maxReplicas: {{ .Values.autoscaling.maxReplicas }} | ||
metrics: | ||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
{{- end }} | ||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
{{- end }} | ||
{{- end }} |
43 changes: 43 additions & 0 deletions
43
kubernetes/helm_charts/igot-deploy/cb-discussion-service/values.j2
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,43 @@ | ||
### Default variable file for cb_discussion_service ### | ||
|
||
namespace: {{ namespace }} | ||
imagepullsecrets: {{ imagepullsecrets }} | ||
dockerhub: {{ docker_hub_url }} | ||
|
||
|
||
env: | ||
javaoptions: {{cb_discussion_java_mem_limit|default('-Xmx600m')}} | ||
|
||
replicaCount: {{cb_discussion_replicacount|default(1)}} | ||
repository: {{ image_cb_discussion_service }} | ||
image_tag: {{image_tag}} | ||
resources: | ||
requests: | ||
cpu: {{cb_discussion_cpu_req|default('100m')}} | ||
memory: {{cb_discussion_mem_req|default('100Mi')}} | ||
limits: | ||
cpu: {{cb_discussion_cpu_limit|default('1')}} | ||
memory: {{cb_discussion_mem_limit|default('1024Mi')}} | ||
network: | ||
port: {{ service_cb_discussion_port }} | ||
targetport: {{ service_cb_discussion_port }} | ||
strategy: | ||
type: RollingUpdate | ||
maxsurge: {{ cb_discussion_maxsurge|default('25%') }} | ||
maxunavailable: {{ cb_discussion_maxunavailable|default('25%') }} | ||
|
||
cb_discussion_backend_basepath: {{ cb_discussion_backend_basepath | default('/keys/') }} | ||
|
||
|
||
serviceMonitor: | ||
enabled: true | ||
labels: # labels with which the prometheus choose the serviceMonitor | ||
app: prometheus-operator | ||
release: prometheus-operator | ||
|
||
autoscaling: | ||
enabled: {{ cb_discussion_service_autoscaling_enabled | default('false') }} | ||
minReplicas: {{ cb_discussion_service_autoscaling_minReplicas|default(1) }} | ||
maxReplicas: {{ cb_discussion_service_autoscaling_maxReplicas|default(2) }} | ||
targetCPUUtilizationPercentage: {{ cb_discussion_service_autoscaling_targetCPUUtilizationPercentage|default(60) }} | ||
targetMemoryUtilizationPercentage: {{ cb_discussion_service_autoscaling_targetMemoryUtilizationPercentage|default('') }} |