From f16d2b7fb7a104d6ad77cae84d9e6219e9718fd3 Mon Sep 17 00:00:00 2001 From: Shiva Rakshith <80666319+shiva-rakshith@users.noreply.github.com> Date: Mon, 12 Jul 2021 18:28:52 +0530 Subject: [PATCH] SB-25552 - UCI Transformer Deployment (#2690) * uci transformer helm chart --- ansible/roles/stack-sunbird/defaults/main.yml | 23 + .../stack-sunbird/templates/transformer.env | 5 + .../transformer_industry_feedback.xml | 640 ++++++++++++++++++ kubernetes/helm_charts/core/content/values.j2 | 2 +- .../helm_charts/core/transformer/Chart.yaml | 5 + .../transformer/templates/deployment.yaml | 62 ++ .../core/transformer/templates/hpa.yaml | 27 + .../helm_charts/core/transformer/values.j2 | 35 + 8 files changed, 798 insertions(+), 1 deletion(-) create mode 100644 ansible/roles/stack-sunbird/templates/transformer.env create mode 100644 ansible/roles/stack-sunbird/templates/transformer_industry_feedback.xml create mode 100644 kubernetes/helm_charts/core/transformer/Chart.yaml create mode 100644 kubernetes/helm_charts/core/transformer/templates/deployment.yaml create mode 100644 kubernetes/helm_charts/core/transformer/templates/hpa.yaml create mode 100644 kubernetes/helm_charts/core/transformer/values.j2 diff --git a/ansible/roles/stack-sunbird/defaults/main.yml b/ansible/roles/stack-sunbird/defaults/main.yml index cde86f509..6ea09efea 100644 --- a/ansible/roles/stack-sunbird/defaults/main.yml +++ b/ansible/roles/stack-sunbird/defaults/main.yml @@ -273,6 +273,9 @@ service_env: outbound: - ../../../../ansible/roles/stack-sunbird/templates/outbound.env - ../../../../ansible/roles/stack-sunbird/templates/outbound_logback.xml + transformer: + - ../../../../ansible/roles/stack-sunbird/templates/transformer.env + - ../../../../ansible/roles/stack-sunbird/templates/transformer_industry_feedback.xml sunbird_portal_player_cdn_enabled: false @@ -845,6 +848,26 @@ uci_outbound_liveness_readiness: timeoutSeconds: 5 failureThreshold: 2 +uci_transformer_liveness_readiness: + healthcheck: true + readinessProbe: + httpGet: + path: /service/health + port: 8080 + initialDelaySeconds: 15 + periodSeconds: 15 + timeoutSeconds: 5 + failureThreshold: 2 + successThreshold: 1 + livenessProbe: + httpGet: + path: /service/health + port: 8080 + initialDelaySeconds: 15 + periodSeconds: 15 + timeoutSeconds: 5 + failureThreshold: 2 + adminutil__access_keyprefix: "access" adminutil__access_keystart: 0 adminutil__access_keycount: 0 diff --git a/ansible/roles/stack-sunbird/templates/transformer.env b/ansible/roles/stack-sunbird/templates/transformer.env new file mode 100644 index 000000000..6b61c94f1 --- /dev/null +++ b/ansible/roles/stack-sunbird/templates/transformer.env @@ -0,0 +1,5 @@ +campaign.url=http://uci-service:9999 + +server.port=8080 + +spring.liquibase.enabled=false \ No newline at end of file diff --git a/ansible/roles/stack-sunbird/templates/transformer_industry_feedback.xml b/ansible/roles/stack-sunbird/templates/transformer_industry_feedback.xml new file mode 100644 index 000000000..3904958a2 --- /dev/null +++ b/ansible/roles/stack-sunbird/templates/transformer_industry_feedback.xml @@ -0,0 +1,640 @@ +<?xml version="1.0" encoding="UTF-8"?> +<h:html xmlns:h="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:jr="http://openrosa.org/javarosa" xmlns:odk="http://www.opendatakit.org/xforms" xmlns:orx="http://openrosa.org/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <h:head> + <h:title>Establishment Survey - Current Hiring Requirements</h:title> + <model odk:xforms-version="1.0.0"> + <instance> + <data id="establishment_survery_v1" version="1"> + <personal_details> + <form_intro /> + </personal_details> + <personal_info> + <full_name /> + <point_of_contact /> + <mobile_number /> + <industry_location /> + <industry_type /> + <industry_sector_services /> + <industry_sector_manufacturing /> + <job_role /> + <min_qual /> + </personal_info> + <industry_strength> + <resume_ops /> + <no_emp_per /> + <no_emp_con /> + <emp_migrant /> + <emp_current_per /> + <emp_current_con /> + </industry_strength> + <hiring_requirements> + <average_hiring /> + <current_requirement_number /> + <time_frame /> + <hiring_local /> + <hiring_apprentices /> + <apprentices_number /> + <usage_rozgar /> + <reason_rozgar_usage /> + </hiring_requirements> + <meta> + <instanceID /> + </meta> + </data> + </instance> + <bind nodeset="/data/personal_details/form_intro" readonly="true()" type="string" /> + <bind nodeset="/data/personal_info/full_name" required="true()" type="string" /> + <bind nodeset="/data/personal_info/point_of_contact" required="true()" type="string" /> + <bind constraint="regex(., '^[0-9]{10}$')" jr:constraintMsg="Please enter valid mobile number." nodeset="/data/personal_info/mobile_number" required="true()" type="string" /> + <bind nodeset="/data/personal_info/industry_location" required="true()" type="string" /> + <bind nodeset="/data/personal_info/industry_type" required="true()" type="string" /> + <bind nodeset="/data/personal_info/industry_sector_services" relevant=" /data/personal_info/industry_type = 'Services'" required="true()" type="string" /> + <bind nodeset="/data/personal_info/industry_sector_manufacturing" relevant=" /data/personal_info/industry_type = 'Manufacturing'" type="string" /> + <bind nodeset="/data/personal_info/job_role" required="true()" type="string" /> + <bind nodeset="/data/personal_info/min_qual" required="true()" type="string" /> + <bind jr:constraintMsg="Required" nodeset="/data/industry_strength/resume_ops" required="true()" type="string" /> + <bind constraint="regex(., '^[0-9]{1,}$')" jr:constraintMsg="Required" nodeset="/data/industry_strength/no_emp_per" required="true()" type="string" /> + <bind constraint="regex(., '^[0-9]{1,}$')" jr:constraintMsg="Please enter a valid number" nodeset="/data/industry_strength/no_emp_con" required="true()" type="string" /> + <bind constraint="regex(., '^[0-9]{1,}$')" jr:constraintMsg="Please enter a valid number" nodeset="/data/industry_strength/emp_migrant" type="string" /> + <bind constraint="regex(., '^[0-9]{1,}$')" jr:constraintMsg="Please enter a valid number" nodeset="/data/industry_strength/emp_current_per" required="true()" type="string" /> + <bind constraint="regex(., '^[0-9]{1,}$')" jr:constraintMsg="Please enter a valid number" nodeset="/data/industry_strength/emp_current_con" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/average_hiring" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/current_requirement_number" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/time_frame" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/hiring_local" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/hiring_apprentices" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/apprentices_number" relevant=" /data/hiring_requirements/hiring_apprentices = 'Yes'" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/usage_rozgar" required="true()" type="string" /> + <bind nodeset="/data/hiring_requirements/reason_rozgar_usage" relevant=" /data/hiring_requirements/usage_rozgar = 'No'" required="true()" type="string" /> + <bind jr:preload="uid" nodeset="/data/meta/instanceID" readonly="true()" type="string" /> + </model> + </h:head> + <h:body> + <group ref="/data/personal_details"> + <label>Introduction</label> + <input ref="/data/personal_details/form_intro"> + <label>- This survey is being conducted by the Saksham Haryana team, CM Office in light of the current labour crisis being faced by establishments. + - The survey aims to understand current hiring requirements of your establishment. Results from the survey will be used only on an aggregated basis and no individual data will be further shared. + - The survey consists of 3 sections and will take approximately 5 minutes to fill</label> + </input> + </group> + <group ref="/data/personal_info"> + <label>Personal Information</label> + <input ref="/data/personal_info/full_name"> + <label>Name of establishment</label> + </input> + <input ref="/data/personal_info/point_of_contact"> + <label>Name of Point of contact</label> + </input> + <input appearance="numbers" ref="/data/personal_info/mobile_number"> + <label>Contact Number</label> + </input> + <select1 appearance="minimal" ref="/data/personal_info/industry_location"> + <label>Location of Industry</label> + <item> + <label>Ambala</label> + <value>Ambala</value> + </item> + <item> + <label>Bhiwani</label> + <value>Bhiwani</value> + </item> + <item> + <label>Charkhi Dadri</label> + <value>Charkhi Dadri</value> + </item> + <item> + <label>Faridabad</label> + <value>Faridabad</value> + </item> + <item> + <label>Fatehabad</label> + <value>Fatehabad</value> + </item> + <item> + <label>Gurugram</label> + <value>Gurugram</value> + </item> + <item> + <label>Hisar</label> + <value>Hisar</value> + </item> + <item> + <label>Jhajjar</label> + <value>Jhajjar</value> + </item> + <item> + <label>Jind</label> + <value>Jind</value> + </item> + <item> + <label>Kaithal</label> + <value>Kaithal</value> + </item> + <item> + <label>Karnal</label> + <value>Karnal</value> + </item> + <item> + <label>Kurukshetra</label> + <value>Kurukshetra</value> + </item> + <item> + <label>Mahendragarh at Narnaul</label> + <value>Mahendragarh at Narnaul</value> + </item> + <item> + <label>Nuh</label> + <value>Nuh</value> + </item> + <item> + <label>Palwal</label> + <value>Palwal</value> + </item> + <item> + <label>Panchkula</label> + <value>Panchkula</value> + </item> + <item> + <label>Panipat</label> + <value>Panipat</value> + </item> + <item> + <label>Rewari</label> + <value>Rewari</value> + </item> + <item> + <label>Rohtak</label> + <value>Rohtak</value> + </item> + <item> + <label>Sirsa</label> + <value>Sirsa</value> + </item> + <item> + <label>Sonipat</label> + <value>Sonipat</value> + </item> + <item> + <label>Yamunanagar</label> + <value>Yamunanagar</value> + </item> + </select1> + <select1 ref="/data/personal_info/industry_type"> + <label>Type of Industry</label> + <item> + <label>Manufacturing</label> + <value>Manufacturing</value> + </item> + <item> + <label>Services</label> + <value>Services</value> + </item> + <item> + <label>Construction</label> + <value>Construction</value> + </item> + </select1> + <select1 appearance="minimal" ref="/data/personal_info/industry_sector_services"> + <label>Sector of Operation</label> + <item> + <label>Retail trade</label> + <value>Retail trade</value> + </item> + <item> + <label>Land transport and transport via pipelines</label> + <value>Land transport and transport via pipelines</value> + </item> + <item> + <label>Water transport</label> + <value>Water transport</value> + </item> + <item> + <label>Air Transport</label> + <value>Air Transport</value> + </item> + <item> + <label>Warehousing and Logistics</label> + <value>Warehousing and Logistics</value> + </item> + <item> + <label>Postal and courier activities</label> + <value>Postal and courier activities</value> + </item> + <item> + <label>Hospitality</label> + <value>Hospitality</value> + </item> + <item> + <label>Food and beverage service</label> + <value>Food and beverage service</value> + </item> + <item> + <label>Publishing</label> + <value>Publishing</value> + </item> + <item> + <label>Motion picture, video and television programme production, sound recording and music publishing</label> + <value>Motion picture, video and television programme production, sound recording and music publishing</value> + </item> + <item> + <label>Broadcasting and programming</label> + <value>Broadcasting and programming</value> + </item> + <item> + <label>Telecommunications</label> + <value>Telecommunications</value> + </item> + <item> + <label>Computer programming, consultancy and related activities</label> + <value>Computer programming, consultancy and related activities</value> + </item> + <item> + <label>Information services</label> + <value>Information services</value> + </item> + <item> + <label>Financial service activities</label> + <value>Financial service activities</value> + </item> + <item> + <label>Beauty</label> + <value>Beauty</value> + </item> + <item> + <label>Real estate</label> + <value>Real estate</value> + </item> + <item> + <label>Legal and accounting activities</label> + <value>Legal and accounting activities</value> + </item> + <item> + <label>Management consultancy</label> + <value>Management consultancy</value> + </item> + <item> + <label>Architecture and engineering</label> + <value>Architecture and engineering</value> + </item> + <item> + <label>Scientific research and development</label> + <value>Scientific research and development</value> + </item> + <item> + <label>Advertising and market research</label> + <value>Advertising and market research</value> + </item> + <item> + <label>Veterinary activities</label> + <value>Veterinary activities</value> + </item> + <item> + <label>Rental and leasing</label> + <value>Rental and leasing</value> + </item> + <item> + <label>Employment activities</label> + <value>Employment activities</value> + </item> + <item> + <label>Travel agency, tour operator and other reservation service</label> + <value>Travel agency, tour operator and other reservation service</value> + </item> + <item> + <label>Security and investigation activities</label> + <value>Security and investigation activities</value> + </item> + <item> + <label>Services to buildings</label> + <value>Services to buildings</value> + </item> + <item> + <label>Sales and Operations</label> + <value>Sales and Operations</value> + </item> + <item> + <label>Public administration and defence; compulsory social security</label> + <value>Public administration and defence; compulsory social security</value> + </item> + <item> + <label>Education</label> + <value>Education</value> + </item> + <item> + <label>Human health activities</label> + <value>Human health activities</value> + </item> + <item> + <label>Residential care activities</label> + <value>Residential care activities</value> + </item> + <item> + <label>Creative, arts and entertainment activities</label> + <value>Creative, arts and entertainment activities</value> + </item> + <item> + <label>Libraries, archives, museums and other cultural activities</label> + <value>Libraries, archives, museums and other cultural activities</value> + </item> + <item> + <label>Sports activities and amusement and recreation activities</label> + <value>Sports activities and amusement and recreation activities</value> + </item> + <item> + <label>Repair of computers and personal and household goods</label> + <value>Repair of computers and personal and household goods</value> + </item> + <item> + <label>Activites of households as employers of domestic personnel</label> + <value>Activites of households as employers of domestic personnel</value> + </item> + <item> + <label>Undifferentiated goods and services-producting activites of private households for own use</label> + <value>Undifferentiated goods and services-producting activites of private households for own use</value> + </item> + </select1> + <select1 appearance="minimal" ref="/data/personal_info/industry_sector_manufacturing"> + <label>Sector of Operation</label> + <item> + <label>Forestry and logging</label> + <value>Forestry and logging</value> + </item> + <item> + <label>Fishing and aquaculture</label> + <value>Fishing and aquaculture</value> + </item> + <item> + <label>Mining and quarring</label> + <value>Mining and quarring</value> + </item> + <item> + <label>Extraction of crude petroleum and natural gas</label> + <value>Extraction of crude petroleum and natural gas</value> + </item> + <item> + <label>Mining of metal ores</label> + <value>Mining of metal ores</value> + </item> + <item> + <label>Manufacture of food products</label> + <value>Manufacture of food products</value> + </item> + <item> + <label>Manufacture of beverages</label> + <value>Manufacture of beverages</value> + </item> + <item> + <label>Manufacture of tobacco products</label> + <value>Manufacture of tobacco products</value> + </item> + <item> + <label>Manufacture of textiles</label> + <value>Manufacture of textiles</value> + </item> + <item> + <label>Manufacture of wearing apparel</label> + <value>Manufacture of wearing apparel</value> + </item> + <item> + <label>Manufacture of leather and related products</label> + <value>Manufacture of leather and related products</value> + </item> + <item> + <label>Manufacture of wood and products of wood and cork</label> + <value>Manufacture of wood and products of wood and cork</value> + </item> + <item> + <label>Manufacture of paper and paper products</label> + <value>Manufacture of paper and paper products</value> + </item> + <item> + <label>Printing and reproduction of recorded media</label> + <value>Printing and reproduction of recorded media</value> + </item> + <item> + <label>Manufacture of coke and refined petroleum products</label> + <value>Manufacture of coke and refined petroleum products</value> + </item> + <item> + <label>Manufacture of chemicals and chemical products</label> + <value>Manufacture of chemicals and chemical products</value> + </item> + <item> + <label>Manufacture of pharmaceuticals, medicinal chemical and botanical products</label> + <value>Manufacture of pharmaceuticals, medicinal chemical and botanical products</value> + </item> + <item> + <label>Manufacture of rubber and plastics products</label> + <value>Manufacture of rubber and plastics products</value> + </item> + <item> + <label>Manufacture of other non-metallic mineral products</label> + <value>Manufacture of other non-metallic mineral products</value> + </item> + <item> + <label>Manufacture of basic metals</label> + <value>Manufacture of basic metals</value> + </item> + <item> + <label>Manufacture of fabricated metal products, except machinery and equipment</label> + <value>Manufacture of fabricated metal products, except machinery and equipment</value> + </item> + <item> + <label>Manufacture of computer, electronic and optical products</label> + <value>Manufacture of computer, electronic and optical products</value> + </item> + <item> + <label>Manufacture of electrical equipment</label> + <value>Manufacture of electrical equipment</value> + </item> + <item> + <label>Manufacture of machinery and equipment n.e.c.</label> + <value>Manufacture of machinery and equipment n.e.c.</value> + </item> + <item> + <label>Manufacture of motor vehicles, trailers and semi-trailers</label> + <value>Manufacture of motor vehicles, trailers and semi-trailers</value> + </item> + <item> + <label>Manufacture of furniture</label> + <value>Manufacture of furniture</value> + </item> + <item> + <label>Repair and installation of machinery and equipment</label> + <value>Repair and installation of machinery and equipment</value> + </item> + <item> + <label>Electricity, gas, steam and air conditioning supply</label> + <value>Electricity, gas, steam and air conditioning supply</value> + </item> + <item> + <label>Water collection, treatment and supply</label> + <value>Water collection, treatment and supply</value> + </item> + <item> + <label>Sewerage</label> + <value>Sewerage</value> + </item> + <item> + <label>Waste collection, treatment and disposal activities; materials recovery</label> + <value>Waste collection, treatment and disposal activities; materials recovery</value> + </item> + <item> + <label>Remediation activities and other waste management services</label> + <value>Remediation activities and other waste management services</value> + </item> + </select1> + <input ref="/data/personal_info/job_role"> + <label>Please list the key job role you hire for</label> + </input> + <select1 ref="/data/personal_info/min_qual"> + <label>Minimum Qualification for the job role</label> + <item> + <label>10th pass</label> + <value>10th pass</value> + </item> + <item> + <label>12th pass</label> + <value>12th pass</value> + </item> + <item> + <label>ITI pass</label> + <value>ITI pass</value> + </item> + <item> + <label>Diploma Holder</label> + <value>Diploma Holder</value> + </item> + <item> + <label>Graduate</label> + <value>Graduate</value> + </item> + <item> + <label>Post Graduate</label> + <value>Post Graduate</value> + </item> + <item> + <label>None</label> + <value>None</value> + </item> + </select1> + </group> + <group ref="/data/industry_strength"> + <label>Industry Strength</label> + <select1 ref="/data/industry_strength/resume_ops"> + <label>Have you resumed operations after the lockdown?</label> + <item> + <label>Yes</label> + <value>yes</value> + </item> + <item> + <label>No</label> + <value>no</value> + </item> + </select1> + <input appearance="numbers" ref="/data/industry_strength/no_emp_per"> + <label>Approximately how many permanent employees(on your payroll) were working for you before the lockdown?</label> + </input> + <input appearance="numbers" ref="/data/industry_strength/no_emp_con"> + <label>Approximately how many contractual employees were working for you before the lockdown?</label> + </input> + <input appearance="numbers" ref="/data/industry_strength/emp_migrant"> + <label>Approximately, how many of total employees were migrants from outside the State of Haryana?</label> + </input> + <input appearance="numbers" ref="/data/industry_strength/emp_current_per"> + <label>Approximately how many permanent employees are currently working for you?</label> + </input> + <input appearance="numbers" ref="/data/industry_strength/emp_current_con"> + <label>Approximately how many contractual employees are currently working for you?</label> + </input> + </group> + <group ref="/data/hiring_requirements"> + <label>Hiring Requirements</label> + <input appearance="numbers" ref="/data/hiring_requirements/average_hiring"> + <label>How many people do you hire every year on an average?</label> + </input> + <input appearance="numbers" ref="/data/hiring_requirements/current_requirement_number"> + <label>How many positions are you looking to hire currently?</label> + </input> + <select1 ref="/data/hiring_requirements/time_frame"> + <label>How urgently are you looking to close out these open positions?</label> + <item> + <label><7 days</label> + <value><7 days</value> + </item> + <item> + <label>7-15 days</label> + <value>7-15 days</value> + </item> + <item> + <label>15-30 days</label> + <value>15-30 days</value> + </item> + <item> + <label>>30 days</label> + <value>>30 days</value> + </item> + </select1> + <select1 ref="/data/hiring_requirements/hiring_local"> + <label>Are you open to hiring workforce from local areas/ districts around you?</label> + <item> + <label>Yes</label> + <value>yes</value> + </item> + <item> + <label>No</label> + <value>no</value> + </item> + </select1> + <select1 ref="/data/hiring_requirements/hiring_apprentices"> + <label>Are you looking to hire apprentices as of now?</label> + <item> + <label>Yes</label> + <value>Yes</value> + </item> + <item> + <label>No</label> + <value>No</value> + </item> + </select1> + <input appearance="numbers" ref="/data/hiring_requirements/apprentices_number"> + <label>How many apprentices are you open to absorb?</label> + </input> + <select1 ref="/data/hiring_requirements/usage_rozgar"> + <label>Have you used the Rozgar Portal for your hiring needs?</label> + <item> + <label>Yes</label> + <value>Yes</value> + </item> + <item> + <label>No</label> + <value>No</value> + </item> + </select1> + <select1 appearance="minimal" ref="/data/hiring_requirements/reason_rozgar_usage"> + <label>What has been the main reason why you haven't yet used the Rozgar Portal?</label> + <item> + <label>Was not aware of it</label> + <value>Was not aware of it</value> + </item> + <item> + <label>Was aware but have not logged in</label> + <value>Was aware but have not logged in</value> + </item> + <item> + <label>Have logged in but not downloaded any data</label> + <value>Have logged in but not downloaded any data</value> + </item> + <item> + <label>Downloaded data but did not find it useful</label> + <value>Downloaded data but did not find it useful</value> + </item> + <item> + <label>Other</label> + <value>Other</value> + </item> + </select1> + </group> + </h:body> +</h:html> \ No newline at end of file diff --git a/kubernetes/helm_charts/core/content/values.j2 b/kubernetes/helm_charts/core/content/values.j2 index f0d14ddbc..8263fdbbf 100644 --- a/kubernetes/helm_charts/core/content/values.j2 +++ b/kubernetes/helm_charts/core/content/values.j2 @@ -32,4 +32,4 @@ autoscaling: minReplicas: {{ content_autoscaling_minReplicas|default(1) }} maxReplicas: {{ content_autoscaling_maxReplicas|default(2) }} targetCPUUtilizationPercentage: {{ content_autoscaling_targetCPUUtilizationPercentage|default(60) }} - targetMemoryUtilizationPercentage: {{ content_autoscaling_targetMemoryUtilizationPercentage|default('') }} \ No newline at end of file + targetMemoryUtilizationPercentage: {{ content_autoscaling_targetMemoryUtilizationPercentage|default('') }} diff --git a/kubernetes/helm_charts/core/transformer/Chart.yaml b/kubernetes/helm_charts/core/transformer/Chart.yaml new file mode 100644 index 000000000..eb4976565 --- /dev/null +++ b/kubernetes/helm_charts/core/transformer/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: transformer +version: 0.1.0 diff --git a/kubernetes/helm_charts/core/transformer/templates/deployment.yaml b/kubernetes/helm_charts/core/transformer/templates/deployment.yaml new file mode 100644 index 000000000..0d6eb27e3 --- /dev/null +++ b/kubernetes/helm_charts/core/transformer/templates/deployment.yaml @@ -0,0 +1,62 @@ +--- +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 }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.dockerhub }}/{{ .Values.repository }}:{{ .Values.image_tag }}" + imagePullPolicy: Always + env: + - name: JAVA_OPTIONS + value: {{ .Values.env.javaoptions | quote }} + 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 }} + +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }}-service + namespace: {{ .Values.namespace }} + labels: + app: {{ .Chart.Name }} +spec: + ports: + - name: http-{{ .Chart.Name }} + protocol: TCP + port: {{ .Values.network.targetport }} + selector: + app: {{ .Chart.Name }} diff --git a/kubernetes/helm_charts/core/transformer/templates/hpa.yaml b/kubernetes/helm_charts/core/transformer/templates/hpa.yaml new file mode 100644 index 000000000..0fef8ca0e --- /dev/null +++ b/kubernetes/helm_charts/core/transformer/templates/hpa.yaml @@ -0,0 +1,27 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +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 + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} + {{- end }} \ No newline at end of file diff --git a/kubernetes/helm_charts/core/transformer/values.j2 b/kubernetes/helm_charts/core/transformer/values.j2 new file mode 100644 index 000000000..858d408b0 --- /dev/null +++ b/kubernetes/helm_charts/core/transformer/values.j2 @@ -0,0 +1,35 @@ +### Default variable file for cert-service ### + +namespace: {{ namespace }} +imagepullsecrets: {{ imagepullsecrets }} +dockerhub: {{ dockerhub }} + +env: + javaoptions: {{uci_transformer_java_mem_limit|default('-Xmx600m')}} + +replicaCount: {{uci_transformer_replicacount|default(1)}} +repository: {{uci_transformer_repository|default('uci-transformer')}} +image_tag: {{ image_tag }} +resources: + requests: + cpu: {{uci_transformer_cpu_req|default('100m')}} + memory: {{uci_transformer_mem_req|default('100Mi')}} + limits: + cpu: {{uci_transformer_cpu_limit|default('1')}} + memory: {{uci_transformer_mem_limit|default('1024Mi')}} +network: + port: 8080 + targetport: 8080 +strategy: + type: RollingUpdate + maxsurge: {{ uci_transformer_maxsurge|default('25%') }} + maxunavailable: {{ uci_transformer_maxunavailable|default('25%') }} + +{{ uci_transformer_liveness_readiness | to_nice_yaml }} + +autoscaling: + enabled: {{ uci_transformer_autoscaling_enabled | default('false') }} + minReplicas: {{ uci_transformer_autoscaling_minReplicas|default(1) }} + maxReplicas: {{ uci_transformer_autoscaling_maxReplicas|default(2) }} + targetCPUUtilizationPercentage: {{ uci_transformer_autoscaling_targetCPUUtilizationPercentage|default(60) }} + targetMemoryUtilizationPercentage: {{ uci_transformer_autoscaling_targetMemoryUtilizationPercentage|default('') }} -- GitLab