diff --git a/ansible/roles/kong-api/defaults/main.yml b/ansible/roles/kong-api/defaults/main.yml index ba0f25f295..0bc828fa99 100644 --- a/ansible/roles/kong-api/defaults/main.yml +++ b/ansible/roles/kong-api/defaults/main.yml @@ -17137,3 +17137,21 @@ kong_apis: config.limit_by: credential - name: request-size-limiting config.allowed_payload_size: "{{ medium_request_size_limit }}" + + - name: workflowProfileApprovalRequestSearch + uris: "{{ workflow_handler_service_prefix }}/profile/approvalRequest/search" + upstream_url: "{{ workflow_handler_service_url }}/v1/workflow/profile/approvalRequest/search" + strip_uri: true + plugins: + - name: jwt + - name: cors + - "{{ statsd_pulgin }}" + - name: acl + config.whitelist: + - 'dataAccess' + - name: rate-limiting + config.policy: local + config.hour: "{{ medium_rate_limit_per_hour }}" + config.limit_by: credential + - name: request-size-limiting + config.allowed_payload_size: "{{ large_request_size_limit }}" diff --git a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env index 463de3eb97..8fe8c90257 100644 --- a/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env +++ b/ansible/roles/stack-sunbird/templates/sunbird_learner-service.env @@ -144,9 +144,9 @@ gcp_sms_gateway_provider_campaign_name={{sms_campaign_message}} gcp_sms_gateway_provider_senderid={{sms_vault_sender}} netcore_sms_gateway_provider_base_url={{netcore_smsgatewayurl}} -netcore_sms_gateway_provider_feedid="{{netcore_feedid}}" -netcore_sms_gateway_provider_username="{{netcore_username}}" -netcore_sms_gateway_provider_password="{{netcore_password}}" +netcore_sms_gateway_provider_feedid={{netcore_feedid}} +netcore_sms_gateway_provider_username={{netcore_username}} +netcore_sms_gateway_provider_password={{netcore_password}} user_read_api_v2_mandatory_fields=profileDetails.personalDetails.firstname,profileDetails.professionalDetails[0].group,profileDetails.personalDetails.mobile,profileDetails.personalDetails.primaryEmail,profileDetails.professionalDetails[0].designation user_read_api_v2_non_mandatory_fields=profileDetails.employmentDetails.employeeCode,profileDetails.personalDetails.gender,profileDetails.personalDetails.dob,profileDetails.personalDetails.domicileMedium,profileDetails.personalDetails.category,profileDetails.employmentDetails.pinCode diff --git a/kubernetes/ansible/roles/deploy-static-domain/tasks/create-config.yml b/kubernetes/ansible/roles/deploy-static-domain/tasks/create-config.yml index b45a97f6a3..e6003b7707 100644 --- a/kubernetes/ansible/roles/deploy-static-domain/tasks/create-config.yml +++ b/kubernetes/ansible/roles/deploy-static-domain/tasks/create-config.yml @@ -149,6 +149,50 @@ failed_when: - live_course_count == "0" + - name: Cornell Course Counti API + uri: + url: "https://{{ static_domain_name }}/api/cios/v1/search/content" + method: POST + headers: + accept: "*/*" + Content-Type: "application/json" + Authorization: "{{ bearer_token }}" + body: | + { + "filterCriteriaMap": {}, + "requestedFields": [ + "contentId" + ], + "facets": [ + "contentPartner.contentPartnerName" + ], + "pageNumber": 0, + "pageSize": 100, + "orderBy": "duration", + "orderDirection": "desc" + } + body_format: json + return_content: yes + register: cornell_course_count + until: cornell_course_count is not failed + retries: 10 + delay: 2 + + - name: Cornell Course Count + set_fact: + cornell_course_count: "{{ cornell_course_count.json.facets['contentPartner.contentPartnerName'][0].count }}" + failed_when: + - cornell_course_count == "0" + ignore_errors: yes + + - name: Cornell Course Count + debug: + msg: "The Cornell Course Count is {{ cornell_course_count }}" + + - name: Adding Course and Cornell Cources + set_fact: + live_course_cornell_count: "{{ live_course_count | int + cornell_course_count | int }}" + - name: course duration list set_fact: course_duration_list: "{{ live_course_output.json.hits.hits | map(attribute='_source.duration') | list }}" diff --git a/kubernetes/ansible/roles/deploy-static-domain/templates/configurations.json.j2 b/kubernetes/ansible/roles/deploy-static-domain/templates/configurations.json.j2 index 0329aa4176..3c6a5c263a 100644 --- a/kubernetes/ansible/roles/deploy-static-domain/templates/configurations.json.j2 +++ b/kubernetes/ansible/roles/deploy-static-domain/templates/configurations.json.j2 @@ -4,7 +4,7 @@ "landingPageUpdateTime": "{{ processing_time_human }}", "karmayogiOnboarded": "{{ user_count }}", "registeredMdo": "{{ organization_count }}", - "courses": "{{ live_course_count }}", + "courses": "{{ live_course_cornell_count }}", "availableContent": "{{ aggregated_course_duration }}", "monthyActiveUsers": "{{ monthly_active_user_count }}", "courseProgramCompletionCount": "{{ course_program_completion_count }}", diff --git a/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 b/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 index b1a1788d10..655cdee05b 100644 --- a/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 +++ b/kubernetes/helm_charts/core/nginx-public-ingress/values.j2 @@ -640,21 +640,6 @@ proxyconfig: |- proxy_read_timeout 300; } - location /mentorship/ { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Scheme $scheme; - proxy_connect_timeout 5; - proxy_send_timeout 60; - proxy_read_timeout 70; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Connection ""; - proxy_http_version 1.1; - proxy_set_header X-Request-ID $sb_request_id; - rewrite ^/mentorship/(.*) /$1 break; - proxy_pass http://mentoring-portal:7601; - } - location ~ /api/ratings/v1/read { # Enabling caching proxy_cache_key "$request_uri"; diff --git a/kubernetes/helm_charts/core/taxonomy/templates/hpa.yaml b/kubernetes/helm_charts/core/taxonomy/templates/hpa.yaml index 1ba4f89a8b..fd75ba3280 100644 --- a/kubernetes/helm_charts/core/taxonomy/templates/hpa.yaml +++ b/kubernetes/helm_charts/core/taxonomy/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ .Chart.Name }} @@ -16,12 +16,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} \ No newline at end of file diff --git a/kubernetes/helm_charts/igot-deploy/cb-pores-service/templates/hpa.yaml b/kubernetes/helm_charts/igot-deploy/cb-pores-service/templates/hpa.yaml new file mode 100644 index 0000000000..fd75ba3280 --- /dev/null +++ b/kubernetes/helm_charts/igot-deploy/cb-pores-service/templates/hpa.yaml @@ -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 }} \ No newline at end of file diff --git a/kubernetes/helm_charts/igot-deploy/cb-pores-service/values.j2 b/kubernetes/helm_charts/igot-deploy/cb-pores-service/values.j2 index 658985e638..c7aade44db 100644 --- a/kubernetes/helm_charts/igot-deploy/cb-pores-service/values.j2 +++ b/kubernetes/helm_charts/igot-deploy/cb-pores-service/values.j2 @@ -28,3 +28,15 @@ strategy: cb_pores_backend_basepath: {{ cb_pores_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_pores_service_autoscaling_enabled | default('false') }} + minReplicas: {{ cb_pores_service_autoscaling_minReplicas|default(1) }} + maxReplicas: {{ cb_pores_service_autoscaling_maxReplicas|default(2) }} + targetCPUUtilizationPercentage: {{ cb_pores_service_autoscaling_targetCPUUtilizationPercentage|default(60) }} + targetMemoryUtilizationPercentage: {{ cb_pores_service_autoscaling_targetMemoryUtilizationPercentage|default('') }} diff --git a/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/deployment.yaml b/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/deployment.yaml index b17921c10d..6c252c319e 100644 --- a/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/deployment.yaml +++ b/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/deployment.yaml @@ -32,6 +32,13 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}" imagePullPolicy: Always + lifecycle: + preStop: + exec: + command: + - /bin/sh + - -c + - sleep 45 env: - name: JAVA_OPTIONS value: {{ .Values.env.javaoptions | quote }} diff --git a/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/hpa.yaml b/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/hpa.yaml new file mode 100644 index 0000000000..fd75ba3280 --- /dev/null +++ b/kubernetes/helm_charts/igot-deploy/fracentity-service/templates/hpa.yaml @@ -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 }} \ No newline at end of file diff --git a/kubernetes/helm_charts/igot-deploy/fracentity-service/values.j2 b/kubernetes/helm_charts/igot-deploy/fracentity-service/values.j2 index 64a975eded..7e547cb32c 100644 --- a/kubernetes/helm_charts/igot-deploy/fracentity-service/values.j2 +++ b/kubernetes/helm_charts/igot-deploy/fracentity-service/values.j2 @@ -27,3 +27,16 @@ strategy: maxunavailable: {{ lms_maxunavailable|default('25%') }} frac_backend_basepath: {{ frac_backend_basepath | default('/keys/') }} + +serviceMonitor: + enabled: true + labels: # labels with which the prometheus choose the serviceMonitor + app: prometheus-operator + release: prometheus-operator + +autoscaling: + enabled: {{ fracentity_service_autoscaling_enabled | default('false') }} + minReplicas: {{ fracentity_service_autoscaling_minReplicas|default(1) }} + maxReplicas: {{ fracentity_service_autoscaling_maxReplicas|default(2) }} + targetCPUUtilizationPercentage: {{ fracentity_service_autoscaling_targetCPUUtilizationPercentage|default(60) }} + targetMemoryUtilizationPercentage: {{ fracentity_service_autoscaling_targetMemoryUtilizationPercentage|default('') }}