diff --git a/deploy-as-code/helm/charts/health-services/project-factory/Chart.yaml b/deploy-as-code/helm/charts/health-services/project-factory/Chart.yaml new file mode 100644 index 000000000..02e0a801b --- /dev/null +++ b/deploy-as-code/helm/charts/health-services/project-factory/Chart.yaml @@ -0,0 +1,26 @@ +apiVersion: v2 +name: project-factory +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: 1.16.0 + +dependencies: +- name: common + version: 0.0.5 + repository: file://../../common \ No newline at end of file diff --git a/deploy-as-code/helm/charts/health-services/project-factory/templates/deployment.yaml b/deploy-as-code/helm/charts/health-services/project-factory/templates/deployment.yaml new file mode 100644 index 000000000..3455c0005 --- /dev/null +++ b/deploy-as-code/helm/charts/health-services/project-factory/templates/deployment.yaml @@ -0,0 +1,2 @@ +# deployment.yaml +{{- template "common.deployment" . -}} \ No newline at end of file diff --git a/deploy-as-code/helm/charts/health-services/project-factory/templates/ingress.yaml b/deploy-as-code/helm/charts/health-services/project-factory/templates/ingress.yaml new file mode 100644 index 000000000..9a573c0d7 --- /dev/null +++ b/deploy-as-code/helm/charts/health-services/project-factory/templates/ingress.yaml @@ -0,0 +1,2 @@ +# ingress.yaml +{{- template "common.ingress" . -}} \ No newline at end of file diff --git a/deploy-as-code/helm/charts/health-services/project-factory/templates/service.yaml b/deploy-as-code/helm/charts/health-services/project-factory/templates/service.yaml new file mode 100644 index 000000000..735644576 --- /dev/null +++ b/deploy-as-code/helm/charts/health-services/project-factory/templates/service.yaml @@ -0,0 +1,2 @@ +# service.yaml +{{- template "common.service" . -}} \ No newline at end of file diff --git a/deploy-as-code/helm/charts/health-services/project-factory/values.yaml b/deploy-as-code/helm/charts/health-services/project-factory/values.yaml new file mode 100644 index 000000000..1973ff14d --- /dev/null +++ b/deploy-as-code/helm/charts/health-services/project-factory/values.yaml @@ -0,0 +1,274 @@ +# Common Labels +labels: + app: "project-factory" + group: "rainmaker" + +namespace: health + +# Ingress Configs +ingress: + namespace: egov + enabled: true + zuul: true + context: "project-factory" + +# Init Containers Configs +initContainers: + dbMigration: + enabled: true + schemaTable: "project_factory_health_schema" + image: + repository: "project-factory-db" + +# Container Configs +image: + repository: "project-factory" +replicas: "1" + +# Additional Container Envs +env: | + - name: KAFKA_BROKER_HOST + valueFrom: + configMapKeyRef: + name: egov-config + key: kafka-brokers + - name: KAFKA_SAVE_CAMPAIGN_DETAILS_TOPIC + value: save-campaign-details + - name: KAFKA_UPDATE_CAMPAIGN_DETAILS_TOPIC + value: update-campaign-details + - name: EGOV_MDMS_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: egov-mdms-service + - name: EGOV_MDMS_V2_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: mdms-service-v2 + - name: EGOV_FILESTORE_SERVICE_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: egov-filestore + - name: EGOV_IDGEN_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: egov-idgen + - name: EGOV_FACILITY_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: facility + - name: EGOV_BOUNDARY_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: boundary-service + - name: EGOV_PROJECT_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: health-project + - name: EGOV_USER_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: egov-user + - name: EGOV_PRODUCT_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: product + - name: EGOV_HRMS_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: health-hrms + - name: EGOV_LOCALIZATION_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: egov-localization + - name: EGOV_HEALTH_INDIVIDUAL_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: health-individual + - name: EGOV_AUDIT_HOST + valueFrom: + configMapKeyRef: + name: egov-service-host + key: audit-service + - name: CONTEXT_PATH + value: "/project-factory" + - name: FILE_STORE_SERVICE_END_POINT + value: filestore/v1/files + - name: EGOV_MDMS_SEARCH_ENDPOINT + value: egov-mdms-service/v2/_search + - name: EGOV_IDGEN_PATH + value: egov-idgen/id/_generate + - name: EGOV_MDMS_SCHEMA_PATH + value: egov-mdms-service/schema/v1/_search + - name: EGOV_BOUNDARY_RELATIONSHIP_SEARCHPATH + value: boundary-service/boundary-relationships/_search + - name: EGOV_BOUNDARY_SERVICE_SEARCHPATH + value: boundary-service/boundary/_search + - name: EGOV_BOUNDARY_HIERARCHY_SEARCHPATH + value: boundary-service/boundary-hierarchy-definition/_search + - name: HEALTH_PROJECT_CREATE_PATH + value: health-project/v1/_create + - name: EGOV_PROJECT_STAFF_CREATE_PATH + value: health-project/staff/v1/_create + - name: EGOV_PROJECT_RESOURCE_CREATE_PATH + value: health-project/resource/v1/_create + - name: EGOV_PROJECT_RESOURCE_FACILITY_PATH + value: health-project/facility/v1/_create + - name: EGOV_USER_SEARCH_PATH + value: user/_search + - name: EGOV_FACILITY_SEARCH_PATH + value: facility/v1/_search + - name: EGOV_PRODUCT_VARIANT_SEARCH_PATH + value: product/variant/v1/_search + - name: EGOV_BOUNDARY_ENTITY_SEARCHPATH + value: boundary-service/boundary/_search + - name: EGOV_FACILITY_BULK_CREATE + value: facility/v1/bulk/_create + - name: EGOV_HEALTH_INDIVIDUAL_SEARCH + value: health-individual/v1/_search + - name: CMP_IDGEN_FORMAT + value: CMP-[cy:yyyy-MM-dd]-[SEQ_EG_CMP_ID] + - name: CMP_IDGEN_IDNAME + value: campaign.number + - name: EGOV_HOST + valueFrom: + configMapKeyRef: + name: egov-config + key: egov-services-fqdn-name + - name: "DB_URL" + {{- if eq .Values.namespace "health" }} + valueFrom: + configMapKeyRef: + name: egov-config + key: health-db-url + {{- else }} + valueFrom: + configMapKeyRef: + name: egov-config + key: db-url + {{- end }} + - name: "SCHEMA_TABLE" + value: {{ .Values.initContainers.dbMigration.schemaTable | quote }} + - name: "FLYWAY_USER" + valueFrom: + secretKeyRef: + name: db + key: flyway-username + - name: "FLYWAY_PASSWORD" + valueFrom: + secretKeyRef: + name: db + key: flyway-password + - name: "FLYWAY_LOCATIONS" + valueFrom: + configMapKeyRef: + name: egov-config + key: flyway-locations + - name: DB_HOST + valueFrom: + configMapKeyRef: + name: egov-config + key: db-host + - name: DB_NAME + valueFrom: + configMapKeyRef: + name: egov-config + key: db-name + - name: DB_USER + valueFrom: + secretKeyRef: + name: db + key: username + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: db + key: password + - name: DB_PORT + value: "5432" + - name: DB_SCHEMA + value: {{ .Values.namespace | default "public" }} + - name: BOUNDARY_MAIN_SHEET_NAME + value: "Boundary Data" + - name: SPLIT_BOUNDARIES_ON + value: {{ .Values.splitBoundariesOn | default "Distrito" }} + - name: SPLIT_BOUNDARIES_ON_LENGTH + value: "2" + - name: FACILITY_TAB_NAME + value: "HCM_ADMIN_CONSOLE_FACILITIES" + - name: BOUNDARY_TAB_NAME + value: "HCM_ADMIN_CONSOLE_BOUNDARY_DATA" + - name: USER_TAB_NAME + value: "HCM_ADMIN_CONSOLE_USER_LIST" + - name: LOCALE + value: {{ .Values.defaultLocale | default "en_IN" }} + - name: LOCALIZATION_MODULE + value: "rainmaker-hcm-admin-schemas" + - name: MODULE_NAME + value: "HCM-ADMIN-CONSOLE" + - name: FACILITY_SCHEMA_MASTER + value: "facilitySchema" + - name: USER_SCHEMA_MASTER + value: "userSchema" + - name: APP_LOG_LEVEL + value: {{ .Values.logLevel | default "info" }} + - name: APP_MAX_DEBUG_CHAR + value: "{{ .Values.maxDebugChar | default "500" }}" + - name: READ_ME_TAB + value: "Read Me" + - name: USER_PASSWORD_AUTO_GENERATE + value: "true" + - name: USER_DEFAULT_PASSWORD + value: "eGov@123" + - name: NOT_CREATE_USER_IF_ALREADY_THERE + value: "true" + - name: MAP_USER_VIA_COMMON_PARENT + value: "true" + + - name: CACHE_ENABLED + value: "true" + - name: RESET_CACHE + value: "true" + - name: REDIS_PORT + value: "6379" + - name: REDIS_HOST + value: "redis.backbone" + - name: ENABLE_DYNAMIC_TEMPLATE_FOR + value: "MR-DN" + - name: IS_CALL_GENERATE_WHEN_DELIVERY_CONDITIONS_DIFFER + value: "true" + - name: EXCLUDE_HIERARCHY_TYPE_FROM_BOUNDARY_CODES + value: "true" + - name: EXCLUDE_BOUNDARY_NAME_AT_LAST_FROM_BOUNDARY_CODES + value: "true" + +apiVersion: autoscaling/v2beta2 +kind: HorizontalPodAutoscaler +metadata: + name: project-factory-hpa + namespace: "health" +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: project-factory + minReplicas: 1 + maxReplicas: 5 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 \ No newline at end of file