From 6d843df21c1d5a8bd9d2c85a50569794a1bf85e5 Mon Sep 17 00:00:00 2001 From: Karthik-TF Date: Fri, 30 Aug 2024 17:32:08 +0530 Subject: [PATCH] nira (#1) --- README.md | 2 +- admin/admin-service/pom.xml | 6 +- admin/hotlist-service/pom.xml | 4 +- admin/kernel-masterdata-service/pom.xml | 4 +- .../controller/DynamicFieldController.java | 12 +- .../controller/LocationController.java | 38 +- .../dto/DynamicFieldCodeValueDTO.java | 19 - .../DynamicFieldConsolidateResponseDto.java | 5 +- .../getresponse/extn/DynamicFieldExtnDto.java | 1 + .../repository/DynamicFieldRepository.java | 1 + .../repository/LocationRepository.java | 6 +- .../service/DynamicFieldService.java | 2 +- .../masterdata/service/LocationService.java | 10 +- .../service/impl/DynamicFieldServiceImpl.java | 143 +++--- .../service/impl/LocationServiceImpl.java | 15 +- .../DynamicFieldControllerTest.java | 45 +- .../controller/LocationControllerTest.java | 8 - .../test/service/MasterDataServiceTest.java | 32 +- .../test/service/SchemaServiceTest.java | 220 ++++----- admin/kernel-syncdata-service/pom.xml | 4 +- admin/pom.xml | 5 +- .../sql/1.2.0.1_to_1.2.1.0_rollback.sql | 1 - .../sql/1.2.0.1_to_1.2.1.0_upgrade.sql | 1 - .../sql/1.2.0.1_to_1.2.1.0_rollback.sql | 1 - .../sql/1.2.0.1_to_1.2.1.0_upgrade.sql | 1 - deploy/.gitignore | 1 - deploy/README.md | 38 -- deploy/admin-proxy.yaml | 137 ------ deploy/copy_cm.sh | 22 - deploy/copy_cm_func.sh | 33 -- deploy/delete.sh | 33 -- deploy/install.sh | 62 --- deploy/restart.sh | 25 - helm/admin-hotlist/.gitignore | 1 - helm/admin-hotlist/.helmignore | 21 - helm/admin-hotlist/Chart.yaml | 20 - helm/admin-hotlist/README.md | 10 - helm/admin-hotlist/templates/NOTES.txt | 1 - helm/admin-hotlist/templates/_helpers.tpl | 58 --- .../templates/clusterrolebinding.yaml | 19 - helm/admin-hotlist/templates/deployment.yaml | 133 ------ helm/admin-hotlist/templates/extra-list.yaml | 4 - .../templates/service-account.yaml | 12 - helm/admin-hotlist/templates/service.yaml | 28 -- .../templates/servicemonitor.yaml | 36 -- .../templates/virtualservice.yaml | 32 -- helm/admin-hotlist/values.yaml | 420 ---------------- helm/admin-service/.gitignore | 1 - helm/admin-service/.helmignore | 21 - helm/admin-service/Chart.yaml | 20 - helm/admin-service/README.md | 10 - helm/admin-service/templates/NOTES.txt | 1 - helm/admin-service/templates/_helpers.tpl | 58 --- .../templates/clusterrolebinding.yaml | 19 - helm/admin-service/templates/deployment.yaml | 133 ------ helm/admin-service/templates/extra-list.yaml | 4 - .../templates/service-account.yaml | 12 - helm/admin-service/templates/service.yaml | 28 -- .../templates/servicemonitor.yaml | 36 -- .../templates/virtualservice.yaml | 34 -- helm/admin-service/values.yaml | 451 ------------------ helm/masterdata/.gitignore | 1 - helm/masterdata/.helmignore | 21 - helm/masterdata/Chart.yaml | 20 - helm/masterdata/README.md | 40 -- helm/masterdata/templates/NOTES.txt | 1 - helm/masterdata/templates/_helpers.tpl | 60 --- .../templates/clusterrolebinding.yaml | 19 - helm/masterdata/templates/deployment.yaml | 135 ------ helm/masterdata/templates/extra-list.yaml | 4 - .../masterdata/templates/service-account.yaml | 12 - helm/masterdata/templates/service.yaml | 28 -- helm/masterdata/templates/servicemonitor.yaml | 36 -- helm/masterdata/templates/virtualservice.yaml | 34 -- helm/masterdata/values.yaml | 420 ---------------- helm/syncdata/.gitignore | 1 - helm/syncdata/.helmignore | 21 - helm/syncdata/Chart.yaml | 20 - helm/syncdata/README.md | 40 -- helm/syncdata/templates/NOTES.txt | 1 - helm/syncdata/templates/_helpers.tpl | 60 --- .../templates/clusterrolebinding.yaml | 19 - helm/syncdata/templates/deployment.yaml | 135 ------ helm/syncdata/templates/extra-list.yaml | 4 - helm/syncdata/templates/service-account.yaml | 12 - helm/syncdata/templates/service.yaml | 28 -- helm/syncdata/templates/servicemonitor.yaml | 36 -- helm/syncdata/templates/virtualservice.yaml | 32 -- helm/syncdata/values.yaml | 419 ---------------- 89 files changed, 256 insertions(+), 3963 deletions(-) delete mode 100644 admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldCodeValueDTO.java delete mode 100644 db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_rollback.sql delete mode 100644 db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_upgrade.sql delete mode 100644 db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_rollback.sql delete mode 100644 db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_upgrade.sql delete mode 100644 deploy/.gitignore delete mode 100644 deploy/README.md delete mode 100644 deploy/admin-proxy.yaml delete mode 100755 deploy/copy_cm.sh delete mode 100755 deploy/copy_cm_func.sh delete mode 100755 deploy/delete.sh delete mode 100755 deploy/install.sh delete mode 100755 deploy/restart.sh delete mode 100644 helm/admin-hotlist/.gitignore delete mode 100644 helm/admin-hotlist/.helmignore delete mode 100644 helm/admin-hotlist/Chart.yaml delete mode 100644 helm/admin-hotlist/README.md delete mode 100644 helm/admin-hotlist/templates/NOTES.txt delete mode 100644 helm/admin-hotlist/templates/_helpers.tpl delete mode 100644 helm/admin-hotlist/templates/clusterrolebinding.yaml delete mode 100644 helm/admin-hotlist/templates/deployment.yaml delete mode 100644 helm/admin-hotlist/templates/extra-list.yaml delete mode 100644 helm/admin-hotlist/templates/service-account.yaml delete mode 100644 helm/admin-hotlist/templates/service.yaml delete mode 100644 helm/admin-hotlist/templates/servicemonitor.yaml delete mode 100644 helm/admin-hotlist/templates/virtualservice.yaml delete mode 100644 helm/admin-hotlist/values.yaml delete mode 100644 helm/admin-service/.gitignore delete mode 100644 helm/admin-service/.helmignore delete mode 100644 helm/admin-service/Chart.yaml delete mode 100644 helm/admin-service/README.md delete mode 100644 helm/admin-service/templates/NOTES.txt delete mode 100644 helm/admin-service/templates/_helpers.tpl delete mode 100644 helm/admin-service/templates/clusterrolebinding.yaml delete mode 100644 helm/admin-service/templates/deployment.yaml delete mode 100644 helm/admin-service/templates/extra-list.yaml delete mode 100644 helm/admin-service/templates/service-account.yaml delete mode 100644 helm/admin-service/templates/service.yaml delete mode 100644 helm/admin-service/templates/servicemonitor.yaml delete mode 100644 helm/admin-service/templates/virtualservice.yaml delete mode 100644 helm/admin-service/values.yaml delete mode 100644 helm/masterdata/.gitignore delete mode 100644 helm/masterdata/.helmignore delete mode 100644 helm/masterdata/Chart.yaml delete mode 100644 helm/masterdata/README.md delete mode 100644 helm/masterdata/templates/NOTES.txt delete mode 100644 helm/masterdata/templates/_helpers.tpl delete mode 100644 helm/masterdata/templates/clusterrolebinding.yaml delete mode 100644 helm/masterdata/templates/deployment.yaml delete mode 100644 helm/masterdata/templates/extra-list.yaml delete mode 100644 helm/masterdata/templates/service-account.yaml delete mode 100644 helm/masterdata/templates/service.yaml delete mode 100644 helm/masterdata/templates/servicemonitor.yaml delete mode 100644 helm/masterdata/templates/virtualservice.yaml delete mode 100644 helm/masterdata/values.yaml delete mode 100644 helm/syncdata/.gitignore delete mode 100644 helm/syncdata/.helmignore delete mode 100644 helm/syncdata/Chart.yaml delete mode 100644 helm/syncdata/README.md delete mode 100644 helm/syncdata/templates/NOTES.txt delete mode 100644 helm/syncdata/templates/_helpers.tpl delete mode 100644 helm/syncdata/templates/clusterrolebinding.yaml delete mode 100644 helm/syncdata/templates/deployment.yaml delete mode 100644 helm/syncdata/templates/extra-list.yaml delete mode 100644 helm/syncdata/templates/service-account.yaml delete mode 100644 helm/syncdata/templates/service.yaml delete mode 100644 helm/syncdata/templates/servicemonitor.yaml delete mode 100644 helm/syncdata/templates/virtualservice.yaml delete mode 100644 helm/syncdata/values.yaml diff --git a/README.md b/README.md index ae2089eee8f..168f14bccf5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Maven Package upon a push](https://github.com/mosip/admin-services/actions/workflows/push-trigger.yml/badge.svg?branch=master)](https://github.com/mosip/admin-services/actions/workflows/push-trigger.yml) +[![Maven Package upon a push](https://github.com/mosip/admin-services/actions/workflows/push_trigger.yml/badge.svg?branch=release-1.2.0.1)](https://github.com/mosip/admin-services/actions/workflows/push_trigger.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mosip_admin-services&id=mosip_admin-services&metric=alert_status)](https://sonarcloud.io/dashboard?id=mosip_admin-services) diff --git a/admin/admin-service/pom.xml b/admin/admin-service/pom.xml index 5d48df54f6c..b5dc1da0591 100644 --- a/admin/admin-service/pom.xml +++ b/admin/admin-service/pom.xml @@ -7,11 +7,11 @@ io.mosip.admin admin-parent - 1.2.1.0 + 1.2.0.1 admin-service admin-service - 1.2.1.0 + 1.2.0.1 http://maven.apache.org jar @@ -216,7 +216,7 @@ io.mosip.kernel kernel-auth-adapter - ${kernel-auth-adapter.version} + ${project.version} io.netty diff --git a/admin/hotlist-service/pom.xml b/admin/hotlist-service/pom.xml index 387a2f6124d..e1cc5914727 100644 --- a/admin/hotlist-service/pom.xml +++ b/admin/hotlist-service/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.mosip.hotlist hotlist-service - 1.2.1.0 + 1.2.0.1 Hotlist Service Service to block/unblock ids in MOSIP https://github.com/mosip/admin-services @@ -362,7 +362,7 @@ io.mosip.kernel kernel-auth-adapter - ${kernel-auth-adapter.version} + ${kernel.version} diff --git a/admin/kernel-masterdata-service/pom.xml b/admin/kernel-masterdata-service/pom.xml index 9249a41cbdc..b23f747de7a 100644 --- a/admin/kernel-masterdata-service/pom.xml +++ b/admin/kernel-masterdata-service/pom.xml @@ -9,7 +9,7 @@ kernel-masterdata-service Mosip commons project https://github.com/mosip/commons - 1.2.1.0 + 1.2.0.1 UTF-8 @@ -475,7 +475,7 @@ io.mosip.kernel kernel-auth-adapter - ${kernel-auth-adapter.version} + ${project.version} diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/DynamicFieldController.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/DynamicFieldController.java index 9364c59a2e2..4ac8c37ad50 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/DynamicFieldController.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/DynamicFieldController.java @@ -5,6 +5,7 @@ import java.util.List; import javax.validation.Valid; +import javax.websocket.server.PathParam; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -38,6 +39,7 @@ import io.mosip.kernel.masterdata.dto.response.FilterResponseCodeDto; import io.mosip.kernel.masterdata.dto.response.FilterResponseDto; import io.mosip.kernel.masterdata.dto.response.PageResponseDto; +import io.mosip.kernel.masterdata.entity.DynamicField; import io.mosip.kernel.masterdata.service.DynamicFieldService; import io.mosip.kernel.masterdata.service.GenericService; import io.mosip.kernel.masterdata.utils.AuditUtil; @@ -91,16 +93,6 @@ public ResponseWrapper getDynamicFieldByName responseWrapper.setResponse(dynamicFieldService.getDynamicFieldByNameAndLangcode(fieldName,langCode,withValue)); return responseWrapper; } - - @ResponseFilter - @GetMapping("/{fieldName}") - @ApiOperation(value = " Service to fetch one dynamic field in all the languages") - public ResponseWrapper> getAllDynamicFieldByName( - @PathVariable("fieldName") String fieldName){ - ResponseWrapper> responseWrapper = new ResponseWrapper<>(); - responseWrapper.setResponse(dynamicFieldService.getAllDynamicFieldByName(fieldName)); - return responseWrapper; - } @ResponseFilter diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/LocationController.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/LocationController.java index 7db7db9bd5e..abd3708ae81 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/LocationController.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/controller/LocationController.java @@ -230,23 +230,6 @@ public ResponseWrapper getImmediateChildrenByLocCodeAndLang return responseWrapper; } - /** - * - * @param locationCode location code - * @param languageCodes language codes - * @return list of location hierarchies - */ - @ResponseFilter - @GetMapping(value = "/immediatechildren/{locationcode}") - public ResponseWrapper getImmediateChildrenByLocCode( - @PathVariable("locationcode") String locationCode, @RequestParam("languageCodes") List languageCodes) { - - ResponseWrapper responseWrapper = new ResponseWrapper<>(); - responseWrapper - .setResponse(locationHierarchyService.getImmediateChildrenByLocCode(locationCode, languageCodes)); - return responseWrapper; - } - /** * checks whether the given location name is valid or not * @@ -372,5 +355,26 @@ public ResponseWrapper> getMissingLocationDetails( responseWrapper.setResponse(genericService.getMissingData(Location.class, langCode, "code", fieldName)); return responseWrapper; } + + +/** + * + * @param locationCode location code + * @param hierarchyName hierarchy name + * @param langCode language code + * @return list of location hierarchies + */ + @ResponseFilter + //@PreAuthorize("hasAnyRole(@authorizedRoles.getGetlocationsimmediatechildrenlocationcodehierarchyNamelangcode())") + @GetMapping(value = "/immediatechildren/{locationcode}/{hierarchyName}/{langcode}") + public ResponseWrapper getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode( + @PathVariable("locationcode") String locationCode, @PathVariable("hierarchyName") String hierarchyName, @PathVariable("langcode") String langCode) { + + ResponseWrapper responseWrapper = new ResponseWrapper<>(); + responseWrapper + .setResponse(locationHierarchyService.getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(locationCode, hierarchyName, langCode)); + return responseWrapper; + } + } diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldCodeValueDTO.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldCodeValueDTO.java deleted file mode 100644 index 75b91f7eb5b..00000000000 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldCodeValueDTO.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.mosip.kernel.masterdata.dto; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@AllArgsConstructor -@NoArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public class DynamicFieldCodeValueDTO { - - private String code; - - private String value; - -} diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldConsolidateResponseDto.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldConsolidateResponseDto.java index d380c22a6b2..755d5e9e5e2 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldConsolidateResponseDto.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/DynamicFieldConsolidateResponseDto.java @@ -1,7 +1,5 @@ package io.mosip.kernel.masterdata.dto; -import java.util.List; - import org.json.JSONArray; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -21,6 +19,7 @@ public class DynamicFieldConsolidateResponseDto { private String description; - private List values; + @JsonIgnore + private JSONArray jsonValues; } diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/getresponse/extn/DynamicFieldExtnDto.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/getresponse/extn/DynamicFieldExtnDto.java index 30767953f85..21893ee23fb 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/getresponse/extn/DynamicFieldExtnDto.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/dto/getresponse/extn/DynamicFieldExtnDto.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import lombok.Data; +import org.json.JSONArray; import java.time.LocalDateTime; import java.util.List; diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/DynamicFieldRepository.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/DynamicFieldRepository.java index fbcb0975edf..9b11a2737e3 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/DynamicFieldRepository.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/DynamicFieldRepository.java @@ -142,6 +142,7 @@ int updateDynamicField(String id, String description, String langCode, String da /** * update isDeleted as true + * @param id * @param updatedDateTime * @param updatedBy * @return diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java index 419735474e2..b9de40d0be4 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/repository/LocationRepository.java @@ -160,7 +160,9 @@ List findLocationByHierarchyLevelStartsWith(Short hierarchyLevel, Stri @Query(value = "FROM Location l where l.langCode=?1 and l.hierarchyLevel=?2") List getAllLocationsByLangCodeWithHierarchyLevel(String langCode, Short level); - @Query(value = "FROM Location l WHERE parentLocCode = ?1 AND l.langCode IN (?2) AND (l.isDeleted IS NULL OR l.isDeleted = false) AND l.isActive = true") - List findLocationHierarchyByParentLocCode(String parentLocCode, List languageCodes); + +@Query(value = "FROM Location l where parentLocCode=?1 and hierarchyName=?2 and langCode=?3 and (l.isDeleted is null or l.isDeleted=false) and l.isActive=true") + List findLocationHierarchyByParentLocCodeAndHierarchyNameAndLanguageCode(String parentLocCode, String hierarchyName, String languageCode); + } diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/DynamicFieldService.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/DynamicFieldService.java index 22a97a2ca0e..d40677997b3 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/DynamicFieldService.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/DynamicFieldService.java @@ -16,6 +16,7 @@ import io.mosip.kernel.masterdata.dto.request.SearchDto; import io.mosip.kernel.masterdata.dto.response.FilterResponseCodeDto; import io.mosip.kernel.masterdata.dto.response.PageResponseDto; +import io.mosip.kernel.masterdata.entity.DynamicField; /** * Methods to create / update / inactivate / addValues dynamic field @@ -82,5 +83,4 @@ public PageDto getAllDynamicField(int pageNumber, int pageS public DynamicFieldConsolidateResponseDto getDynamicFieldByNameAndLangcode(String fieldName,String langCode,boolean withValue); - List getAllDynamicFieldByName(String fieldName); } diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/LocationService.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/LocationService.java index e2c8a0d0452..02bcf833ed8 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/LocationService.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/LocationService.java @@ -136,6 +136,14 @@ public interface LocationService { public StatusResponseDto updateLocationStatus(String code, boolean isActive); public FilterResponseCodeDto locFilterValues(FilterValueDto filterValueDto); + /* + * (non-Javadoc) + * + * @param locCode - location code + * @param hierarchyName - hierarchyName + * @param langCode - language code + * @return {@link LocationResponseDto} + */ + LocationResponseDto getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(String locCode, String hierarchyName, String langCode); - LocationResponseDto getImmediateChildrenByLocCode(String locationCode, List languageCodes); } diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/DynamicFieldServiceImpl.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/DynamicFieldServiceImpl.java index 3364000eeb0..2a7b4561a18 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/DynamicFieldServiceImpl.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/DynamicFieldServiceImpl.java @@ -1,11 +1,42 @@ package io.mosip.kernel.masterdata.service.impl; -import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.stream.Collectors; + +import javax.transaction.Transactional; + +import org.json.JSONArray; +import org.json.JSONException; +import io.mosip.kernel.masterdata.dto.response.FilterResult; + +import org.json.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.CacheEvict; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.dao.DataAccessException; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; + +import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; + import io.mosip.kernel.core.dataaccess.exception.DataAccessLayerException; import io.mosip.kernel.masterdata.constant.SchemaErrorCode; -import io.mosip.kernel.masterdata.dto.DynamicFieldCodeValueDTO; import io.mosip.kernel.masterdata.dto.DynamicFieldConsolidateResponseDto; import io.mosip.kernel.masterdata.dto.DynamicFieldDefDto; import io.mosip.kernel.masterdata.dto.DynamicFieldDto; @@ -22,7 +53,6 @@ import io.mosip.kernel.masterdata.dto.request.SearchDto; import io.mosip.kernel.masterdata.dto.response.ColumnCodeValue; import io.mosip.kernel.masterdata.dto.response.FilterResponseCodeDto; -import io.mosip.kernel.masterdata.dto.response.FilterResult; import io.mosip.kernel.masterdata.dto.response.PageResponseDto; import io.mosip.kernel.masterdata.entity.DynamicField; import io.mosip.kernel.masterdata.exception.DataNotFoundException; @@ -38,47 +68,20 @@ import io.mosip.kernel.masterdata.utils.PageUtils; import io.mosip.kernel.masterdata.validator.FilterColumnValidator; import io.mosip.kernel.masterdata.validator.FilterTypeValidator; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.cache.annotation.CacheEvict; -import org.springframework.cache.annotation.Cacheable; -import org.springframework.dao.DataAccessException; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.data.domain.Sort.Direction; -import org.springframework.stereotype.Service; -import org.springframework.util.Assert; - -import javax.transaction.Transactional; -import java.io.IOException; -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; -import java.util.stream.Collectors; @Service public class DynamicFieldServiceImpl implements DynamicFieldService { - + private static final Logger LOGGER = LoggerFactory.getLogger(DynamicFieldServiceImpl.class); - + private final ObjectMapper objectMapper = new ObjectMapper(); - + @Autowired private DynamicFieldRepository dynamicFieldRepository; - + @Autowired private MasterdataCreationUtil masterdataCreationUtil; - + @Autowired private MasterdataSearchHelper masterdataSearchHelper; @@ -96,11 +99,11 @@ public class DynamicFieldServiceImpl implements DynamicFieldService { @Autowired AuditUtil auditUtil; - + /* * (non-Javadoc) - * + * * @see * io.mosip.kernel.masterdata.service.DynamicFieldService#getAllDynamicField() */ @@ -109,18 +112,18 @@ public class DynamicFieldServiceImpl implements DynamicFieldService { condition="#langCode != null") @Override public PageDto getAllDynamicField(int pageNumber, int pageSize, String sortBy, String orderBy, String langCode, - LocalDateTime lastUpdated, LocalDateTime currentTimestamp) { + LocalDateTime lastUpdated, LocalDateTime currentTimestamp) { Page pagedResult = null; if (lastUpdated == null) { lastUpdated = LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC); } try { - - PageRequest pageRequest = PageRequest.of(pageNumber, pageSize, Sort.by(Direction.fromString(orderBy), sortBy)); + + PageRequest pageRequest = PageRequest.of(pageNumber, pageSize, Sort.by(Direction.fromString(orderBy), sortBy)); pagedResult = langCode == null ? dynamicFieldRepository.findAllLatestDynamicFieldNames(lastUpdated, currentTimestamp, pageRequest) : - dynamicFieldRepository.findAllLatestDynamicFieldNamesByLangCode(langCode,lastUpdated, currentTimestamp, pageRequest); - + dynamicFieldRepository.findAllLatestDynamicFieldNamesByLangCode(langCode,lastUpdated, currentTimestamp, pageRequest); + } catch (DataAccessException | DataAccessLayerException e) { throw new MasterDataServiceException(SchemaErrorCode.DYNAMIC_FIELD_FETCH_EXCEPTION.getErrorCode(), SchemaErrorCode.DYNAMIC_FIELD_FETCH_EXCEPTION.getErrorMessage() + " " @@ -146,11 +149,11 @@ public PageDto getAllDynamicField(int pageNumber, int pageS list.add(getDynamicFieldDto(groupedValues.get(lang))); } }); - + pagedFields.setPageNo(pagedResult.getNumber()); pagedFields.setTotalPages(pagedResult.getTotalPages()); pagedFields.setTotalItems(pagedResult.getTotalElements()); - } + } return pagedFields; } @@ -201,7 +204,7 @@ public List getDistinctDynamicFields(String langCode) { /* * (non-Javadoc) - * + * * @see * io.mosip.kernel.masterdata.service.DynamicFieldService#createDynamicField() */ @@ -238,7 +241,7 @@ public DynamicFieldResponseDto createDynamicField(DynamicFieldDto dto) { /* * (non-Javadoc) - * + * * @see * io.mosip.kernel.masterdata.service.DynamicFieldService#updateDynamicField() */ @@ -251,10 +254,10 @@ public DynamicFieldResponseDto updateDynamicField(String id, DynamicFieldPutDto String valueJson = getValidatedFieldValue(dto.getFieldVal()); - int updatedRows = dynamicFieldRepository.updateDynamicField(id, dto.getDescription(), dto.getLangCode(), + int updatedRows = dynamicFieldRepository.updateDynamicField(id, dto.getDescription(), dto.getLangCode(), dto.getDataType(), MetaDataUtils.getCurrentDateTime(), MetaDataUtils.getContextUser(), valueJson); - + if (updatedRows < 1) { throw new DataNotFoundException(SchemaErrorCode.DYNAMIC_FIELD_NOT_FOUND_EXCEPTION.getErrorCode(), SchemaErrorCode.DYNAMIC_FIELD_NOT_FOUND_EXCEPTION.getErrorMessage()); @@ -278,14 +281,14 @@ public StatusResponseDto deleteDynamicFieldValue(String id) { if(dynamicField == null) throw new DataNotFoundException(SchemaErrorCode.DYNAMIC_FIELD_NOT_FOUND_EXCEPTION.getErrorCode(), SchemaErrorCode.DYNAMIC_FIELD_NOT_FOUND_EXCEPTION.getErrorMessage()); - if(dynamicField.getValueJson()==null) - throw new DataNotFoundException(SchemaErrorCode.DYNAMIC_FIELD_VALUE_NOT_FOUND_EXCEPTION.getErrorCode(), + if(dynamicField.getValueJson()==null) + throw new DataNotFoundException(SchemaErrorCode.DYNAMIC_FIELD_VALUE_NOT_FOUND_EXCEPTION.getErrorCode(), SchemaErrorCode.DYNAMIC_FIELD_VALUE_NOT_FOUND_EXCEPTION.getErrorMessage()); JsonNode valueJson =objectMapper.readTree(dynamicField.getValueJson()); String code = valueJson.get("code").toString(); - - - + + + int deletedRows = dynamicFieldRepository.deleteDynamicField(dynamicField.getName(), "%"+code+"%", MetaDataUtils.getCurrentDateTime(), MetaDataUtils.getContextUser()); @@ -513,49 +516,23 @@ public DynamicFieldConsolidateResponseDto getDynamicFieldByNameAndLangcode(Strin DynamicFieldConsolidateResponseDto dto = new DynamicFieldConsolidateResponseDto(); dto.setDescription(lst.get(0).getDescription()); dto.setName(lst.get(0).getName()); - List dtolist = new ArrayList(); + dto.setJsonValues(null); if (withValue == true) { List l = new ArrayList<>(); for (int i = 0; i < lst.size(); i++) { l.add(new JSONObject(lst.get(i).getValueJson())); - dtolist.add(objectMapper.readValue(lst.get(i).getValueJson(),DynamicFieldCodeValueDTO.class)); } - dto.setValues(dtolist); + dto.setJsonValues(new JSONArray(l)); } return dto; - } catch (DataAccessLayerException | DataAccessException | JSONException | JsonProcessingException e) { + } catch (DataAccessLayerException | DataAccessException | JSONException e) { throw new MasterDataServiceException(SchemaErrorCode.DYNAMIC_FIELD_FETCH_EXCEPTION.getErrorCode(), ExceptionUtils.parseException(e)); } } - @Override - @Cacheable(value = "dynamic-field", key = "'dynamicfield'.concat('-').concat(#fieldName)") - public List getAllDynamicFieldByName(String fieldName) { - List fields = null; - try { - fields = dynamicFieldRepository.findAllDynamicFieldByName(fieldName); - } catch (DataAccessException | DataAccessLayerException e) { - throw new MasterDataServiceException(SchemaErrorCode.DYNAMIC_FIELD_FETCH_EXCEPTION.getErrorCode(), - SchemaErrorCode.DYNAMIC_FIELD_FETCH_EXCEPTION.getErrorMessage() + " " - + ExceptionUtils.parseException(e)); - } - List list = new ArrayList<>(); - if(fields != null && !fields.isEmpty()) { - Map> groupedValues = fields - .stream() - .collect(Collectors.groupingBy(DynamicField::getLangCode)); - list = groupedValues.keySet() - .stream() - .map(lang -> getDynamicFieldDto(groupedValues.get(lang))) - .collect(Collectors.toList()); - - } - return list; - } - -} \ No newline at end of file +} diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/LocationServiceImpl.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/LocationServiceImpl.java index d3dd6c8fd76..87341c16085 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/LocationServiceImpl.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/LocationServiceImpl.java @@ -5,8 +5,10 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.TreeMap; +import java.util.stream.Collectors; import io.mosip.kernel.masterdata.dto.response.*; import org.springframework.beans.factory.annotation.Autowired; @@ -956,14 +958,21 @@ public FilterResponseCodeDto locFilterValues(FilterValueDto filterValueDto) { } return filterResponseDto; } - + /* + * (non-Javadoc) + * + * @see io.mosip.kernel.masterdata.service.LocationService# + * getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(java.lang.String, java.lang.String, java.lang.String) + */ + @Cacheable(value = "locations", key = "'location'.concat('-').concat('immediate').concat('-').concat(#locCode).concat('-').concat(#hierarchyName).concat('-').concat(#langCode)", + condition = "#locCode != null && #hierarchyName != null && #langCode != null") @Override - public LocationResponseDto getImmediateChildrenByLocCode(String locationCode, List languageCodes) { + public LocationResponseDto getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(String locCode, String hierarchyName, String langCode) { List locationlist = null; LocationResponseDto locationHierarchyResponseDto = new LocationResponseDto(); try { - locationlist = locationRepository.findLocationHierarchyByParentLocCode(locationCode, languageCodes); + locationlist = locationRepository.findLocationHierarchyByParentLocCodeAndHierarchyNameAndLanguageCode(locCode, hierarchyName, langCode); } catch (DataAccessException | DataAccessLayerException e) { throw new MasterDataServiceException(LocationErrorCode.LOCATION_FETCH_EXCEPTION.getErrorCode(), diff --git a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/DynamicFieldControllerTest.java b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/DynamicFieldControllerTest.java index 218a9f650a2..867ad035691 100644 --- a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/DynamicFieldControllerTest.java +++ b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/DynamicFieldControllerTest.java @@ -1,22 +1,13 @@ package io.mosip.kernel.masterdata.test.controller; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import io.mosip.kernel.core.http.RequestWrapper; -import io.mosip.kernel.core.websub.model.EventModel; -import io.mosip.kernel.core.websub.spi.PublisherClient; -import io.mosip.kernel.masterdata.dto.DynamicFieldDto; -import io.mosip.kernel.masterdata.dto.DynamicFieldPutDto; -import io.mosip.kernel.masterdata.dto.request.FilterDto; -import io.mosip.kernel.masterdata.dto.request.FilterValueDto; -import io.mosip.kernel.masterdata.dto.request.Pagination; -import io.mosip.kernel.masterdata.dto.request.SearchDto; -import io.mosip.kernel.masterdata.dto.request.SearchSort; -import io.mosip.kernel.masterdata.test.TestBootApplication; -import io.mosip.kernel.masterdata.test.utils.MasterDataTest; -import io.mosip.kernel.masterdata.utils.AuditUtil; +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import io.mosip.kernel.masterdata.dto.request.*; import io.mosip.kernel.masterdata.validator.FilterColumnEnum; +import org.json.JSONObject; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; @@ -33,8 +24,18 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; -import java.util.ArrayList; -import java.util.List; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +import io.mosip.kernel.core.http.RequestWrapper; +import io.mosip.kernel.core.websub.model.EventModel; +import io.mosip.kernel.core.websub.spi.PublisherClient; +import io.mosip.kernel.masterdata.dto.DynamicFieldDto; +import io.mosip.kernel.masterdata.dto.DynamicFieldPutDto; +import io.mosip.kernel.masterdata.test.TestBootApplication; +import io.mosip.kernel.masterdata.test.utils.MasterDataTest; +import io.mosip.kernel.masterdata.utils.AuditUtil; @RunWith(SpringRunner.class) @SpringBootTest(classes = TestBootApplication.class) @@ -417,12 +418,4 @@ public void t022getDynamicFieldByNameTest2() throws Exception { "KER-SCH-003"); } - @Test - @WithUserDetails("global-admin") - public void t000getAllDynamicFieldByNameTest() throws Exception { - MasterDataTest.checkResponse( - mockMvc.perform(MockMvcRequestBuilders.get("/dynamicfields/gender")).andReturn(), - null); - } - } diff --git a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/LocationControllerTest.java b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/LocationControllerTest.java index ed32cf0b380..eb693eddf38 100644 --- a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/LocationControllerTest.java +++ b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/controller/LocationControllerTest.java @@ -674,12 +674,4 @@ public void t021updateLocationStatusFailTest() throws Exception { } - @Test - @WithUserDetails("global-admin") - public void t021getImmediateChildrenByLocCode() throws Exception { - - MasterDataTest - .checkResponse(mockMvc.perform(MockMvcRequestBuilders.get("/locations/immediatechildren/RSK?languageCodes=eng,tam")).andReturn(), null); - } - } diff --git a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/MasterDataServiceTest.java b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/MasterDataServiceTest.java index c5bd6aef5b9..91f98c5b032 100644 --- a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/MasterDataServiceTest.java +++ b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/MasterDataServiceTest.java @@ -12,6 +12,7 @@ import java.time.Month; import java.time.format.DateTimeFormatter; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import io.mosip.kernel.core.exception.ServiceError; @@ -3104,35 +3105,4 @@ public void validateRegCenterUpdateTest() { Assert.assertEquals("KER-MSD-259", serviceErrors.get(4).getErrorCode()); } - @Test - public void getImmediateChildrenByLocCodeTest() { - Mockito.when(locationHierarchyRepository - .findLocationHierarchyByParentLocCode(Mockito.anyString(), Mockito.anyList())) - .thenReturn(locationHierarchies); - Assert.assertEquals("IND", locationHierarchyService.getImmediateChildrenByLocCode("KAR", List.of("eng")).getLocations().get(0).getCode()); - } - - @Test(expected = MasterDataServiceException.class) - public void getImmediateChildrenByLocCodeTestExceptionTest() { - Mockito.when(locationHierarchyRepository - .findLocationHierarchyByParentLocCode(Mockito.anyString(), Mockito.anyList())) - .thenThrow(DataRetrievalFailureException.class); - locationHierarchyService.getImmediateChildrenByLocCode("KAR", List.of("eng")); - } - - @Test(expected = DataNotFoundException.class) - public void getImmediateChildrenByLocCodeTestDataExceptionTest() { - Mockito.when(locationHierarchyRepository - .findLocationHierarchyByParentLocCode(Mockito.anyString(), Mockito.anyList())) - .thenReturn(new ArrayList()); - locationHierarchyService.getImmediateChildrenByLocCode("KAR", List.of("eng")); - } - - @Test - @WithUserDetails("reg-officer") - public void testFetchAllDynamicFieldsAllLang() throws Exception { - Mockito.when(dynamicFieldRepository.findAllDynamicFieldByName(Mockito.anyString())).thenReturn(dynamicFields); - assertEquals(1, dynamicFieldService.getAllDynamicFieldByName("gender").size()); - } - } diff --git a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/SchemaServiceTest.java b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/SchemaServiceTest.java index 8b09ce5c72a..01906e1043c 100644 --- a/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/SchemaServiceTest.java +++ b/admin/kernel-masterdata-service/src/test/java/io/mosip/kernel/masterdata/test/service/SchemaServiceTest.java @@ -1,28 +1,15 @@ package io.mosip.kernel.masterdata.test.service; +import static org.junit.Assert.assertEquals; + +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import io.mosip.kernel.core.dataaccess.exception.DataAccessLayerException; -import io.mosip.kernel.core.websub.model.EventModel; -import io.mosip.kernel.core.websub.spi.PublisherClient; -import io.mosip.kernel.masterdata.constant.SchemaErrorCode; -import io.mosip.kernel.masterdata.dto.DynamicFieldDto; -import io.mosip.kernel.masterdata.dto.DynamicFieldPutDto; -import io.mosip.kernel.masterdata.dto.IdSchemaPublishDto; -import io.mosip.kernel.masterdata.dto.IdentitySchemaDto; -import io.mosip.kernel.masterdata.dto.getresponse.IdSchemaResponseDto; -import io.mosip.kernel.masterdata.dto.getresponse.PageDto; -import io.mosip.kernel.masterdata.entity.DynamicField; -import io.mosip.kernel.masterdata.entity.IdentitySchema; -import io.mosip.kernel.masterdata.exception.DataNotFoundException; -import io.mosip.kernel.masterdata.exception.MasterDataServiceException; -import io.mosip.kernel.masterdata.exception.RequestException; -import io.mosip.kernel.masterdata.repository.DynamicFieldRepository; -import io.mosip.kernel.masterdata.repository.IdentitySchemaRepository; -import io.mosip.kernel.masterdata.service.DynamicFieldService; -import io.mosip.kernel.masterdata.service.IdentitySchemaService; -import io.mosip.kernel.masterdata.service.TemplateService; import io.mosip.kernel.masterdata.service.impl.SchemaDefinitionServiceImpl; -import io.mosip.kernel.masterdata.test.TestBootApplication; import org.json.JSONException; import org.json.JSONObject; import org.junit.Assert; @@ -43,15 +30,30 @@ import org.springframework.security.test.context.support.WithUserDetails; import org.springframework.test.context.junit4.SpringRunner; -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; +import io.mosip.kernel.core.dataaccess.exception.DataAccessLayerException; +import io.mosip.kernel.core.websub.model.EventModel; +import io.mosip.kernel.core.websub.spi.PublisherClient; +import io.mosip.kernel.masterdata.constant.SchemaErrorCode; +import io.mosip.kernel.masterdata.dto.DynamicFieldDto; +import io.mosip.kernel.masterdata.dto.DynamicFieldPutDto; +import io.mosip.kernel.masterdata.dto.IdSchemaPublishDto; +import io.mosip.kernel.masterdata.dto.IdentitySchemaDto; +import io.mosip.kernel.masterdata.dto.getresponse.IdSchemaResponseDto; +import io.mosip.kernel.masterdata.dto.getresponse.PageDto; +import io.mosip.kernel.masterdata.entity.DynamicField; +import io.mosip.kernel.masterdata.entity.IdentitySchema; +import io.mosip.kernel.masterdata.exception.DataNotFoundException; +import io.mosip.kernel.masterdata.exception.MasterDataServiceException; +import io.mosip.kernel.masterdata.exception.RequestException; +import io.mosip.kernel.masterdata.repository.DynamicFieldRepository; +import io.mosip.kernel.masterdata.repository.IdentitySchemaRepository; +import io.mosip.kernel.masterdata.service.DynamicFieldService; +import io.mosip.kernel.masterdata.service.IdentitySchemaService; +import io.mosip.kernel.masterdata.service.TemplateService; +import io.mosip.kernel.masterdata.test.TestBootApplication; /** - * + * * @author anusha * */ @@ -60,43 +62,43 @@ @RunWith(SpringRunner.class) @AutoConfigureMockMvc public class SchemaServiceTest { - - @MockBean + + @MockBean private PublisherClient publisher; - + @MockBean private TemplateService templateService; - + @MockBean private IdentitySchemaRepository identitySchemaRepository; @MockBean private DynamicFieldRepository dynamicFieldRepository; - + @Autowired - private IdentitySchemaService identitySchemaService; - + private IdentitySchemaService identitySchemaService; + @Autowired private DynamicFieldService dynamicFieldService; @Autowired private SchemaDefinitionServiceImpl schemaDefinitionService; - - + + private Page fieldPagedResult; private Page schemaPagedResult; - + private IdentitySchema draftSchema; private IdentitySchema publishedSchema; - + private DynamicField bloodTypeField; - private DynamicField mstatusField; - + private DynamicField mstatusField; + PageRequest pageRequest = null; - + @Before public void setup() { - List list = new ArrayList(); + List list = new ArrayList(); bloodTypeField = new DynamicField(); bloodTypeField.setDataType("simpleType"); bloodTypeField.setDescription("test"); @@ -105,7 +107,7 @@ public void setup() { bloodTypeField.setLangCode("eng"); bloodTypeField.setName("bloodType"); bloodTypeField.setValueJson("[{\"value\":\"Optv\",\"code\":\"BT1\",\"active\":true},{\"value\":\"Ontv\",\"code\":\"BT2\",\"active\":true}]"); - + mstatusField = new DynamicField(); mstatusField.setDataType("string"); mstatusField.setDescription("test desc"); @@ -115,9 +117,9 @@ public void setup() { mstatusField.setName("martialStatus"); mstatusField.setValueJson("[{\"value\":\"married\",\"code\":\"MS1\",\"active\":true},{\"value\":\"single\",\"code\":\"MS2\",\"active\":true}]"); list.add(mstatusField); - - fieldPagedResult = new PageImpl(list); - + + fieldPagedResult = new PageImpl(list); + List schemaList = new ArrayList(); draftSchema = new IdentitySchema(); draftSchema.setId("11"); @@ -130,7 +132,7 @@ public void setup() { draftSchema.setSchemaJson("{}"); draftSchema.setStatus(IdentitySchemaService.STATUS_DRAFT); schemaList.add(draftSchema); - + publishedSchema = new IdentitySchema(); publishedSchema.setId("12"); publishedSchema.setAdditionalProperties(false); @@ -142,7 +144,7 @@ public void setup() { publishedSchema.setSchemaJson("{}"); publishedSchema.setStatus(IdentitySchemaService.STATUS_PUBLISHED); schemaList.add(publishedSchema); - + schemaPagedResult = new PageImpl(schemaList); pageRequest = PageRequest.of(0, 10, Sort.by(Direction.fromString("desc"), "cr_dtimes")); } @@ -155,28 +157,28 @@ public void getAllDefinitionsTest() throws JSONException { Assert.assertNotNull(jsonObject.getJSONObject("definitions").getJSONObject("documentType")); Assert.assertNotNull(jsonObject.getJSONObject("definitions").getJSONObject("biometricsType")); } - + @Test @WithUserDetails("reg-officer") - public void testFetchAllDynamicFields() throws Exception { + public void testFetchAllDynamicFields() throws Exception { Mockito.when(dynamicFieldRepository.findAllDynamicFields(pageRequest)).thenReturn(fieldPagedResult); LocalDateTime currentTimeStamp = LocalDateTime.now(ZoneOffset.UTC); dynamicFieldService.getAllDynamicField(0, 10, "cr_dtimes", "desc", null, null, currentTimeStamp); } - + @Test @WithUserDetails("reg-officer") - public void testFetchAllDynamicFieldsByLangCode() throws Exception { + public void testFetchAllDynamicFieldsByLangCode() throws Exception { Mockito.when(dynamicFieldRepository.findAllDynamicFieldsByLangCode("eng", pageRequest)).thenReturn(fieldPagedResult); LocalDateTime currentTimeStamp = LocalDateTime.now(ZoneOffset.UTC); dynamicFieldService.getAllDynamicField(0, 10, "cr_dtimes", "desc", "eng", null, currentTimeStamp); } - + @Test @WithUserDetails("global-admin") - public void testCreateDynamicField() throws Exception { + public void testCreateDynamicField() throws Exception { Mockito.when(dynamicFieldRepository.create(Mockito.any(DynamicField.class))).thenReturn(bloodTypeField); - + DynamicFieldDto dto = new DynamicFieldDto(); dto.setName("bloodType"); dto.setDataType("simpleType"); @@ -185,112 +187,112 @@ public void testCreateDynamicField() throws Exception { dynamicFieldService.createDynamicField(dto); } - + @Test(expected = DataNotFoundException.class) @WithUserDetails("global-admin") - public void testUpdateDynamicField() throws Exception { - Mockito.when(dynamicFieldRepository.updateDynamicField(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), + public void testUpdateDynamicField() throws Exception { + Mockito.when(dynamicFieldRepository.updateDynamicField(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.any(LocalDateTime.class), Mockito.anyString(), Mockito.anyString())).thenReturn(0); - + Mockito.when(dynamicFieldRepository.findDynamicFieldById(Mockito.anyString())).thenReturn(bloodTypeField); - + DynamicFieldPutDto dto = new DynamicFieldPutDto(); dto.setName("bloodType"); dto.setDataType("simpleType"); dto.setLangCode("eng"); dto.setFieldVal(new ObjectMapper().readTree("{\"code\":\"oo\",\"value\":\"ooo\"}")); - + dynamicFieldService.updateDynamicField("1233", dto); } - + @Test @WithUserDetails("reg-officer") - public void testFetchAllIdentitySchema() throws Exception { - Mockito.when(identitySchemaRepository.findAllIdentitySchema(true, pageRequest)).thenReturn(schemaPagedResult); + public void testFetchAllIdentitySchema() throws Exception { + Mockito.when(identitySchemaRepository.findAllIdentitySchema(true, pageRequest)).thenReturn(schemaPagedResult); PageDto resp = identitySchemaService.getAllSchema(0, 10, "cr_dtimes", "desc"); assertEquals(2, resp.getTotalItems()); } - + @Test @WithUserDetails("reg-officer") - public void testFetchLatestIdentitySchema() throws Exception { - Mockito.when(identitySchemaRepository.findLatestPublishedIdentitySchema()).thenReturn(publishedSchema); + public void testFetchLatestIdentitySchema() throws Exception { + Mockito.when(identitySchemaRepository.findLatestPublishedIdentitySchema()).thenReturn(publishedSchema); IdSchemaResponseDto resp = identitySchemaService.getLatestSchema(); assertEquals("PUBLISHED", resp.getStatus()); } - + @Test @WithUserDetails("global-admin") - public void testCreateIdentitySchema() throws Exception { + public void testCreateIdentitySchema() throws Exception { Mockito.when(identitySchemaRepository.create(Mockito.any(IdentitySchema.class))).thenReturn(draftSchema); IdentitySchemaDto dto = new IdentitySchemaDto(); dto.setTitle("test"); dto.setSchema("{\"$schema\":\"http:\\/\\/json-schema.org\\/draft-07\\/schema#\",\"description\":\"test schema\",\"additionalProperties\":false,\"title\":\"test schema\",\"type\":\"object\",\"definitions\":{\"simpleType\":{\"uniqueItems\":true,\"additionalItems\":false,\"type\":\"array\",\"items\":{\"additionalProperties\":false,\"type\":\"object\",\"required\":[\"language\",\"value\"],\"properties\":{\"language\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"}}}},\"documentType\":{\"additionalProperties\":false,\"type\":\"object\",\"required\":[\"format\",\"type\",\"value\"],\"properties\":{\"refNumber\":{\"type\":\"string\"},\"format\":{\"type\":\"string\"},\"type\":{\"type\":\"string\"},\"value\":{\"type\":\"string\"}}},\"biometricsType\":{\"additionalProperties\":false,\"type\":\"object\",\"properties\":{\"format\":{\"type\":\"string\"},\"version\":{\"type\":\"number\",\"minimum\":0},\"value\":{\"type\":\"string\"}}}},\"properties\":{\"identity\":{\"additionalProperties\":false,\"type\":\"object\",\"required\":[\"IDSchemaVersion\",\"fullName\",\"dateOfBirth\",\"gender\",\"addressLine1\",\"addressLine2\",\"addressLine3\",\"region\",\"province\",\"city\",\"zone\",\"postalCode\",\"phone\",\"email\",\"modeOfClaim\",\"proofOfIdentity\",\"individualBiometrics\"],\"properties\":{\"proofOfAddress\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/documentType\"},\"gender\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"city\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{0,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"modeOfClaim\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"dynamic\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"postalCode\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^[(?i)A-Z0-9]{5}$|^NA$\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"proofOfException-1\":{\"bioAttributes\":[],\"fieldCategory\":\"evidence\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/documentType\"},\"referenceIdentityNumber\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^([0-9]{10,30})$\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"kyc\",\"type\":\"string\",\"fieldType\":\"default\"},\"individualBiometrics\":{\"bioAttributes\":[\"leftEye\",\"rightEye\",\"rightIndex\",\"rightLittle\",\"rightRing\",\"rightMiddle\",\"leftIndex\",\"leftLittle\",\"leftRing\",\"leftMiddle\",\"leftThumb\",\"rightThumb\",\"face\"],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/biometricsType\"},\"province\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{0,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"zone\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"proofOfDateOfBirth\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/documentType\"},\"addressLine1\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{0,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"addressLine2\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{3,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"residenceStatus\":{\"bioAttributes\":[],\"fieldCategory\":\"kyc\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"addressLine3\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{3,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"email\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^[A-Za-z0-9_\\\\-]+(\\\\.[A-Za-z0-9_]+)*@[A-Za-z0-9_-]+(\\\\.[A-Za-z0-9_]+)*(\\\\.[a-zA-Z]{2,})$\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"parentOrGuardianRID\":{\"bioAttributes\":[],\"fieldCategory\":\"evidence\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"parentOrGuardianBiometrics\":{\"bioAttributes\":[\"leftEye\",\"rightEye\",\"rightIndex\",\"rightLittle\",\"rightRing\",\"rightMiddle\",\"leftIndex\",\"leftLittle\",\"leftRing\",\"leftMiddle\",\"leftThumb\",\"rightThumb\",\"face\"],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/biometricsType\"},\"fullName\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{3,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"dateOfBirth\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(1869|18[7-9][0-9]|19[0-9][0-9]|20[0-9][0-9])\\/([0][1-9]|1[0-2])\\/([0][1-9]|[1-2][0-9]|3[01])$\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"individualAuthBiometrics\":{\"bioAttributes\":[\"leftEye\",\"rightEye\",\"rightIndex\",\"rightLittle\",\"rightRing\",\"rightMiddle\",\"leftIndex\",\"leftLittle\",\"leftRing\",\"leftMiddle\",\"leftThumb\",\"rightThumb\",\"face\"],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/biometricsType\"},\"parentOrGuardianUIN\":{\"bioAttributes\":[],\"fieldCategory\":\"evidence\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"proofOfIdentity\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/documentType\"},\"IDSchemaVersion\":{\"bioAttributes\":[],\"fieldCategory\":\"none\",\"format\":\"none\",\"type\":\"number\",\"fieldType\":\"default\",\"minimum\":0},\"proofOfException\":{\"bioAttributes\":[],\"fieldCategory\":\"evidence\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/documentType\"},\"phone\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^[+]*([0-9]{1})([0-9]{9})$\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"parentOrGuardianName\":{\"bioAttributes\":[],\"fieldCategory\":\"evidence\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"},\"proofOfRelationship\":{\"bioAttributes\":[],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/documentType\"},\"UIN\":{\"bioAttributes\":[],\"fieldCategory\":\"none\",\"format\":\"none\",\"type\":\"string\",\"fieldType\":\"default\"},\"region\":{\"bioAttributes\":[],\"validators\":[{\"validator\":\"^(?=.{0,50}$).*\",\"arguments\":[],\"type\":\"regex\"}],\"fieldCategory\":\"pvt\",\"format\":\"none\",\"fieldType\":\"default\",\"$ref\":\"#\\/definitions\\/simpleType\"}}}}}"); //dto.setSchema(new ArrayList()); dto.setDescription("test"); - - IdSchemaResponseDto resp = identitySchemaService.createSchema(dto); + + IdSchemaResponseDto resp = identitySchemaService.createSchema(dto); assertEquals("DRAFT", resp.getStatus()); } - - + + @Test @WithUserDetails("global-admin") - public void testUpdateIdentitySchema() throws Exception { -// Mockito.when(identitySchemaRepository.updateIdentitySchema(Mockito.anyString(), Mockito.anyString(), + public void testUpdateIdentitySchema() throws Exception { +// Mockito.when(identitySchemaRepository.updateIdentitySchema(Mockito.anyString(), Mockito.anyString(), // Mockito.anyBoolean(), Mockito.any(LocalDateTime.class), Mockito.anyString())).thenReturn(1); Mockito.when(identitySchemaRepository.findIdentitySchemaById(Mockito.anyString())).thenReturn(draftSchema); - + IdentitySchemaDto dto = new IdentitySchemaDto(); dto.setTitle("test"); //dto.setSchema(new ArrayList()); - + IdSchemaResponseDto resp = identitySchemaService.updateSchema(draftSchema.getId(), dto); assertEquals("DRAFT", resp.getStatus()); } - + @Test @WithUserDetails("global-admin") - public void testPublishIdentitySchema() throws Exception { - Mockito.when(identitySchemaRepository.publishIdentitySchema(Mockito.anyString(), Mockito.anyString(), + public void testPublishIdentitySchema() throws Exception { + Mockito.when(identitySchemaRepository.publishIdentitySchema(Mockito.anyString(), Mockito.anyString(), Mockito.any(LocalDateTime.class), Mockito.any(LocalDateTime.class), Mockito.anyString(), Mockito.anyDouble())).thenReturn(1); - + Mockito.when(identitySchemaRepository.findIdentitySchemaById(Mockito.anyString())).thenReturn(draftSchema); - + IdSchemaPublishDto dto = new IdSchemaPublishDto(); dto.setEffectiveFrom(LocalDateTime.now().plusDays(1)); dto.setId("test-test-test-test"); assertEquals(dto.getId(), identitySchemaService.publishSchema(dto)); } - + @Test @WithUserDetails("global-admin") - public void testPublishAlreadyPublishedIdentitySchema() throws Exception { - Mockito.when(identitySchemaRepository.publishIdentitySchema(Mockito.anyString(), Mockito.anyString(), + public void testPublishAlreadyPublishedIdentitySchema() throws Exception { + Mockito.when(identitySchemaRepository.publishIdentitySchema(Mockito.anyString(), Mockito.anyString(), Mockito.any(LocalDateTime.class), Mockito.any(LocalDateTime.class), Mockito.anyString(), Mockito.anyDouble())).thenReturn(1); - + Mockito.when(identitySchemaRepository.findIdentitySchemaById(Mockito.anyString())).thenReturn(publishedSchema); - + IdSchemaPublishDto dto = new IdSchemaPublishDto(); dto.setEffectiveFrom(LocalDateTime.now().plusDays(1)); dto.setId("test-test-test-test"); - + try { identitySchemaService.publishSchema(dto); } catch(MasterDataServiceException e) { assertEquals(SchemaErrorCode.SCHEMA_ALREADY_PUBLISHED.getErrorCode(), e.getErrorCode()); } } - + @Test @WithUserDetails("global-admin") - public void testPublishIdentitySchemaWithException() throws Exception { - Mockito.when(identitySchemaRepository.publishIdentitySchema(Mockito.anyString(), Mockito.anyString(), + public void testPublishIdentitySchemaWithException() throws Exception { + Mockito.when(identitySchemaRepository.publishIdentitySchema(Mockito.anyString(), Mockito.anyString(), Mockito.any(LocalDateTime.class), Mockito.any(LocalDateTime.class), Mockito.anyString(),Mockito.anyDouble())).thenReturn(1); - + Mockito.when(identitySchemaRepository.findIdentitySchemaById(Mockito.anyString())).thenReturn(draftSchema); - + IdSchemaPublishDto dto = new IdSchemaPublishDto(); dto.setEffectiveFrom(LocalDateTime.now()); dto.setId("test-test-test-test"); @@ -298,32 +300,32 @@ public void testPublishIdentitySchemaWithException() throws Exception { identitySchemaService.publishSchema(dto); } catch(MasterDataServiceException e) { assertEquals(SchemaErrorCode.SCHEMA_EFFECTIVE_FROM_IS_OLDER.getErrorCode(), e.getErrorCode()); - } + } } - - + + @Test @WithUserDetails("global-admin") - public void testDeleteIdentitySchema() throws Exception { - Mockito.when(identitySchemaRepository.deleteIdentitySchema(Mockito.anyString(), Mockito.any(LocalDateTime.class), - Mockito.anyString())).thenReturn(1); + public void testDeleteIdentitySchema() throws Exception { + Mockito.when(identitySchemaRepository.deleteIdentitySchema(Mockito.anyString(), Mockito.any(LocalDateTime.class), + Mockito.anyString())).thenReturn(1); identitySchemaService.deleteSchema("test-test"); } - + @Test(expected = RequestException.class) @WithUserDetails("global-admin") - public void testDeleteIdentitySchemaFailed() throws Exception { - Mockito.when(identitySchemaRepository.deleteIdentitySchema(Mockito.anyString(), Mockito.any(LocalDateTime.class), - Mockito.anyString())).thenReturn(0); + public void testDeleteIdentitySchemaFailed() throws Exception { + Mockito.when(identitySchemaRepository.deleteIdentitySchema(Mockito.anyString(), Mockito.any(LocalDateTime.class), + Mockito.anyString())).thenReturn(0); identitySchemaService.deleteSchema("test-test"); } - + @Test(expected = MasterDataServiceException.class) @WithUserDetails("global-admin") - public void testDeleteIdentitySchemaFailedUpdate() throws Exception { - Mockito.when(identitySchemaRepository.deleteIdentitySchema(Mockito.anyString(), Mockito.any(LocalDateTime.class), - Mockito.anyString())).thenThrow(DataAccessLayerException.class); + public void testDeleteIdentitySchemaFailedUpdate() throws Exception { + Mockito.when(identitySchemaRepository.deleteIdentitySchema(Mockito.anyString(), Mockito.any(LocalDateTime.class), + Mockito.anyString())).thenThrow(DataAccessLayerException.class); identitySchemaService.deleteSchema("test-test"); } -} \ No newline at end of file +} diff --git a/admin/kernel-syncdata-service/pom.xml b/admin/kernel-syncdata-service/pom.xml index e667992da17..d4e7a451334 100644 --- a/admin/kernel-syncdata-service/pom.xml +++ b/admin/kernel-syncdata-service/pom.xml @@ -7,7 +7,7 @@ kernel-syncdata-service Mosip commons project https://github.com/mosip/commons - 1.2.1.0 + 1.2.0.1 UTF-8 @@ -457,7 +457,7 @@ io.mosip.kernel kernel-auth-adapter - ${kernel-auth-adapter.version} + ${project.version} diff --git a/admin/pom.xml b/admin/pom.xml index 5b006accce8..e792816f053 100644 --- a/admin/pom.xml +++ b/admin/pom.xml @@ -6,7 +6,7 @@ io.mosip.admin admin-parent - 1.2.1.0 + 1.2.0.1 pom admin @@ -167,7 +167,6 @@ 0.6.0 2.0.0.AM2 1.2.0.1 - 1.2.0.1 **/repositories/**,**/constant/**,**/config/**,**/httpfilter/**,**/cache/**,**/dto/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/security/**,**/*Config.java,**/*BootApplication.java,**/*VertxApplication.java,**/cbeffutil/**,**/*Util.java,**/helper/beans/**,**/OptionalFilter.java,**/*Enum.java,**/validator.registereddevice/**,**/DeviceProvider*.java,**/DeviceRegister*.java,**/FoundationalTrustProvider*.java,**/GenderType*.java,**/IndividualType*.java,**/MOSIPDeviceService*.java,**/RegisteredDevice*.java,**/RegistrationCenterDeviceHistoryServiceImpl.java,**/RegistrationCenterMachineUserServiceHistoryImpl.java **/dto/**,**/entity/**,**/config/** @@ -234,7 +233,7 @@ io.mosip.kernel kernel-auth-adapter - ${kernel-auth-adapter.version} + ${kernel.version} diff --git a/db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_rollback.sql b/db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_rollback.sql deleted file mode 100644 index 5548b94e9cb..00000000000 --- a/db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_rollback.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_upgrade.sql b/db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_upgrade.sql deleted file mode 100644 index 5548b94e9cb..00000000000 --- a/db_upgrade_scripts/mosip_hotlist/sql/1.2.0.1_to_1.2.1.0_upgrade.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_rollback.sql b/db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_rollback.sql deleted file mode 100644 index 5548b94e9cb..00000000000 --- a/db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_rollback.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_upgrade.sql b/db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_upgrade.sql deleted file mode 100644 index 5548b94e9cb..00000000000 --- a/db_upgrade_scripts/mosip_master/sql/1.2.0.1_to_1.2.1.0_upgrade.sql +++ /dev/null @@ -1 +0,0 @@ -\echo 'Upgrade Queries not required for transition from $CURRENT_VERSION to $UPGRADE_VERSION' diff --git a/deploy/.gitignore b/deploy/.gitignore deleted file mode 100644 index 50c9af9f322..00000000000 --- a/deploy/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ui_values.yaml diff --git a/deploy/README.md b/deploy/README.md deleted file mode 100644 index 67984445fbc..00000000000 --- a/deploy/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Admin module - -## Install -``` -./install.sh -``` - -## Admin proxy -Admin service accesses other services like Materdata and Keymanager and currently there is only one URL that is used to connect to both these services. This will get fixed in future versions, but as a an interim solution, Admin Proxy docker has been created, which is basically an Nginx proxy connecting to the above services with these URLs: -``` -http://admin-proxy/v1/masterdata -http://admin-proxy/v1/keymanager -``` -The proxy is installed as part of `install.sh` script. - -## Admin user -1. In Keycloak, create a user in `mosip` realm called `globaladmin` and assign role `GLOBAL_ADMIN`. Make sure this user has strong credentials. -2. Use this user to login into Admin portal via Keycloak. (Note that this user is already on-boarded as default user while uploading masterdata XLS in Kernel module) -3. _Strongly Recommended_: Create another user in keycloak with authentic name, email, details, strong password and `GLOBAL_ADMIN` role. Assign global zone to this user via Admin portal, and then delete `globaladmin` from Keycloak and masterdata DB. - -## Admin portal -Access the portal with following URL: -``` -https:///admin-ui/ - -Example: -https://api-internal.sandbox.xyz.net/admin-ui/ -``` -Your wireguard client must be running for this access. - -## Onboarding -Use the portal to onboard user, machine, center. - -Note that for onboarding a user (like a Zonal Admin or Registration Officer), -1. Create user in Keycloak with appropriate role. -1. Map the user to a Zone using Admin portal. -1. Map user to a registration center (in case of Registration Officer/Supervisor) using Admin portal. - diff --git a/deploy/admin-proxy.yaml b/deploy/admin-proxy.yaml deleted file mode 100644 index 9ac26daa837..00000000000 --- a/deploy/admin-proxy.yaml +++ /dev/null @@ -1,137 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: admin-proxy - name: admin-proxy -spec: - replicas: 1 - selector: - matchLabels: - app: admin-proxy - template: - metadata: - labels: - app: admin-proxy - spec: - containers: - - name: admin-proxy - image: nginxinc/nginx-unprivileged:1.21.6-alpine - ports: - - name: http - containerPort: 8080 - livenessProbe: - httpGet: - path: "/ping" - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 20 - timeoutSeconds: 1 - failureThreshold: 2 - successThreshold: 1 - readinessProbe: - httpGet: - path: "/ping" - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 1 - failureThreshold: 2 - successThreshold: 1 - - volumeMounts: - - name: nginx-conf - mountPath: /etc/nginx/ - volumes: - - name: nginx-conf - configMap: - name: admin-proxy ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: admin-proxy -data: - nginx.conf: |- - worker_processes auto; - error_log /var/log/nginx/error.log notice; - pid /tmp/nginx.pid; - events { - worker_connections 1024; - } - http { - proxy_temp_path /tmp/proxy_temp; - client_body_temp_path /tmp/client_temp; - fastcgi_temp_path /tmp/fastcgi_temp; - uwsgi_temp_path /tmp/uwsgi_temp; - scgi_temp_path /tmp/scgi_temp; - - #include /etc/nginx/mime.types; - #default_type application/octet-stream; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - access_log /var/log/nginx/access.log main; - - proxy_buffer_size 128k; - proxy_buffers 4 256k; - proxy_busy_buffers_size 256k; - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - gzip on; - - server { - listen 8080; - - location /v1/masterdata { - proxy_pass http://masterdata.kernel; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header Referer $http_referer; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass_request_headers on; - } - - location /v1/keymanager { - proxy_pass http://keymanager.keymanager; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header Host $host; - proxy_set_header Referer $http_referer; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_pass_request_headers on; - } - location /ping { - return 200 'ping'; - } - } - } ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: admin-proxy - name: admin-proxy -spec: - type: ClusterIP - ports: - - name: http - port: 80 - protocol: TCP - targetPort: 8080 - selector: - app: admin-proxy diff --git a/deploy/copy_cm.sh b/deploy/copy_cm.sh deleted file mode 100755 index 3dde9b90d39..00000000000 --- a/deploy/copy_cm.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# Copy configmaps from other namespaces -# DST_NS: Destination namespace - -function copying_cm() { - COPY_UTIL=./copy_cm_func.sh - DST_NS=admin - - $COPY_UTIL configmap global default $DST_NS - $COPY_UTIL configmap artifactory-share artifactory $DST_NS - $COPY_UTIL configmap config-server-share config-server $DST_NS - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -copying_cm # calling function - diff --git a/deploy/copy_cm_func.sh b/deploy/copy_cm_func.sh deleted file mode 100755 index 185ae3e5f4a..00000000000 --- a/deploy/copy_cm_func.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copy configmap and secret from one namespace to another. -# ./copy_cm_func.sh [name] -# Parameters: -# resource: configmap|secret -# name: Optional new name of the configmap or secret in destination namespace. This may be needed if there is -# clash of names - -if [ $1 = "configmap" ] -then - RESOURCE=configmap -elif [ $1 = "secret" ] -then - RESOURCE=secret -else - echo "Incorrect resource $1. Exiting.." - exit 1 -fi - - -if [ $# -ge 5 ] -then - kubectl -n $4 delete --ignore-not-found=true $RESOURCE $5 - kubectl -n $3 get $RESOURCE $2 -o yaml | sed "s/namespace: $3/namespace: $4/g" | sed "s/name: $2/name: $5/g" | kubectl -n $4 create -f - -else - kubectl -n $4 delete --ignore-not-found=true $RESOURCE $2 - kubectl -n $3 get $RESOURCE $2 -o yaml | sed "s/namespace: $3/namespace: $4/g" | kubectl -n $4 create -f - -fi - - - - - diff --git a/deploy/delete.sh b/deploy/delete.sh deleted file mode 100755 index 0e4225aaac2..00000000000 --- a/deploy/delete.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Uninstalls all admin helm charts -## Usage: ./delete.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -function deleting_admin() { - NS=admin - while true; do - read -p "Are you sure you want to delete ALL Admin helm charts?(Y/n) " yn - if [ $yn = "Y" ] - then - kubectl delete -n $NS -f admin-proxy.yaml - helm -n $NS delete admin-hotlist - helm -n $NS delete admin-service - helm -n $NS delete admin-ui - break - else - break - fi - done - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -deleting_admin # calling function \ No newline at end of file diff --git a/deploy/install.sh b/deploy/install.sh deleted file mode 100755 index e59847f1e38..00000000000 --- a/deploy/install.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# Installs the admin module -# Make sure you have updated ui_values.yaml -## Usage: ./install.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -NS=admin -NS_KERNEL=kernel -CHART_VERSION=12.1.0 -ADMIN_UI_CHART_VERSION=12.0.1 - -echo Create $NS namespace -kubectl create ns $NS - -function installing_admin() { - echo Istio label - kubectl label ns $NS istio-injection=enabled --overwrite - helm repo update - - echo Copy configmaps - sed -i 's/\r$//' copy_cm.sh - ./copy_cm.sh - - API_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-api-internal-host}) - ADMIN_HOST=$(kubectl get cm global -o jsonpath={.data.mosip-admin-host}) - - echo Installing Admin-Proxy into Masterdata and Keymanager. - kubectl -n $NS apply -f admin-proxy.yaml - - echo Installing admin hotlist service. - helm -n $NS install admin-hotlist mosip/admin-hotlist --version $CHART_VERSION - - echo Installing admin service. Will wait till service gets installed. - helm -n $NS install admin-service mosip/admin-service --set istio.corsPolicy.allowOrigins\[0\].prefix=https://$ADMIN_HOST --wait --version $CHART_VERSION - - echo Installing admin-ui - helm -n $NS install admin-ui mosip/admin-ui --set admin.apiUrl=https://$API_HOST/v1/ --set istio.hosts\[0\]=$ADMIN_HOST --version $ADMIN_UI_CHART_VERSION - - kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status - - echo Installed admin services - - echo "Admin portal URL: https://$ADMIN_HOST/admin-ui/" - - echo Installing masterdata and allowing Admin UI to access masterdata services. - helm -n $NS_KERNEL install masterdata mosip/masterdata --set istio.corsPolicy.allowOrigins\[0\].exact=https://$ADMIN_HOST --version $CHART_VERSION - - echo Installing syncdata - helm -n $NS_KERNEL install syncdata mosip/syncdata --version $CHART_VERSION - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -installing_admin # calling function diff --git a/deploy/restart.sh b/deploy/restart.sh deleted file mode 100755 index a4ecfe2c2c9..00000000000 --- a/deploy/restart.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Restarts the admin services -## Usage: ./restart.sh [kubeconfig] - -if [ $# -ge 1 ] ; then - export KUBECONFIG=$1 -fi - -function Restarting_admin() { - NS=admin - kubectl -n $NS rollout restart deploy - - kubectl -n $NS get deploy -o name | xargs -n1 -t kubectl -n $NS rollout status - - echo Restarted admin services - return 0 -} - -# set commands for error handling. -set -e -set -o errexit ## set -e : exit the script if any statement returns a non-true return value -set -o nounset ## set -u : exit the script if you try to use an uninitialised variable -set -o errtrace # trace ERR through 'time command' and other functions -set -o pipefail # trace ERR through pipes -Restarting_admin # calling function \ No newline at end of file diff --git a/helm/admin-hotlist/.gitignore b/helm/admin-hotlist/.gitignore deleted file mode 100644 index ee3892e8794..00000000000 --- a/helm/admin-hotlist/.gitignore +++ /dev/null @@ -1 +0,0 @@ -charts/ diff --git a/helm/admin-hotlist/.helmignore b/helm/admin-hotlist/.helmignore deleted file mode 100644 index f0c13194444..00000000000 --- a/helm/admin-hotlist/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/admin-hotlist/Chart.yaml b/helm/admin-hotlist/Chart.yaml deleted file mode 100644 index d63b40a1105..00000000000 --- a/helm/admin-hotlist/Chart.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v2 -name: admin-hotlist -description: A Helm chart for MOSIP Admin Hotlist -type: application -version: 12.1.0 -appVersion: "" -dependencies: - - name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -home: https://mosip.io -keywords: - - mosip - - admin - - hotlist -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/admin-hotlist/README.md b/helm/admin-hotlist/README.md deleted file mode 100644 index f8f88a7727c..00000000000 --- a/helm/admin-hotlist/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Admin Hotlist - -Helm chart for installing MOSIP Admin Hotlist - -## TL;DR - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/admin -``` diff --git a/helm/admin-hotlist/templates/NOTES.txt b/helm/admin-hotlist/templates/NOTES.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/helm/admin-hotlist/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/helm/admin-hotlist/templates/_helpers.tpl b/helm/admin-hotlist/templates/_helpers.tpl deleted file mode 100644 index 04da4f681e9..00000000000 --- a/helm/admin-hotlist/templates/_helpers.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "admin-hotlist.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "admin-hotlist.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "admin-hotlist.imagePullSecrets" -}} -{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "admin-hotlist.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s-foo" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "admin-hotlist.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "admin-hotlist.validateValues.foo" .) -}} -{{- $messages := append $messages (include "admin-hotlist.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "admin-hotlist.podAnnotations" -}} -{{- if .Values.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} -{{- end }} -{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} -{{- end }} -{{- end -}} diff --git a/helm/admin-hotlist/templates/clusterrolebinding.yaml b/helm/admin-hotlist/templates/clusterrolebinding.yaml deleted file mode 100644 index 443ca8e924e..00000000000 --- a/helm/admin-hotlist/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "admin-hotlist.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/admin-hotlist/templates/deployment.yaml b/helm/admin-hotlist/templates/deployment.yaml deleted file mode 100644 index ee278401891..00000000000 --- a/helm/admin-hotlist/templates/deployment.yaml +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - {{- if .Values.updateStrategy }} - strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} - {{- end }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if or .Values.podAnnotations .Values.metrics.enabled }} - {{- include "admin-hotlist.podAnnotations" . | nindent 8 }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "admin-hotlist.serviceAccountName" . }} - {{- include "admin-hotlist.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName | quote }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - initContainers: - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{ include "admin-hotlist.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - command: - - %%commands%% - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: foo - mountPath: bar - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: admin-hotlist - image: {{ template "admin-hotlist.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: container_user - value: {{ .Values.containerSecurityContext.runAsUser }} - - name: JDK_JAVA_OPTIONS - value: {{ .Values.additionalResources.javaOpts }} - {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - envFrom: - {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} - ports: - - name: spring-service - containerPort: {{ .Values.springServicePort }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} diff --git a/helm/admin-hotlist/templates/extra-list.yaml b/helm/admin-hotlist/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e16f..00000000000 --- a/helm/admin-hotlist/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/helm/admin-hotlist/templates/service-account.yaml b/helm/admin-hotlist/templates/service-account.yaml deleted file mode 100644 index 72a341c954f..00000000000 --- a/helm/admin-hotlist/templates/service-account.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "admin-hotlist.serviceAccountName" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/admin-hotlist/templates/service.yaml b/helm/admin-hotlist/templates/service.yaml deleted file mode 100644 index 93fdc92b3da..00000000000 --- a/helm/admin-hotlist/templates/service.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - name: http - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.springServicePort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/admin-hotlist/templates/servicemonitor.yaml b/helm/admin-hotlist/templates/servicemonitor.yaml deleted file mode 100644 index 15f48fdeecf..00000000000 --- a/helm/admin-hotlist/templates/servicemonitor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ template "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ .Release.Namespace | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: {{ .Values.springServicePort }} - path: {{ .Values.metrics.endpointPath }} - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.honorLabels }} - honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabellings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace | quote }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/admin-hotlist/templates/virtualservice.yaml b/helm/admin-hotlist/templates/virtualservice.yaml deleted file mode 100644 index 17a2ca4d734..00000000000 --- a/helm/admin-hotlist/templates/virtualservice.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.istio.enabled }} -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: {{ template "common.names.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - hosts: - - "*" - gateways: - {{- include "common.tplvalues.render" ( dict "value" .Values.istio.gateways "context" $ ) | nindent 4 }} - http: - - match: - - uri: - prefix: {{ .Values.istio.prefix }} - route: - - destination: - host: {{ template "common.names.fullname" . }} - port: - number: {{ .Values.service.port }} - headers: - request: - set: - x-forwarded-proto: https -{{- end }} diff --git a/helm/admin-hotlist/values.yaml b/helm/admin-hotlist/values.yaml deleted file mode 100644 index 53297b8bec0..00000000000 --- a/helm/admin-hotlist/values.yaml +++ /dev/null @@ -1,420 +0,0 @@ -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry and imagePullSecrets -## -# global: -# imageRegistry: myRegistryName -# imagePullSecrets: -# - myRegistryKeySecretName -# storageClass: myStorageClass - -## Add labels to all the deployed resources -## -commonLabels: - app.kubernetes.io/component: mosip - -## Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Kubernetes Cluster Domain -## -clusterDomain: cluster.local - -## Extra objects to deploy (value evaluated as a template) -## -extraDeploy: [] - -## Number of nodes -## -replicaCount: 1 - -service: - type: ClusterIP - port: 80 - ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) - ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer - ## - ## loadBalancerIP: - ## - ## nodePorts: - ## http: - ## https: - ## - nodePorts: - http: "" - https: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - -image: - registry: docker.io - repository: mosipid/hotlist-service - tag: 1.2.1.0 - - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - # pullSecrets: - # - myRegistryKeySecretName - -## Port on which this particular spring service module is running. -springServicePort: 8095 - -## Configure extra options for liveness and readiness probes -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## -startupProbe: - enabled: true - httpGet: - path: /v1/hotlist/actuator/health - port: 8095 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: /v1/hotlist/actuator/health - port: 8095 - initialDelaySeconds: 20 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: /v1/hotlist/actuator/health - port: 8095 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -## -# existingConfigmap: - -## Command and args for running the container (set to default if not set). Use array form -## -command: [] -args: [] - -## Deployment pod host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] - -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 300m - memory: 1500Mi - requests: - cpu: 100m - memory: 1000Mi - -additionalResources: - ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources - ## Example: java_opts: "-Xms500M -Xmx500M" - javaOpts: "-Xms750M -Xmx750M" - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -## Clamav container already runs as 'mosip' user, so we may not need to enable this -containerSecurityContext: - enabled: false - runAsUser: mosip - runAsNonRoot: true - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: - enabled: false - fsGroup: 1001 - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - ## - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Pod extra labels -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} - -## Annotations for server pods. -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## pods' priority. -## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -# priorityClassName: "" - -## lifecycleHooks for the container to automate configuration before or after startup. -## -lifecycleHooks: {} - -## Custom Liveness probes for -## -customLivenessProbe: {} - -## Custom Rediness probes -## -customReadinessProbe: {} - -## Update strategy - only really applicable for deployments with RWO PVs attached -## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the -## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will -## terminate the single previous pod, so that the new, incoming pod can attach to the PV -## -updateStrategy: - type: RollingUpdate - -## Additional environment variables to set -## Example: -## extraEnvVars: -## - name: FOO -## value: "bar" -## -extraEnvVars: [] - -## ConfigMap with extra environment variables -## -extraEnvVarsCM: - - global - - config-server-share - - artifactory-share - -## Secret with extra environment variables -## -extraEnvVarsSecret: - -## Extra volumes to add to the deployment -## -extraVolumes: [] - -## Extra volume mounts to add to the container -## -extraVolumeMounts: [] - -## Add init containers to the pods. -## Example: -## initContainers: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -initContainers: {} - -## Add sidecars to the pods. -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: {} - -persistence: - enabled: false - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack). - ## - # storageClass: "-" - ## - ## If you want to reuse an existing claim, you can pass the name of the PVC using - ## the existingClaim variable - # existingClaim: your-claim - ## ReadWriteMany not supported by AWS gp2 - storageClass: - accessModes: - - ReadWriteOnce - size: 10M - existingClaim: - # Dir where config and keys are written inside container - mountDir: - -## Init containers parameters: -## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. -## -volumePermissions: - enabled: false - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: "10" - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - ## - myRegistryKeySecretName - ## Init containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - ## We usually recommend not to specify default resources and to leave this as a conscious - ## choice for the user. This also increases chances charts run on environments with little - ## resources, such as Minikube. If you do want to specify resources, uncomment the following - ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. - ## - limits: {} - ## cpu: 100m - ## memory: 128Mi - ## - requests: {} - ## cpu: 100m - ## memory: 128Mi - ## - -## Specifies whether RBAC resources should be created -## -rbac: - create: true - -## Specifies whether a ServiceAccount should be created -## -serviceAccount: - create: true - ## The name of the ServiceAccount to use. - ## If not set and create is true, a name is generated using the fullname template - ## - name: - -## Prometheus Metrics -## -metrics: - enabled: true - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /v1/hotlist/actuator/prometheus - - ## Prometheus Service Monitor - ## ref: https://github.com/coreos/prometheus-operator - ## - serviceMonitor: - ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry - ## - enabled: true - ## Specify the namespace in which the serviceMonitor resource will be created - ## - # namespace: "" - ## Specify the interval at which metrics should be scraped - ## - interval: 10s - ## Specify the timeout after which the scrape is ended - ## - # scrapeTimeout: 30s - ## Specify Metric Relabellings to add to the scrape endpoint - ## - # relabellings: - ## Specify honorLabels parameter to add the scrape endpoint - ## - honorLabels: false - ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec - ## - additionalLabels: {} - - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - enabled: false - additionalLabels: {} - namespace: '' - ## List of rules, used as template by Helm. - ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html - # rules: - # - alert: RabbitmqDown - # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 - # for: 5m - # labels: - # severity: error - rules: [] - -## Admin swagger should have only internal access. Hence linked to internal gateway -istio: - enabled: true - gateways: - - istio-system/internal - prefix: /v1/hotlist diff --git a/helm/admin-service/.gitignore b/helm/admin-service/.gitignore deleted file mode 100644 index ee3892e8794..00000000000 --- a/helm/admin-service/.gitignore +++ /dev/null @@ -1 +0,0 @@ -charts/ diff --git a/helm/admin-service/.helmignore b/helm/admin-service/.helmignore deleted file mode 100644 index f0c13194444..00000000000 --- a/helm/admin-service/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/admin-service/Chart.yaml b/helm/admin-service/Chart.yaml deleted file mode 100644 index 12c30e721fc..00000000000 --- a/helm/admin-service/Chart.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v2 -name: admin-service -description: A Helm chart for MOSIP Admin module -type: application -version: 12.1.0 -appVersion: "" -dependencies: - - name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -home: https://mosip.io -keywords: - - mosip - - admin - - kernel -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/admin-service/README.md b/helm/admin-service/README.md deleted file mode 100644 index cce818acbb9..00000000000 --- a/helm/admin-service/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Admin Service - -Helm chart for installing MOSIP Admin module - -## TL;DR - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/admin -``` diff --git a/helm/admin-service/templates/NOTES.txt b/helm/admin-service/templates/NOTES.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/helm/admin-service/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/helm/admin-service/templates/_helpers.tpl b/helm/admin-service/templates/_helpers.tpl deleted file mode 100644 index d0eec1758a0..00000000000 --- a/helm/admin-service/templates/_helpers.tpl +++ /dev/null @@ -1,58 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "admin-service.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "admin-service.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "admin-service.imagePullSecrets" -}} -{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "admin-service.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s-foo" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "admin-service.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "admin-service.validateValues.foo" .) -}} -{{- $messages := append $messages (include "admin-service.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "admin-service.podAnnotations" -}} -{{- if .Values.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} -{{- end }} -{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} -{{- end }} -{{- end -}} diff --git a/helm/admin-service/templates/clusterrolebinding.yaml b/helm/admin-service/templates/clusterrolebinding.yaml deleted file mode 100644 index 25ca93ae85b..00000000000 --- a/helm/admin-service/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "admin-service.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/admin-service/templates/deployment.yaml b/helm/admin-service/templates/deployment.yaml deleted file mode 100644 index 8477d8fd1bd..00000000000 --- a/helm/admin-service/templates/deployment.yaml +++ /dev/null @@ -1,133 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - {{- if .Values.updateStrategy }} - strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} - {{- end }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if or .Values.podAnnotations .Values.metrics.enabled }} - {{- include "admin-service.podAnnotations" . | nindent 8 }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "admin-service.serviceAccountName" . }} - {{- include "admin-service.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName | quote }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - initContainers: - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{ include "admin-service.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - command: - - %%commands%% - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: foo - mountPath: bar - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: admin-service - image: {{ template "admin-service.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: container_user - value: {{ .Values.containerSecurityContext.runAsUser }} - - name: JDK_JAVA_OPTIONS - value: {{ .Values.additionalResources.javaOpts }} - {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - envFrom: - {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} - ports: - - name: spring-service - containerPort: {{ .Values.springServicePort }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} diff --git a/helm/admin-service/templates/extra-list.yaml b/helm/admin-service/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e16f..00000000000 --- a/helm/admin-service/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/helm/admin-service/templates/service-account.yaml b/helm/admin-service/templates/service-account.yaml deleted file mode 100644 index 477065c1f36..00000000000 --- a/helm/admin-service/templates/service-account.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "admin-service.serviceAccountName" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/admin-service/templates/service.yaml b/helm/admin-service/templates/service.yaml deleted file mode 100644 index 93fdc92b3da..00000000000 --- a/helm/admin-service/templates/service.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - name: http - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.springServicePort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/admin-service/templates/servicemonitor.yaml b/helm/admin-service/templates/servicemonitor.yaml deleted file mode 100644 index 15f48fdeecf..00000000000 --- a/helm/admin-service/templates/servicemonitor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ template "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ .Release.Namespace | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: {{ .Values.springServicePort }} - path: {{ .Values.metrics.endpointPath }} - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.honorLabels }} - honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabellings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace | quote }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/admin-service/templates/virtualservice.yaml b/helm/admin-service/templates/virtualservice.yaml deleted file mode 100644 index 44559745b99..00000000000 --- a/helm/admin-service/templates/virtualservice.yaml +++ /dev/null @@ -1,34 +0,0 @@ -{{- if .Values.istio.enabled }} -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: {{ template "common.names.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - hosts: - - "*" - gateways: - {{- include "common.tplvalues.render" ( dict "value" .Values.istio.gateways "context" $ ) | nindent 4 }} - http: - - match: - - uri: - prefix: {{ .Values.istio.prefix }} - route: - - destination: - host: {{ template "common.names.fullname" . }} - port: - number: {{ .Values.service.port }} - corsPolicy: - {{- include "common.tplvalues.render" ( dict "value" .Values.istio.corsPolicy "context" $ ) | nindent 6 }} - headers: - request: - set: - x-forwarded-proto: https -{{- end }} diff --git a/helm/admin-service/values.yaml b/helm/admin-service/values.yaml deleted file mode 100644 index d634bda3ff5..00000000000 --- a/helm/admin-service/values.yaml +++ /dev/null @@ -1,451 +0,0 @@ -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry and imagePullSecrets -## -# global: -# imageRegistry: myRegistryName -# imagePullSecrets: -# - myRegistryKeySecretName -# storageClass: myStorageClass - -## Add labels to all the deployed resources -## -commonLabels: - app.kubernetes.io/component: mosip - -## Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Kubernetes Cluster Domain -## -clusterDomain: cluster.local - -## Extra objects to deploy (value evaluated as a template) -## -extraDeploy: [] - -## Number of nodes -## -replicaCount: 1 - -service: - type: ClusterIP - port: 80 - ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) - ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer - ## - ## loadBalancerIP: - ## - ## nodePorts: - ## http: - ## https: - ## - nodePorts: - http: "" - https: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - -image: - registry: docker.io - repository: mosipid/admin-service - tag: 1.2.1.0 - - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - # pullSecrets: - # - myRegistryKeySecretName - -## Port on which this particular spring service module is running. -springServicePort: 8098 - -## Configure extra options for liveness and readiness probes -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## -startupProbe: - enabled: true - httpGet: - path: /v1/admin/actuator/health - port: 8098 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: /v1/admin/actuator/health - port: 8098 - initialDelaySeconds: 20 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: /v1/admin/actuator/health - port: 8098 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -## -# existingConfigmap: - -## Command and args for running the container (set to default if not set). Use array form -## -command: [] -args: [] - -## Deployment pod host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] - -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 300m - memory: 2000Mi - requests: - cpu: 100m - memory: 1000Mi - -additionalResources: - ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources - ## Example: java_opts: "-Xms500M -Xmx500M" - javaOpts: "-Xms1250M -Xmx1250M" - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -## Clamav container already runs as 'mosip' user, so we may not need to enable this -containerSecurityContext: - enabled: false - runAsUser: mosip - runAsNonRoot: true - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: - enabled: false - fsGroup: 1001 - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - ## - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Pod extra labels -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} - -## Annotations for server pods. -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## pods' priority. -## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -# priorityClassName: "" - -## lifecycleHooks for the container to automate configuration before or after startup. -## -lifecycleHooks: {} - -## Custom Liveness probes for -## -customLivenessProbe: {} - -## Custom Rediness probes -## -customReadinessProbe: {} - -## Update strategy - only really applicable for deployments with RWO PVs attached -## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the -## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will -## terminate the single previous pod, so that the new, incoming pod can attach to the PV -## -updateStrategy: - type: RollingUpdate - -## Additional environment variables to set -## Example: -## extraEnvVars: -## - name: FOO -## value: "bar" -## -extraEnvVars: [] - -## ConfigMap with extra environment variables -## -extraEnvVarsCM: - - global - - config-server-share - - artifactory-share - -## Secret with extra environment variables -## -extraEnvVarsSecret: - -## Extra volumes to add to the deployment -## -extraVolumes: [] - -## Extra volume mounts to add to the container -## -extraVolumeMounts: [] - -## Add init containers to the pods. -## Example: -## initContainers: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -initContainers: {} - -## Add sidecars to the pods. -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: {} - -persistence: - enabled: false - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack). - ## - # storageClass: "-" - ## - ## If you want to reuse an existing claim, you can pass the name of the PVC using - ## the existingClaim variable - # existingClaim: your-claim - ## ReadWriteMany not supported by AWS gp2 - storageClass: - accessModes: - - ReadWriteOnce - size: 10M - existingClaim: - # Dir where config and keys are written inside container - mountDir: - -## Init containers parameters: -## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. -## -volumePermissions: - enabled: false - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: "10" - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - ## - myRegistryKeySecretName - ## Init containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - ## We usually recommend not to specify default resources and to leave this as a conscious - ## choice for the user. This also increases chances charts run on environments with little - ## resources, such as Minikube. If you do want to specify resources, uncomment the following - ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. - ## - limits: {} - ## cpu: 100m - ## memory: 128Mi - ## - requests: {} - ## cpu: 100m - ## memory: 128Mi - ## - -## Specifies whether RBAC resources should be created -## -rbac: - create: true - -## Specifies whether a ServiceAccount should be created -## -serviceAccount: - create: true - ## The name of the ServiceAccount to use. - ## If not set and create is true, a name is generated using the fullname template - ## - name: - -## Prometheus Metrics -## -metrics: - enabled: true - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /v1/admin/actuator/prometheus - - ## Prometheus Service Monitor - ## ref: https://github.com/coreos/prometheus-operator - ## - serviceMonitor: - ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry - ## - enabled: true - ## Specify the namespace in which the serviceMonitor resource will be created - ## - # namespace: "" - ## Specify the interval at which metrics should be scraped - ## - interval: 10s - ## Specify the timeout after which the scrape is ended - ## - # scrapeTimeout: 30s - ## Specify Metric Relabellings to add to the scrape endpoint - ## - # relabellings: - ## Specify honorLabels parameter to add the scrape endpoint - ## - honorLabels: false - ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec - ## - additionalLabels: {} - - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - enabled: false - additionalLabels: {} - namespace: '' - ## List of rules, used as template by Helm. - ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html - # rules: - # - alert: RabbitmqDown - # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 - # for: 5m - # labels: - # severity: error - rules: [] - -## Admin swagger should have only internal access. Hence linked to internal gateway -istio: - enabled: true - gateways: - - istio-system/internal - prefix: /v1/admin - corsPolicy: - allowOrigins: - - prefix: https://admin.sandbox.xyz.net - allowCredentials: true - allowHeaders: - - Accept - - Accept-Encoding - - Accept-Language - - Connection - - Content-Type - - Cookie - - Host - - Referer - - Sec-Fetch-Dest - - Sec-Fetch-Mode - - Sec-Fetch-Site - - Sec-Fetch-User - - Origin - - Upgrade-Insecure-Requests - - User-Agent - - sec-ch-ua - - sec-ch-ua-mobile - - sec-ch-ua-platform - - x-xsrf-token - - xsrf-token - allowMethods: - - GET - - POST - - PATCH - - PUT - - DELETE diff --git a/helm/masterdata/.gitignore b/helm/masterdata/.gitignore deleted file mode 100644 index ee3892e8794..00000000000 --- a/helm/masterdata/.gitignore +++ /dev/null @@ -1 +0,0 @@ -charts/ diff --git a/helm/masterdata/.helmignore b/helm/masterdata/.helmignore deleted file mode 100644 index f0c13194444..00000000000 --- a/helm/masterdata/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/masterdata/Chart.yaml b/helm/masterdata/Chart.yaml deleted file mode 100644 index ec14c52b4b5..00000000000 --- a/helm/masterdata/Chart.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v2 -name: masterdata -description: A Helm chart for MOSIP Masterdata module -type: application -version: 12.1.0 -appVersion: "" -dependencies: - - name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -home: https://mosip.io -keywords: - - mosip - - masterdata - - kernel -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/masterdata/README.md b/helm/masterdata/README.md deleted file mode 100644 index c44089c04dc..00000000000 --- a/helm/masterdata/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Masterdata - -Helm chart for installing Kernel module Masterdata. - -## TL;DR - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/masterdata -``` - -## Introduction - -Masterdata is part of the kernel modules, but has a separate Helm chart so as to install and manage it in a completely indepedent namespace. - -## Prerequisites - -- Kubernetes 1.12+ -- Helm 3.1.0 -- PV provisioner support in the underlying infrastructure -- ReadWriteMany volumes for deployment scaling - -## Installing the Chart - -To install the chart with the release name `masterdata`. - -```console -helm install my-release mosip/masterdata -``` - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```console -helm delete my-release -``` - diff --git a/helm/masterdata/templates/NOTES.txt b/helm/masterdata/templates/NOTES.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/helm/masterdata/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/helm/masterdata/templates/_helpers.tpl b/helm/masterdata/templates/_helpers.tpl deleted file mode 100644 index 8e8817c3e1f..00000000000 --- a/helm/masterdata/templates/_helpers.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "masterdata.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "masterdata.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "masterdata.imagePullSecrets" -}} -{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "masterdata.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "masterdata.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "masterdata.validateValues.foo" .) -}} -{{- $messages := append $messages (include "masterdata.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "masterdata.podAnnotations" -}} -{{- if .Values.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} -{{- end }} -{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} -{{- end }} -{{- end -}} - - diff --git a/helm/masterdata/templates/clusterrolebinding.yaml b/helm/masterdata/templates/clusterrolebinding.yaml deleted file mode 100644 index 90065c68a93..00000000000 --- a/helm/masterdata/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "masterdata.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/masterdata/templates/deployment.yaml b/helm/masterdata/templates/deployment.yaml deleted file mode 100644 index 4e79ff24cd2..00000000000 --- a/helm/masterdata/templates/deployment.yaml +++ /dev/null @@ -1,135 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - {{- if .Values.updateStrategy }} - strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} - {{- end }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if or .Values.podAnnotations .Values.metrics.enabled }} - {{- include "masterdata.podAnnotations" . | nindent 8 }} - {{- end }} - - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "masterdata.serviceAccountName" . }} - {{- include "masterdata.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName | quote }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - initContainers: - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{ include "masterdata.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - command: - - %%commands%% - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: foo - mountPath: bar - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: masterdata - image: {{ template "masterdata.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: container_user - value: {{ .Values.containerSecurityContext.runAsUser }} - - name: JDK_JAVA_OPTIONS - value: {{ .Values.additionalResources.javaOpts }} - {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - envFrom: - {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} - ports: - - name: spring-service - containerPort: {{ .Values.springServicePort }} - - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} diff --git a/helm/masterdata/templates/extra-list.yaml b/helm/masterdata/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e16f..00000000000 --- a/helm/masterdata/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/helm/masterdata/templates/service-account.yaml b/helm/masterdata/templates/service-account.yaml deleted file mode 100644 index acdaaf20bbf..00000000000 --- a/helm/masterdata/templates/service-account.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "masterdata.serviceAccountName" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/masterdata/templates/service.yaml b/helm/masterdata/templates/service.yaml deleted file mode 100644 index 018e6985d05..00000000000 --- a/helm/masterdata/templates/service.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.springServicePort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/masterdata/templates/servicemonitor.yaml b/helm/masterdata/templates/servicemonitor.yaml deleted file mode 100644 index 15f48fdeecf..00000000000 --- a/helm/masterdata/templates/servicemonitor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ template "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ .Release.Namespace | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: {{ .Values.springServicePort }} - path: {{ .Values.metrics.endpointPath }} - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.honorLabels }} - honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabellings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace | quote }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/masterdata/templates/virtualservice.yaml b/helm/masterdata/templates/virtualservice.yaml deleted file mode 100644 index 44559745b99..00000000000 --- a/helm/masterdata/templates/virtualservice.yaml +++ /dev/null @@ -1,34 +0,0 @@ -{{- if .Values.istio.enabled }} -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: {{ template "common.names.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - hosts: - - "*" - gateways: - {{- include "common.tplvalues.render" ( dict "value" .Values.istio.gateways "context" $ ) | nindent 4 }} - http: - - match: - - uri: - prefix: {{ .Values.istio.prefix }} - route: - - destination: - host: {{ template "common.names.fullname" . }} - port: - number: {{ .Values.service.port }} - corsPolicy: - {{- include "common.tplvalues.render" ( dict "value" .Values.istio.corsPolicy "context" $ ) | nindent 6 }} - headers: - request: - set: - x-forwarded-proto: https -{{- end }} diff --git a/helm/masterdata/values.yaml b/helm/masterdata/values.yaml deleted file mode 100644 index 5de1f62c1ef..00000000000 --- a/helm/masterdata/values.yaml +++ /dev/null @@ -1,420 +0,0 @@ -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry and imagePullSecrets -## -# global: -# imageRegistry: myRegistryName -# imagePullSecrets: -# - myRegistryKeySecretName -# storageClass: myStorageClass - -## Add labels to all the deployed resources -## -commonLabels: - app.kubernetes.io/component: mosip - -## Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Kubernetes Cluster Domain -## -clusterDomain: cluster.local - -## Extra objects to deploy (value evaluated as a template) -## -extraDeploy: [] - -## Number of nodes -## -replicaCount: 1 - -service: - type: ClusterIP - port: 80 - ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) - ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer - ## - ## loadBalancerIP: - ## - ## nodePorts: - ## http: - ## https: - ## - - nodePorts: - http: "" - https: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - -image: - registry: docker.io - repository: mosipid/kernel-masterdata-service - tag: 1.2.1.0 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - # pullSecrets: - # - myRegistryKeySecretName - -## Port on which this particular spring service module is running. -springServicePort: 8086 - -## Configure extra options for liveness and readiness probes -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## -startupProbe: - enabled: true - httpGet: - path: /v1/masterdata/actuator/health - port: 8086 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: /v1/masterdata/actuator/health - port: 8086 - initialDelaySeconds: 20 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: /v1/masterdata/actuator/health - port: 8086 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -## -# existingConfigmap: - -## Command and args for running the container (set to default if not set). Use array form -## -command: [] -args: [] - -## Deployment pod host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] - -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 500m - memory: 2250Mi - requests: - cpu: 100m - memory: 1500Mi - -additionalResources: - ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources - ## Example: java_opts: "-Xms500M -Xmx500M" - javaOpts: "-Xms1500M -Xmx1500M" - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -## Clamav container already runs as 'mosip' user, so we may not need to enable this -containerSecurityContext: - enabled: false - runAsUser: mosip - runAsNonRoot: true - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: - enabled: false - fsGroup: 1001 - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - ## - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Pod extra labels -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} - -## Annotations for server pods. -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## pods' priority. -## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -# priorityClassName: "" - -## lifecycleHooks for the container to automate configuration before or after startup. -## -lifecycleHooks: {} - -## Custom Liveness probes for -## -customLivenessProbe: {} - -## Custom Rediness probes -## -customReadinessProbe: {} - -## Update strategy - only really applicable for deployments with RWO PVs attached -## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the -## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will -## terminate the single previous pod, so that the new, incoming pod can attach to the PV -## -updateStrategy: - type: RollingUpdate - -## Additional environment variables to set -## Example: -## extraEnvVars: -## - name: FOO -## value: "bar" -## -extraEnvVars: [] - -## ConfigMap with extra environment variables that used -## -extraEnvVarsCM: - - global - - config-server-share - - artifactory-share - -## Secret with extra environment variables -## -extraEnvVarsSecret: - -## Extra volumes to add to the deployment -## -extraVolumes: [] - -## Extra volume mounts to add to the container -## -extraVolumeMounts: [] - -## Add init containers to the pods. -## Example: -## initContainers: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -initContainers: {} - -## Add sidecars to the pods. -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: {} - -persistence: - enabled: false - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack). - ## - # storageClass: "-" - ## - ## If you want to reuse an existing claim, you can pass the name of the PVC using - ## the existingClaim variable - # existingClaim: your-claim - ## ReadWriteMany not supported by AWS gp2 - storageClass: - accessModes: - - ReadWriteOnce - size: 10M - existingClaim: - # Dir where config and keys are written inside container - mountDir: - -## Init containers parameters: -## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. -## -volumePermissions: - enabled: false - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: "10" - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - ## - myRegistryKeySecretName - ## Init containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - ## We usually recommend not to specify default resources and to leave this as a conscious - ## choice for the user. This also increases chances charts run on environments with little - ## resources, such as Minikube. If you do want to specify resources, uncomment the following - ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. - ## - limits: {} - ## cpu: 100m - ## memory: 128Mi - ## - requests: {} - ## cpu: 100m - ## memory: 128Mi - ## - -## Specifies whether RBAC resources should be created -## -rbac: - create: true - -## Specifies whether a ServiceAccount should be created -## -serviceAccount: - create: true - ## The name of the ServiceAccount to use. - ## If not set and create is true, a name is generated using the fullname template - ## - name: - -## Prometheus Metrics -## -metrics: - enabled: true - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /v1/masterdata/actuator/prometheus - - ## Prometheus Service Monitor - ## ref: https://github.com/coreos/prometheus-operator - ## - serviceMonitor: - ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry - ## - enabled: true - ## Specify the namespace in which the serviceMonitor resource will be created - ## - # namespace: "" - ## Specify the interval at which metrics should be scraped - ## - interval: 10s - ## Specify the timeout after which the scrape is ended - ## - # scrapeTimeout: 30s - ## Specify Metric Relabellings to add to the scrape endpoint - ## - # relabellings: - ## Specify honorLabels parameter to add the scrape endpoint - ## - honorLabels: false - ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec - ## - additionalLabels: {} - - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - enabled: false - additionalLabels: {} - namespace: '' - ## List of rules, used as template by Helm. - ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html - # rules: - # - alert: RabbitmqDown - # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 - # for: 5m - # labels: - # severity: error - rules: [] - -## Only internal access -istio: - enabled: true - gateways: - - istio-system/internal - prefix: /v1/masterdata diff --git a/helm/syncdata/.gitignore b/helm/syncdata/.gitignore deleted file mode 100644 index ee3892e8794..00000000000 --- a/helm/syncdata/.gitignore +++ /dev/null @@ -1 +0,0 @@ -charts/ diff --git a/helm/syncdata/.helmignore b/helm/syncdata/.helmignore deleted file mode 100644 index f0c13194444..00000000000 --- a/helm/syncdata/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/helm/syncdata/Chart.yaml b/helm/syncdata/Chart.yaml deleted file mode 100644 index cb7bfcf4f9f..00000000000 --- a/helm/syncdata/Chart.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: v2 -name: syncdata -description: A Helm chart for MOSIP Syncdata module -type: application -version: 12.1.0 -appVersion: "" -dependencies: - - name: common - repository: https://charts.bitnami.com/bitnami - tags: - - bitnami-common - version: 1.x.x -home: https://mosip.io -keywords: - - mosip - - syncdata - - kernel -maintainers: - - email: info@mosip.io - name: MOSIP diff --git a/helm/syncdata/README.md b/helm/syncdata/README.md deleted file mode 100644 index acefe859722..00000000000 --- a/helm/syncdata/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Syncdata - -Helm chart for installing Kernel module Syncdata. - -## TL;DR - -```console -$ helm repo add mosip https://mosip.github.io -$ helm install my-release mosip/syncdata -``` - -## Introduction - -Syncdata is part of the kernel modules, but has a separate Helm chart so as to install and manage it in a completely indepedent namespace. - -## Prerequisites - -- Kubernetes 1.12+ -- Helm 3.1.0 -- PV provisioner support in the underlying infrastructure -- ReadWriteMany volumes for deployment scaling - -## Installing the Chart - -To install the chart with the release name `syncdata`. - -```console -helm install my-release mosip/syncdata -``` - -> **Tip**: List all releases using `helm list` - -## Uninstalling the Chart - -To uninstall/delete the `my-release` deployment: - -```console -helm delete my-release -``` - diff --git a/helm/syncdata/templates/NOTES.txt b/helm/syncdata/templates/NOTES.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/helm/syncdata/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/helm/syncdata/templates/_helpers.tpl b/helm/syncdata/templates/_helpers.tpl deleted file mode 100644 index bfc71bba2f6..00000000000 --- a/helm/syncdata/templates/_helpers.tpl +++ /dev/null @@ -1,60 +0,0 @@ -{{/* -Return the proper image name -*/}} -{{- define "syncdata.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "syncdata.volumePermissions.image" -}} -{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "syncdata.imagePullSecrets" -}} -{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} -{{- define "syncdata.serviceAccountName" -}} -{{- if .Values.serviceAccount.create -}} - {{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Compile all warnings into a single message. -*/}} -{{- define "syncdata.validateValues" -}} -{{- $messages := list -}} -{{- $messages := append $messages (include "syncdata.validateValues.foo" .) -}} -{{- $messages := append $messages (include "syncdata.validateValues.bar" .) -}} -{{- $messages := without $messages "" -}} -{{- $message := join "\n" $messages -}} - -{{- if $message -}} -{{- printf "\nVALUES VALIDATION:\n%s" $message -}} -{{- end -}} -{{- end -}} - -{{/* -Return podAnnotations -*/}} -{{- define "syncdata.podAnnotations" -}} -{{- if .Values.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }} -{{- end }} -{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }} -{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }} -{{- end }} -{{- end -}} - - diff --git a/helm/syncdata/templates/clusterrolebinding.yaml b/helm/syncdata/templates/clusterrolebinding.yaml deleted file mode 100644 index 06e8b0887f1..00000000000 --- a/helm/syncdata/templates/clusterrolebinding.yaml +++ /dev/null @@ -1,19 +0,0 @@ -kind: ClusterRoleBinding -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: {{ template "common.names.fullname" . }} -subjects: - - kind: ServiceAccount - name: {{ template "syncdata.serviceAccountName" . }} - namespace: {{ .Release.Namespace }} diff --git a/helm/syncdata/templates/deployment.yaml b/helm/syncdata/templates/deployment.yaml deleted file mode 100644 index 81d572d67d2..00000000000 --- a/helm/syncdata/templates/deployment.yaml +++ /dev/null @@ -1,135 +0,0 @@ -apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: {{ .Values.replicaCount }} - {{- if .Values.updateStrategy }} - strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} - {{- end }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - template: - metadata: - annotations: - {{- if or .Values.podAnnotations .Values.metrics.enabled }} - {{- include "syncdata.podAnnotations" . | nindent 8 }} - {{- end }} - - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - spec: - serviceAccountName: {{ template "syncdata.serviceAccountName" . }} - {{- include "syncdata.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName | quote }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - initContainers: - {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }} - - name: volume-permissions - image: {{ include "syncdata.volumePermissions.image" . }} - imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} - command: - - %%commands%% - securityContext: - runAsUser: 0 - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: foo - mountPath: bar - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: syncdata - image: {{ template "syncdata.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.lifecycleHooks }} - lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: container_user - value: {{ .Values.containerSecurityContext.runAsUser }} - - name: JDK_JAVA_OPTIONS - value: {{ .Values.additionalResources.javaOpts }} - {{- if .Values.extraEnvVars }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} - {{- end }} - envFrom: - {{- if .Values.extraEnvVarsCM }} - {{- range .Values.extraEnvVarsCM }} - - configMapRef: - name: {{ . }} - {{- end }} - {{- end }} - {{- if .Values.extraEnvVarsSecret }} - - secretRef: - name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }} - {{- end }} - ports: - - name: spring-service - containerPort: {{ .Values.springServicePort }} - - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - {{- if .Values.startupProbe.enabled }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customStartupProbe }} - startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.livenessProbe.enabled }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customLivenessProbe }} - livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.readinessProbe.enabled }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }} - {{- else if .Values.customReadinessProbe }} - readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.sidecars }} - {{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }} - {{- end }} diff --git a/helm/syncdata/templates/extra-list.yaml b/helm/syncdata/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9e16f..00000000000 --- a/helm/syncdata/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/helm/syncdata/templates/service-account.yaml b/helm/syncdata/templates/service-account.yaml deleted file mode 100644 index 7f334bc1cbf..00000000000 --- a/helm/syncdata/templates/service-account.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "syncdata.serviceAccountName" . }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} diff --git a/helm/syncdata/templates/service.yaml b/helm/syncdata/templates/service.yaml deleted file mode 100644 index 018e6985d05..00000000000 --- a/helm/syncdata/templates/service.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - name: {{ template "common.names.fullname" . }} - annotations: - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{ if eq .Values.service.type "LoadBalancer" }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{ end }} - {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - ports: - - port: {{ .Values.service.port }} - protocol: TCP - targetPort: {{ .Values.springServicePort }} - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} diff --git a/helm/syncdata/templates/servicemonitor.yaml b/helm/syncdata/templates/servicemonitor.yaml deleted file mode 100644 index 15f48fdeecf..00000000000 --- a/helm/syncdata/templates/servicemonitor.yaml +++ /dev/null @@ -1,36 +0,0 @@ -{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }} -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: {{ template "common.names.fullname" . }} - {{- if .Values.metrics.serviceMonitor.namespace }} - namespace: {{ .Values.metrics.serviceMonitor.namespace }} - {{- else }} - namespace: {{ .Release.Namespace | quote }} - {{- end }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.metrics.serviceMonitor.additionalLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.additionalLabels "context" $) | nindent 4 }} - {{- end }} -spec: - endpoints: - - targetPort: {{ .Values.springServicePort }} - path: {{ .Values.metrics.endpointPath }} - {{- if .Values.metrics.serviceMonitor.interval }} - interval: {{ .Values.metrics.serviceMonitor.interval }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.scrapeTimeout }} - scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.honorLabels }} - honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.relabellings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.relabellings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace | quote }} - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} -{{- end }} diff --git a/helm/syncdata/templates/virtualservice.yaml b/helm/syncdata/templates/virtualservice.yaml deleted file mode 100644 index 37c614d0c55..00000000000 --- a/helm/syncdata/templates/virtualservice.yaml +++ /dev/null @@ -1,32 +0,0 @@ -{{- if .Values.istio.enabled }} -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: {{ template "common.names.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - hosts: - - "*" - gateways: - - {{ .Values.istio.gateway }} - http: - - match: - - uri: - prefix: {{ .Values.istio.prefix }} - route: - - destination: - host: {{ template "common.names.fullname" . }} - port: - number: {{ .Values.service.port }} - headers: - request: - set: - x-forwarded-proto: https -{{- end }} diff --git a/helm/syncdata/values.yaml b/helm/syncdata/values.yaml deleted file mode 100644 index bf119e528a2..00000000000 --- a/helm/syncdata/values.yaml +++ /dev/null @@ -1,419 +0,0 @@ -## Global Docker image parameters -## Please, note that this will override the image parameters, including dependencies, configured to use the global value -## Current available global Docker image parameters: imageRegistry and imagePullSecrets -## -# global: -# imageRegistry: myRegistryName -# imagePullSecrets: -# - myRegistryKeySecretName -# storageClass: myStorageClass - -## Add labels to all the deployed resources -## -commonLabels: - app.kubernetes.io/component: mosip - -## Add annotations to all the deployed resources -## -commonAnnotations: {} - -## Kubernetes Cluster Domain -## -clusterDomain: cluster.local - -## Extra objects to deploy (value evaluated as a template) -## -extraDeploy: [] - -## Number of nodes -## -replicaCount: 1 - -service: - type: ClusterIP - port: 80 - ## loadBalancerIP for the SuiteCRM Service (optional, cloud specific) - ## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer - ## - ## loadBalancerIP: - ## - ## nodePorts: - ## http: - ## https: - ## - - nodePorts: - http: "" - https: "" - ## Enable client source IP preservation - ## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - ## - externalTrafficPolicy: Cluster - -image: - registry: docker.io - repository: mosipid/kernel-syncdata-service - tag: 1.2.1.0 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images - ## - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - # pullSecrets: - # - myRegistryKeySecretName - -## Port on which this particular spring service module is running. -springServicePort: 8089 - -## Configure extra options for liveness and readiness probes -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes -## -startupProbe: - enabled: true - httpGet: - path: /v1/syncdata/actuator/health - port: 8089 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 30 - successThreshold: 1 - -livenessProbe: - enabled: true - httpGet: - path: /v1/syncdata/actuator/health - port: 8089 - initialDelaySeconds: 20 - periodSeconds: 30 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -readinessProbe: - enabled: true - httpGet: - path: /v1/syncdata/actuator/health - port: 8089 - initialDelaySeconds: 0 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 6 - successThreshold: 1 - -## -# existingConfigmap: - -## Command and args for running the container (set to default if not set). Use array form -## -command: [] -args: [] - -## Deployment pod host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] - -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - limits: - cpu: 500m - memory: 5000Mi - requests: - cpu: 100m - memory: 1500Mi - -additionalResources: - ## Specify any JAVA_OPTS string here. These typically will be specified in conjunction with above resources - ## Example: java_opts: "-Xms500M -Xmx500M" - javaOpts: "-Xms4000M -Xmx4000M" - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container -## Clamav container already runs as 'mosip' user, so we may not need to enable this -containerSecurityContext: - enabled: false - runAsUser: mosip - runAsNonRoot: true - -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## -podSecurityContext: - enabled: false - fsGroup: 1001 - -## Pod affinity preset -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAffinityPreset: "" - -## Pod anti-affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## Allowed values: soft, hard -## -podAntiAffinityPreset: soft - -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## Allowed values: soft, hard -## -nodeAffinityPreset: - ## Node affinity type - ## Allowed values: soft, hard - ## - type: "" - ## Node label key to match - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## Node label values to match - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] - -## Affinity for pod assignment. Evaluated as a template. -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## -affinity: {} - -## Node labels for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} - -## Tolerations for pod assignment. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] - -## Pod extra labels -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} - -## Annotations for server pods. -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} - -## pods' priority. -## ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -# priorityClassName: "" - -## lifecycleHooks for the container to automate configuration before or after startup. -## -lifecycleHooks: {} - -## Custom Liveness probes for -## -customLivenessProbe: {} - -## Custom Rediness probes -## -customReadinessProbe: {} - -## Update strategy - only really applicable for deployments with RWO PVs attached -## If replicas = 1, an update can get "stuck", as the previous pod remains attached to the -## PV, and the "incoming" pod can never start. Changing the strategy to "Recreate" will -## terminate the single previous pod, so that the new, incoming pod can attach to the PV -## -updateStrategy: - type: RollingUpdate - -## Additional environment variables to set -## Example: -## extraEnvVars: -## - name: FOO -## value: "bar" -## -extraEnvVars: [] - -## ConfigMap with extra environment variables that used -## -extraEnvVarsCM: - - global - - config-server-share - - artifactory-share - -## Secret with extra environment variables -## -extraEnvVarsSecret: - -## Extra volumes to add to the deployment -## -extraVolumes: [] - -## Extra volume mounts to add to the container -## -extraVolumeMounts: [] - -## Add init containers to the pods. -## Example: -## initContainers: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -initContainers: {} - -## Add sidecars to the pods. -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: {} - -persistence: - enabled: false - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack). - ## - # storageClass: "-" - ## - ## If you want to reuse an existing claim, you can pass the name of the PVC using - ## the existingClaim variable - # existingClaim: your-claim - ## ReadWriteMany not supported by AWS gp2 - storageClass: - accessModes: - - ReadWriteOnce - size: 10M - existingClaim: - # Dir where config and keys are written inside container - mountDir: - -## Init containers parameters: -## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. -## -volumePermissions: - enabled: false - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: "10" - pullPolicy: Always - ## Optionally specify an array of imagePullSecrets. - ## Secrets must be manually created in the namespace. - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ - ## - pullSecrets: [] - ## - myRegistryKeySecretName - ## Init containers' resource requests and limits - ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ - ## - resources: - ## We usually recommend not to specify default resources and to leave this as a conscious - ## choice for the user. This also increases chances charts run on environments with little - ## resources, such as Minikube. If you do want to specify resources, uncomment the following - ## lines, adjust them as necessary, and remove the curly braces after 'resources:'. - ## - limits: {} - ## cpu: 100m - ## memory: 128Mi - ## - requests: {} - ## cpu: 100m - ## memory: 128Mi - ## - -## Specifies whether RBAC resources should be created -## -rbac: - create: true - -## Specifies whether a ServiceAccount should be created -## -serviceAccount: - create: true - ## The name of the ServiceAccount to use. - ## If not set and create is true, a name is generated using the fullname template - ## - name: - -## Prometheus Metrics -## -metrics: - enabled: true - ## Prometheus pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: - prometheus.io/scrape: "true" - - endpointPath: /v1/syncdata/actuator/prometheus - - ## Prometheus Service Monitor - ## ref: https://github.com/coreos/prometheus-operator - ## - serviceMonitor: - ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry - ## - enabled: true - ## Specify the namespace in which the serviceMonitor resource will be created - ## - # namespace: "" - ## Specify the interval at which metrics should be scraped - ## - interval: 10s - ## Specify the timeout after which the scrape is ended - ## - # scrapeTimeout: 30s - ## Specify Metric Relabellings to add to the scrape endpoint - ## - # relabellings: - ## Specify honorLabels parameter to add the scrape endpoint - ## - honorLabels: false - ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec - ## - additionalLabels: {} - - ## Custom PrometheusRule to be defined - ## The value is evaluated as a template, so, for example, the value can depend on .Release or .Chart - ## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions - ## - prometheusRule: - enabled: false - additionalLabels: {} - namespace: '' - ## List of rules, used as template by Helm. - ## These are just examples rules inspired from https://awesome-prometheus-alerts.grep.to/rules.html - # rules: - # - alert: RabbitmqDown - # expr: rabbitmq_up{service="{{ template "rabbitmq.fullname" . }}"} == 0 - # for: 5m - # labels: - # severity: error - rules: [] - -## Only internal access -istio: - enabled: true - gateway: istio-system/internal - prefix: /v1/syncdata