{"id":20727201,"url":"https://github.com/hmcts/chart-java","last_synced_at":"2026-01-06T13:17:26.148Z","repository":{"id":37801377,"uuid":"158828944","full_name":"hmcts/chart-java","owner":"hmcts","description":"Helm chart for Java microservices","archived":false,"fork":false,"pushed_at":"2024-05-28T14:39:22.000Z","size":271,"stargazers_count":15,"open_issues_count":2,"forks_count":6,"subscribers_count":153,"default_branch":"master","last_synced_at":"2024-05-29T06:22:56.253Z","etag":null,"topics":["helm","helm-charts","java","kubernetes"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmcts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-23T12:19:08.000Z","updated_at":"2024-06-06T17:34:46.972Z","dependencies_parsed_at":"2023-09-25T22:52:22.728Z","dependency_job_id":"d5b60dbb-dc3b-4808-aa77-2f0353abc07d","html_url":"https://github.com/hmcts/chart-java","commit_stats":null,"previous_names":[],"tags_count":159,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fchart-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fchart-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fchart-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmcts%2Fchart-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmcts","download_url":"https://codeload.github.com/hmcts/chart-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224999459,"owners_count":17405029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["helm","helm-charts","java","kubernetes"],"created_at":"2024-11-17T04:29:33.631Z","updated_at":"2026-01-06T13:17:26.113Z","avatar_url":"https://github.com/hmcts.png","language":"Makefile","readme":"# chart-java\n\n[![Build Status](https://dev.azure.com/hmcts/CNP/_apis/build/status/Helm%20Charts/chart-java)](https://dev.azure.com/hmcts/CNP/_build/latest?definitionId=62)\n\nThis chart is intended for simple Java microservices.\n\nWe will take small PRs and small features to this chart but more complicated needs should be handled in your own chart.\n\n*NOTE*: /health/readiness and /health/liveness [exposed by spring boot 2.3.0 actuator](https://docs.spring.io/spring-boot/docs/2.3.0.BUILD-SNAPSHOT/reference/html/production-ready-features.html#production-ready-kubernetes-probes) are used for readiness and liveness checks.\n\nThis chart adds below templates from [chart-library](https://github.com/hmcts/chart-library/) based on the chosen configuration:\n\n- [Deployment](https://github.com/hmcts/chart-library/tree/master#deployment)\n- [Keyvault Secrets](https://github.com/hmcts/chart-library#keyvault-secret-csi-volumes)\n- [Horizontal Pod Auto Scaler](https://github.com/hmcts/chart-library/tree/master#hpa-horizontal-pod-auto-scaler)\n- [Ingress](https://github.com/hmcts/chart-library/tree/master#ingress)\n- [Pod Disruption Budget](https://github.com/hmcts/chart-library/tree/master#pod-disruption-budget)\n- [Service](https://github.com/hmcts/chart-library/tree/master#service)\n- [Deployment Tests](https://github.com/hmcts/chart-library/tree/master#smoke-and-functional-tests)\n\n## Example configuration\n\n```yaml\napplicationPort: 8080\nenvironment:\n  REFORM_TEAM: cnp\n  REFORM_SERVICE_NAME: rhubarb-backend\n  REFORM_ENVIRONMENT: preview\n  ROOT_APPENDER: CNP\n  CONFIG_TEMPLATE: \"{{ .Release.Name }}-config\"\nconfigmap:\n  VAR_A: VALUE_A\n  VAR_B: VALUE_B\nsecrets: \n  ENVIRONMENT_VAR:\n      secretRef: some-secret-reference\n      key: connectionString\n  ENVIRONMENT_VAR_OTHER:\n      secretRef: some-secret-reference-other\n      key: connectionStringOther\n      disabled: true #ENVIRONMENT_VAR_OTHER will not be set to environment\nkeyVaults:\n  \"cmc\":\n    secrets:\n      - smoke-test-citizen-username\n      - smoke-test-user-password\n  \"s2s\":\n    secrets:\n      - microservicekey-cmcLegalFrontend\napplicationInsightsInstrumentKey: \"some-key\"\n```\n\nIf you wish to use pod identity for accessing the key vaults instead of a service principal you need to set a flag `aadIdentityName: \u003cidentity-name\u003e`\ne.g.\n```yaml\naadIdentityName: cmc\nkeyVaults:\n  \"cmc\":\n    usePodIdentity: true\n    secrets:\n      - smoke-test-citizen-username\n      - smoke-test-user-password\n```\n\n## Startup probes\nStartup probes are defined in the [library template](https://github.com/hmcts/chart-library/tree/dtspo-2201-startup-probes#startup-probes) and should be configured for slow starting applications. \nThe default values below (defined in the chart) should be sufficient for most applications but can be overriden as required.\n```yaml\nstartupPath: '/health/liveness'\nstartupDelay: 5\nstartupTimeout: 3\nstartupPeriod: 10\nstartupFailureThreshold: 3\n```\n\nTo configure startup probes for a slow starting application:\n- Set the value of `(startupFailureThreshold x startupPeriodSeconds)` to cover the longest startup time required by the application  \n- If `livenessDelay` is currently configured, set the value to `0`\n\n### Example configuration\nThe below example will allow the application 360 seconds to complete startup.\n```yaml\njava:\n  livenessDelay: 0\n  startupPeriod: 120\n  startupFailureThreshold: 3\n```\nAlso see example [pull request](https://github.com/hmcts/cnp-flux-config/pull/12891/files).  \n\n### HPA Horizontal Pod Autoscaler\n\nTo adjust the number of pods in a deployment depending on CPU utilization AKS supports horizontal pod autoscaling.\nTo enable horizontal pod autoscaling you can set the [autoscaling section](https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-scale#autoscale-pods).\n\n```yaml\nautoscaling:        # Default is true\n  enabled: true \n  maxReplicas: 5    # Optional setting, will use the value of replicas + 2 if not set\n  minReplicas: 2    # Optional setting, will use the value of replicas if not set\n  targetCPUUtilizationPercentage: 80 # Default is 80% target CPU utilization\n```\n\n## Postgresql\n\nIf you need to use a Postgresql database for testing then you can enable it \nby setting the following flag in your application config with:\n\n```yaml\njava:\n  environment:\n    DB_HOST: \"{{ .Release.Name }}-postgresql\"\n    DB_USER_NAME: \"{{ .Values.postgresql.auth.username}}\"\n    DB_PASSWORD: \"{{ .Values.postgresql.auth.password}}\"\n\npostgresql:\n  #Whether to deploy the Postgres Chart or not\n  enabled: true\n```      \n\n## Smoke and functional tests\n\nFrom version 2.15.0 of this chart you can configure your functional and smoke tests to run just after deployment or at scheduled times \nas cron jobs.\n\n```yaml\njava:\n  testsConfig:\n    keyVaults:\n      cmc:\n        excludeEnvironmentSuffix: false\n        secretRef: \"kvcreds\"\n        secrets:\n          smoke-test-citizen-username: SMOKE_TEST_CITIZEN_USER\n          smoke-test-user-password: SMOKE_TEST_CITIZEN_PASS\n    environment:\n      TEST_URL: http://plum-recipe-backend-java\n      SLACK_CHANNEL: \"platops-build-notices\"\n      SLACK_NOTIFY_SUCCESS: \"true\"\n      CLUSTER_NAME: \"aat-01-aks\"\n\n  smoketests:\n    image: hmctspublic.azurecr.io/spring-boot/template-test\n    enabled: true\n    environment:\n      TEST_URL: http://plum-recipe-backend-java-overridden\n\n  functionaltests:\n    image: hmctspublic.azurecr.io/spring-boot/template-test\n    enabled: true\n\n  smoketestscron:\n    image: hmctspublic.azurecr.io/spring-boot/template-test\n    enabled: true\n    environment:\n      TEST_URL: http://plum-recipe-backend-java-overridden2\n\n  functionaltestscron:\n    image: hmctspublic.azurecr.io/spring-boot/template-test\n    enabled: true\n    environment:\n      TEST_URL: http://plum-recipe-backend-java-overridden2\n      SOME_ENV: some-val\n```\n\n## Development and Testing\n\nDefault configuration (e.g. default image and ingress host) is setup for preview. This is suitable for local development and testing.\n\n- Ensure you have logged in with `az cli` and are using `preview` subscription (use `az account show` to display the current one).\n- For local development see the `Makefile` for available targets.\n- To execute an end-to-end build, deploy and test run `make`.\n- to clean up deployed releases, charts, test pods and local charts, run `make clean`\n\n`helm test` will deploy a busybox container alongside the release which performs a simple HTTP request against the service health endpoint. If it doesn't return `HTTP 200` the test will fail. **NOTE:** it does NOT run with `--cleanup` so the test pod will be available for inspection.\n\n## Azure DevOps Builds\n\nBuilds are run against the 'nonprod' AKS cluster.\n\n### Pull Request Validation\n\nA build is triggered when pull requests are created. This build will run `helm lint`, deploy the chart using `ci-values.yaml` and run `helm test`.\n\n### Release Build\n\nTriggered when the repository is tagged (e.g. when a release is created). Also performs linting and testing, and will publish the chart to ACR on success.\n\n\n### Releases\nWe use semantic versioning via GitHub releases to handle new releases of this application chart, this is done via automation called Release Drafter. When you merge a PR to master, a new draft release will be created.\nMore information is available about the [release process and how to create draft releases for testing purposes in more depth](https://hmcts.github.io/ops-runbooks/Testing-Changes/drafting-a-release.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmcts%2Fchart-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmcts%2Fchart-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmcts%2Fchart-java/lists"}