Compare commits

...

187 Commits

Author SHA1 Message Date
Github Action 906958cbcc The next release version will be 0.62.0 2023-11-16 14:40:56 +00:00
Github Action e4f7bc4b45 Publishing 0.61.0 to the Helm repository 2023-11-16 14:40:56 +00:00
davidfrickert 0e0f29ee43 CronJob - Allow file ConfigMap & disabling command override (#90)
* allow file configmap on cron-job chart

* Allow disabling the command override in cronjob container

* Use name of volume instead of fileName for configmap naming

* Add YAML separator to configmaps to allow multiple configmap volumes

- before this change if you tried to use e.g. multiple file configmaps they would all be appended in one YAML file due to no usage of separators, which would lead to only one of the file confimaps actually be created.

* Fix broken test due to file configmap naming change
2023-11-16 15:39:13 +01:00
Github Action 5f0d40f05f The next release version will be 0.61.0 2023-11-11 20:37:45 +00:00
Github Action 410f2b6047 Publishing 0.60.0 to the Helm repository 2023-11-11 20:37:45 +00:00
Laszlo Fogas 9022b34793 Supporting v1alpha1 opensca.dev release 2023-11-11 21:37:04 +01:00
Github Action 366eca776f The next release version will be 0.60.0 2023-11-09 12:38:32 +00:00
Github Action 365544204c Publishing 0.59.0 to the Helm repository 2023-11-09 12:38:32 +00:00
Youcef Guichi 9e1c6f7474 Merge pull request #86 from gimlet-io/minor-changes
Minor changes
2023-11-09 13:26:02 +01:00
Youcef Guichi 84a18e1a01 Minor changes 2023-11-09 13:22:44 +01:00
Raz Amir c7da3a4a4f Add podLabels to onechart (#83)
* Add podLabels to onechart

* add unittest
2023-11-07 13:01:15 +01:00
Laszlo Fogas d66a75ec36 osca.dev fields (#82) 2023-10-30 17:55:07 +01:00
Github Action 91667083fc The next release version will be 0.59.0 2023-10-20 08:57:29 +00:00
Github Action 6673e96e94 Publishing 0.58.0 to the Helm repository 2023-10-20 08:57:28 +00:00
Laszlo Fogas 593756f621 Merge pull request #80 from gimlet-io/new-features
Added ability to refrence an env from an existing configMaps and secrets
2023-10-20 10:55:41 +02:00
Laszlo Fogas 8032acb1b9 Default value for optional; bumping common chart version 2023-10-20 10:54:33 +02:00
Youcef Guichi aafc0bbfab Removed envfrom -- Updated unittest 2023-10-20 10:36:50 +02:00
Youcef Guichi 8720c33db4 Added ability to refrence an env from an existing configMaps and secrets 2023-10-19 11:33:48 +02:00
Github Action 775bd4b50c The next release version will be 0.58.0 2023-08-22 13:16:43 +00:00
Github Action 59f8aee710 Publishing 0.57.0 to the Helm repository 2023-08-22 13:16:42 +00:00
Laszlo Fogas 3b9b6e30ae Support for Gimlet metadata annotations 2023-08-22 15:16:12 +02:00
Github Action 3a04385235 The next release version will be 0.57.0 2023-08-22 12:47:38 +00:00
Github Action bde9fdfe3f Publishing 0.56.0 to the Helm repository 2023-08-22 12:47:37 +00:00
Laszlo Fogas 5eca12d8e1 Static-site json schema updated to match the default values.yaml 2023-08-22 14:47:01 +02:00
Github Action ea74075201 The next release version will be 0.56.0 2023-08-21 14:59:28 +00:00
Github Action c4f6e01ae5 Publishing 0.55.0 to the Helm repository 2023-08-21 14:59:27 +00:00
Laszlo Fogas 858f5e31e0 Changed default build settings 2023-08-21 16:57:30 +02:00
Laszlo Fogas cb00d364d6 Update values.yaml 2023-08-21 16:55:52 +02:00
Github Action b3b33a4b18 The next release version will be 0.55.0 2023-08-21 14:41:32 +00:00
Github Action a5933c0967 Publishing 0.54.0 to the Helm repository 2023-08-21 14:41:31 +00:00
Laszlo Fogas 52b7f9926b Support for Gimlet metadata annotations 2023-08-21 16:40:59 +02:00
Laszlo Fogas 3fda8ce594 Bugfix: namespace was missing 2023-08-21 16:39:26 +02:00
Laszlo Fogas bcb020a12e We only reference existing service accounts, never create it 2023-08-21 16:38:43 +02:00
Github Action b2b6ac4a06 The next release version will be 0.54.0 2023-08-18 06:42:37 +00:00
Github Action af09d73974 Publishing 0.53.0 to the Helm repository 2023-08-18 06:42:36 +00:00
Laszlo Fogas 5db236e7b2 Removed empty lines 2023-08-18 08:37:47 +02:00
Laszlo Fogas 20455220c5 Revert "Removed emoty lines"
This reverts commit c4b19f2801.
2023-08-17 19:28:47 +02:00
Laszlo Fogas c4b19f2801 Removed emoty lines 2023-08-17 19:24:31 +02:00
Github Action ba5fabf679 The next release version will be 0.53.0 2023-08-14 13:03:52 +00:00
Github Action af56df9c19 Publishing 0.52.0 to the Helm repository 2023-08-14 13:03:51 +00:00
Youcef Guichi d0aa57c456 Add security context to init containers -- Added unit test for it (#76)
* Add security context to init containers -- Added unit test for it

* Minor cleaning

---------

Co-authored-by: Laszlo Fogas <laszlo@gimlet.io>
2023-08-14 15:01:22 +02:00
Laszlo Fogas 7b56a9d7c4 Fixing chart version 2023-08-14 13:39:54 +02:00
Laszlo Fogas 4943dc16c6 Preparing for static-site release 2023-08-14 13:39:19 +02:00
Github Action 3445336501 The next release version will be 0.52.0 2023-08-11 08:59:15 +00:00
Github Action ddf8e253e7 Publishing 0.51.0 to the Helm repository 2023-08-11 08:59:15 +00:00
Ádám Sisák 38e586aa7b Remove build tag in static site (#77)
* Chart schema edit

* Build tag removed
2023-08-11 10:58:05 +02:00
Github Action f0d1bd712a The next release version will be 0.51.0 2023-07-12 13:20:54 +00:00
Github Action fe697ea2d4 Publishing 0.50.0 to the Helm repository 2023-07-12 13:20:54 +00:00
Youcef Guichi aae45103a2 Add ignoreLimits flag to container resources (#74) 2023-07-12 14:55:34 +02:00
Github Action 8c0968d1b5 The next release version will be 0.50.0 2023-06-09 07:00:08 +00:00
Github Action e704f8896c Publishing 0.49.0 to the Helm repository 2023-06-09 07:00:07 +00:00
Youcef Guichi 00bc7eb65f Merge pull request #73 from gimlet-io/add-cronjob-schedule-to-ui
Add schedule field for cronjob to the UI
2023-06-09 08:56:46 +02:00
Youcef Guichi ad1d2118e5 Downgrade common version to 0.3.0 (2) 2023-06-08 16:30:56 +02:00
Youcef Guichi a072b8e39e Downgrade common version to 0.3.0 2023-06-08 16:29:20 +02:00
Youcef Guichi 846e17eb44 Reorder cronjob UI elements 2023-06-08 16:19:00 +02:00
Youcef Guichi 8b62aad4a9 fix white spacing 2023-06-08 16:10:05 +02:00
Youcef Guichi 6f87a0ad69 fix white spacing 2023-06-08 15:59:10 +02:00
Youcef Guichi 4e74387f03 Upgradae dependencies version for onechart 2023-06-08 15:49:58 +02:00
Youcef Guichi 4b4357c6ec Upgrade common chart version to 0.4.0 2023-06-08 15:47:28 +02:00
Youcef Guichi 8fe2bc6933 Add schedule field for cronjob to the UI 2023-06-08 15:44:04 +02:00
Github Action d37592faeb The next release version will be 0.49.0 2023-06-05 11:59:24 +00:00
Github Action 11b5d6f25b Publishing 0.48.0 to the Helm repository 2023-06-05 11:59:23 +00:00
Youcef Guichi 97cb75878b Merge pull request #72 from pnieweglowski/master
Add subPath property for secrets (#1)
2023-06-05 13:48:02 +02:00
pnieweglowski 2bbbb208f4 Add subPath property for secrets (#1)
* Add subPath property for secrets
2023-06-02 21:44:09 +02:00
Laszlo Fogas ffeba134d6 License file added 2023-05-27 15:21:32 +02:00
Github Action 4291ffa6ce The next release version will be 0.48.0 2023-04-10 04:27:52 +00:00
Github Action c58141c357 Publishing 0.47.0 to the Helm repository 2023-04-10 04:27:51 +00:00
victorswed 4a217ce3d6 add servicemonitor to onechart (#66)
add service monitor to onechart
2023-04-10 06:25:33 +02:00
Github Action 576204759f The next release version will be 0.47.0 2023-03-30 12:04:57 +00:00
Github Action fff72a0222 Publishing 0.46.0 to the Helm repository 2023-03-30 12:04:56 +00:00
Laszlo Fogas 6d25c17397 Releasing static-site 2023-03-30 14:04:05 +02:00
Github Action 5f96ab341d The next release version will be 0.46.0 2023-03-30 11:57:41 +00:00
Github Action ac8ad047b4 Publishing 0.45.0 to the Helm repository 2023-03-30 11:57:40 +00:00
Laszlo Fogas 00becd0fab added a new chart static-site that build and host static sites. (#64)
Co-authored-by: Youcef Guichi <youcef@gimlet.io>
2023-03-30 13:54:27 +02:00
Ádám Sisák 0b7faf42ac README fixes (#65) 2023-03-30 13:08:24 +02:00
Github Action 6480058dba The next release version will be 0.45.0 2023-03-24 10:18:42 +00:00
Github Action e2d2025c38 Publishing 0.44.0 to the Helm repository 2023-03-24 10:18:41 +00:00
Laszlo Fogas 118cd8e1cb add initcontainers support (#63)
Co-authored-by: Youcef Guichi <youcef@gimlet.io>
2023-03-24 11:16:22 +01:00
Github Action 93892ec341 The next release version will be 0.44.0 2023-03-16 12:43:42 +00:00
Github Action 0a1db3d5cf Publishing 0.43.0 to the Helm repository 2023-03-16 12:43:41 +00:00
Youcef Guichi 56604353a2 Add support for ephemeral volume (configMap) (#61) 2023-03-16 13:28:02 +01:00
Youcef Guichi 96cbc7ec18 Update Api version for cronjob and PodDisruptionBudget (deprecated) (#60) 2023-03-01 12:14:50 +01:00
Github Action 2389545811 The next release version will be 0.43.0 2023-02-17 14:19:46 +00:00
Github Action 3da5c3eb13 Publishing 0.42.0 to the Helm repository 2023-02-17 14:19:45 +00:00
Github Actions 295e43c993 Updating chart dependency 2023-02-17 15:17:54 +01:00
Lajos Papp 6d8fb2930e add example ingress and env (#55) 2022-09-19 14:53:32 +02:00
Github Action d0d78eb1be The next release version will be 0.42.0 2022-09-15 07:36:15 +00:00
Github Action 8a95436200 Publishing 0.41.0 to the Helm repository 2022-09-15 07:36:14 +00:00
Marcel Lambacher afcfc36e5f Allow mounting of existing secrets (#53) 2022-09-15 09:35:08 +02:00
Marcel Lambacher 966f0672c7 Add flag to ignore default resources for containers (#52) 2022-09-12 08:55:05 +02:00
Marcel Lambacher 51ba51320a Dont generate claim for host path volumes (#54)
👏
2022-09-12 08:52:36 +02:00
Github Action 35cb630582 The next release version will be 0.41.0 2022-09-06 12:11:31 +00:00
Github Action 49396e0b8a Publishing 0.40.0 to the Helm repository 2022-09-06 12:11:30 +00:00
Marcel Lambacher 9a6bbba2de Support for PVC annotations (#51) 2022-09-06 14:10:07 +02:00
Laszlo Fogas c8fcb7359f Fixing broken link 2022-08-29 08:37:54 +02:00
Github Action 5c6164c2d6 The next release version will be 0.40.0 2022-08-02 13:23:58 +00:00
Github Action 8a8b63bab9 Publishing 0.39.0 to the Helm repository 2022-08-02 13:23:57 +00:00
Laszlo Fogas c3df85fef6 HostPath and emptyDir (#48) 2022-08-02 15:20:29 +02:00
szabogabor91 5e19d886e5 Add default-container annotation to foolproof exec and logs commands (#44) 2022-06-24 13:31:38 +02:00
Laszlo Fogas 95b686d20c Simplifying namespaces chart (#46) 2022-06-23 13:54:37 +02:00
Laszlo Fogas 285a6cca10 Namespace chart iteration (#45) 2022-06-23 12:56:21 +02:00
Github Action 3ee1679e1d The next release version will be 0.39.0 2022-06-02 11:53:48 +00:00
Github Action 7d49989247 Publishing 0.38.0 to the Helm repository 2022-06-02 11:53:47 +00:00
Github Action b17db72a63 The next release version will be 0.38.0 2022-06-01 09:36:15 +00:00
Github Action 0f6e89dbe0 Publishing 0.37.0 to the Helm repository 2022-06-01 09:36:14 +00:00
Github Actions 14cd62652c Annotation cheatsheet 2022-06-01 11:33:55 +02:00
Github Action a788cff019 The next release version will be 0.37.0 2022-04-25 06:45:12 +00:00
Github Action d951961c49 Publishing 0.36.0 to the Helm repository 2022-04-25 06:45:11 +00:00
Github Actions 1ba0e4df60 Support for arbitrary yaml pieces 2022-04-25 08:43:38 +02:00
Github Action b761286e38 The next release version will be 0.36.0 2022-03-21 13:36:33 +00:00
Github Action 1400b4a58d Publishing 0.35.0 to the Helm repository 2022-03-21 13:36:32 +00:00
Github Actions e2f8f0042a Should really default to the default storageclass, not to local-path provisioner 2022-03-21 14:35:26 +01:00
Github Action 059523dbf2 The next release version will be 0.35.0 2022-02-11 12:09:51 +00:00
Github Action b9392c085c Publishing 0.34.0 to the Helm repository 2022-02-11 12:09:50 +00:00
szabogabor91 c3e2280489 Add all features to values schema (#39)
Co-authored-by: Laszlo Fogas <laszlo@laszlo.cloud>
2022-02-11 13:08:07 +01:00
Github Action 1722e9bcf1 The next release version will be 0.34.0 2022-01-19 08:09:04 +00:00
Github Action ef6738e62e Publishing 0.33.0 to the Helm repository 2022-01-19 08:09:03 +00:00
Laszlo Fogas ee9e8e95c2 Merge pull request #37 from gimlet-io/path
Making ingress path configurable
2022-01-19 09:05:46 +01:00
Laszlo Fogas df1042fb5a Making ingress path configurable 2022-01-19 09:03:10 +01:00
Laszlo Fogas a2b0e07505 Merge pull request #34 from gimlet-io/laszlocph/increase-readiness-probe-33
Accomodating older services
2021-12-13 15:02:00 +01:00
Laszlo Fogas 7a49d313a5 Accomodating older services 2021-12-13 13:59:49 +00:00
Laszlo Fogas 254d38f05f Broken link 2021-11-16 09:35:21 +01:00
Github Action 7f4f1674b8 The next release version will be 0.33.0 2021-10-21 08:37:41 +00:00
Github Action 569ebb06f1 Publishing 0.32.0 to the Helm repository 2021-10-21 08:37:40 +00:00
Laszlo Fogas a5512f8f8a Same version scheme for cron-job and onechart 2021-10-21 10:36:24 +02:00
Laszlo Fogas 530070b05c Same version scheme for cron-job and onechart 2021-10-21 10:35:14 +02:00
Laszlo Fogas ad2ea458c4 Same version scheme for cron-job and onechart 2021-10-21 10:29:40 +02:00
Laszlo Fogas 6783eb019d Fixing identation for cronjob fields 2021-10-21 10:20:36 +02:00
Github Action 6f1753c46d The next release version will be 0.32.0 2021-09-29 12:19:16 +00:00
Github Action e943d982ef Publishing 0.31.0 to the Helm repository 2021-09-29 12:19:15 +00:00
Laszlo Fogas 213303b10e Merge pull request #32 from gimlet-io/v1-ingress-support
Using networking.k8s.io/v1 Ingress; requires cluster versions >= 1.19
2021-09-29 14:15:50 +02:00
Laszlo Fogas 13d860f7f4 Using networking.k8s.io/v1 Ingress; requires cluster versions >= 1.19 2021-09-29 10:59:17 +02:00
Github Action 47ae89c7e6 The next release version will be 0.31.0 2021-09-18 13:26:59 +00:00
Github Action 7bb30fccab Publishing 0.30.0 to the Helm repository 2021-09-18 13:26:58 +00:00
Laszlo Fogas f38708f864 LivenessProbe support - you can use it, doesn't mean you should 2021-09-18 15:25:37 +02:00
Github Action d9fa868eaa The next release version will be 0.30.0 2021-09-15 06:51:03 +00:00
Github Action 24c8634b09 Publishing 0.29.0 to the Helm repository 2021-09-15 06:51:01 +00:00
Laszlo Fogas 937cb67c30 Support for existingClaim 2021-09-15 08:48:38 +02:00
Laszlo Fogas 07afdb14c1 Fixing cron-job tests 2021-09-08 11:41:10 +02:00
Laszlo Fogas 8c82240186 Making label names robust 2021-09-08 11:31:45 +02:00
Github Action 4e44c8104c The next release version will be 0.29.0 2021-08-27 07:09:19 +00:00
Github Action 2e97926d70 Publishing 0.28.0 to the Helm repository 2021-08-27 07:09:18 +00:00
Laszlo Fogas d6c34a8349 Merge pull request #29 from gimlet-io/fix-robustname
Fixing #28: ingress host names and resource names have different sani…
2021-08-27 09:06:37 +02:00
Laszlo Fogas e85c443284 Fixing #28: ingress host names and resource names have different sanitization needs 2021-08-27 09:03:45 +02:00
Github Action 58292c747e The next release version will be 0.28.0 2021-08-13 07:23:26 +00:00
Github Action 607d4301bf Publishing 0.27.0 to the Helm repository 2021-08-13 07:23:25 +00:00
Laszlo Fogas 269ab7e376 Using unique names for TLS secrets 2021-08-13 09:10:47 +02:00
Laszlo Fogas 324617b0de 0.27.0 coming after RCs 2021-08-13 08:46:49 +02:00
Github Action 6a897ff5a3 The next release version will be 0.28.0 2021-08-05 11:27:26 +00:00
Github Action 10205747f2 Publishing 0.27.0-rc3 to the Helm repository 2021-08-05 11:27:25 +00:00
Laszlo Fogas c56e2aa5b4 Fixing robustName helper 2021-08-05 13:26:49 +02:00
Github Action 167ce8cff5 The next release version will be 0.28.0 2021-08-05 10:26:05 +00:00
Github Action 539caf68a0 Publishing 0.27.0-rc2 to the Helm repository 2021-08-05 10:26:04 +00:00
Laszlo Fogas eec4f30c67 Added json schema and ui meta data to cronjob 2021-08-05 12:25:23 +02:00
Github Action 9609cc2c3a The next release version will be 0.28.0 2021-08-05 10:07:25 +00:00
Github Action 59a5bfde2f Publishing 0.27.0-rc1 to the Helm repository 2021-08-05 10:07:25 +00:00
Laszlo Fogas 98390f73c8 Merge pull request #27 from gimlet-io/schedule-support
Using common chart
2021-08-05 12:05:59 +02:00
Github Action 8417a0363d Publishing 0.27.0-rc1 to the Helm repository 2021-08-05 09:58:13 +00:00
Laszlo Fogas 5910080e17 Fixing release script to not fail on dependency charts 2021-08-05 11:57:18 +02:00
Laszlo Fogas 922111d2de Preparing for rc release 2021-08-05 11:52:28 +02:00
Laszlo Fogas 4352af0abc Moved var and secret support to common 2021-08-05 11:50:18 +02:00
Laszlo Fogas 164bfec8b3 Moved volume support to common 2021-08-05 11:50:18 +02:00
Laszlo Fogas d91040c0a0 Job constraints configurable 2021-08-05 11:50:18 +02:00
Laszlo Fogas 4942164b9a Testing of common chart 2021-08-05 11:50:17 +02:00
Github Action 1082767c59 The next release version will be 0.27.0 2021-08-02 06:50:06 +00:00
Github Action 74c16555dd Publishing 0.26.0 to the Helm repository 2021-08-02 06:50:02 +00:00
Laszlo Fogas ae6c219132 Supporting secretName without secretEnabled 2021-08-02 08:46:29 +02:00
Laszlo Fogas ade37a82c7 Merge pull request #25 from msbsh/fix/ingress-svc-port
fix: Makes use of svcPort within ingress, when defined;
2021-07-29 15:24:31 +02:00
Martin James b249805bf3 fix: Makes use of svcPort within ingress, when defined; 2021-07-27 18:22:05 +02:00
Github Action efd5d819f3 The next release version will be 0.26.0 2021-07-27 08:10:15 +00:00
Github Action b2700d990d Publishing 0.25.0 to the Helm repository 2021-07-27 08:10:13 +00:00
Laszlo Fogas d0d0b28c9a Deployment strategy is configurable; still having the single replica volume rule 2021-07-27 10:02:54 +02:00
Github Action 0a162de948 The next release version will be 0.25.0 2021-07-26 09:34:33 +00:00
Github Action 442c98f5d1 Publishing 0.24.1 to the Helm repository 2021-07-26 09:34:30 +00:00
Laszlo Fogas 73fd1235c2 Fixing duplicated annotation; added tests; prepped for bugfix release 2021-07-26 11:30:57 +02:00
Github Action c68e979ba0 The next release version will be 0.25.0 2021-07-19 14:27:45 +00:00
Github Action 96e8f0db60 Publishing 0.24.0 to the Helm repository 2021-07-19 14:27:42 +00:00
Laszlo Fogas 46cd92059c Merge pull request #24 from gimlet-io/gimlet-taxonomy
Set Gimlet service taxonomy if git data is set
2021-07-19 16:26:02 +02:00
Laszlo Fogas 0000ad9f4b Set Gimlet service taxonomy if git data is set 2021-07-19 16:23:20 +02:00
Github Action 7642eb3dc7 The next release version will be 0.24.0 2021-07-19 13:08:48 +00:00
Github Action 3326cd3c38 Publishing 0.23.0 to the Helm repository 2021-07-19 13:08:46 +00:00
Laszlo Fogas 5ac5e6bc03 Service account 2021-07-19 14:42:29 +02:00
Github Action 54946f8caf The next release version will be 0.23.0 2021-06-22 12:52:35 +00:00
Github Action addc69413c Publishing 0.22.0 to the Helm repository 2021-06-22 12:52:32 +00:00
Laszlo Fogas 50b0f9cf89 Recreate deployment if volumes used with a single replica to avoid stuck pods 2021-06-22 14:46:40 +02:00
Github Action bc933d1668 The next release version will be 0.22.0 2021-05-12 11:18:16 +00:00
Github Action 8c124da61a Publishing 0.21.0 to the Helm repository 2021-05-12 11:18:14 +00:00
194 changed files with 4556 additions and 1220 deletions
+15 -3
View File
@@ -26,25 +26,35 @@ jobs:
- name: Extract chart version - name: Extract chart version
id: chart_version id: chart_version
run: | run: |
CHART_VERSION=$(cat charts/onechart/Chart.yaml | grep version:) CHART_VERSION=$(cat charts/onechart/Chart.yaml | grep ^version:)
CHART_VERSION=${CHART_VERSION#version: } CHART_VERSION=${CHART_VERSION#version: }
echo $CHART_VERSION echo $CHART_VERSION
echo ::set-output name=chart_version::$CHART_VERSION echo ::set-output name=chart_version::$CHART_VERSION
CHART_VERSION=$(cat charts/cron-job/Chart.yaml | grep ^version:)
CHART_VERSION=${CHART_VERSION#version: }
echo $CHART_VERSION
echo ::set-output name=cron_job_chart_version::$CHART_VERSION
- name: Ensure tag and chart version matches - name: Ensure tag and chart version matches
run: | run: |
echo "Run ${{ steps.versioning.outputs.VERSION }}"
echo "${{ steps.chart_version.outputs.CHART_VERSION }}"
echo "$TAG_VERSION" echo "$TAG_VERSION"
echo "$CHART_VERSION" echo "$CHART_VERSION"
echo "$CRON_JOB_CHART_VERSION"
if [ "$TAG_VERSION" != "$CHART_VERSION" ] if [ "$TAG_VERSION" != "$CHART_VERSION" ]
then then
echo "Tag version does not match chart version" echo "Tag version does not match chart version"
exit 1 exit 1
fi fi
if [ "$TAG_VERSION" != "$CRON_JOB_CHART_VERSION" ]
then
echo "Tag version does not match cron-job chart version"
exit 1
fi
env: env:
TAG_VERSION: ${{ steps.versioning.outputs.tag_version }} TAG_VERSION: ${{ steps.versioning.outputs.tag_version }}
CHART_VERSION: ${{ steps.chart_version.outputs.chart_version }} CHART_VERSION: ${{ steps.chart_version.outputs.chart_version }}
CRON_JOB_CHART_VERSION: ${{ steps.chart_version.outputs.cron_job_chart_version }}
- name: Create Release - name: Create Release
id: create_release id: create_release
@@ -85,6 +95,8 @@ jobs:
echo "The new version will be $increased_version" echo "The new version will be $increased_version"
sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/onechart/Chart.yaml sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/onechart/Chart.yaml
sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/cron-job/Chart.yaml
sed -i "s/version: $CHART_VERSION/version: $increased_version/" charts/static-site/Chart.yaml
git status git status
git add . git add .
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+30 -7
View File
@@ -7,46 +7,69 @@ lint:
helm lint charts/onechart/ helm lint charts/onechart/
helm lint charts/cron-job/ helm lint charts/cron-job/
helm lint charts/namespaces/ helm lint charts/namespaces/
helm lint charts/static-site
kubeval: kubeval:
rm -rf manifests && true rm -rf manifests && true
mkdir manifests mkdir manifests
helm template charts/onechart --output-dir manifests helm template charts/onechart --output-dir manifests
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.13.0 find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.20.0
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.18.0 find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.24.0
rm -rf manifests && true rm -rf manifests && true
mkdir manifests mkdir manifests
helm template charts/cron-job --output-dir manifests helm template charts/cron-job --output-dir manifests
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.13.0 find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.20.0
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.18.0 find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.24.0
rm -rf manifests && true rm -rf manifests && true
mkdir manifests mkdir manifests
helm template charts/namespaces --output-dir manifests helm template charts/namespaces --output-dir manifests -f charts/namespaces/fixture.yaml
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.13.0 find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.20.0
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.18.0 find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.24.0
rm -rf manifests && true
mkdir manifests
helm template charts/static-site --output-dir manifests
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.20.0
find manifests/ -name '*.yaml' | xargs kubeval --ignore-missing-schemas -v 1.24.0
test: test:
helm dependency update charts/onechart
helm unittest charts/onechart helm unittest charts/onechart
helm dependency update charts/cron-job
helm unittest charts/cron-job helm unittest charts/cron-job
helm unittest charts/namespaces helm unittest charts/namespaces
helm unittest charts/static-site
package: package:
helm dependency update charts/onechart
helm package charts/onechart helm package charts/onechart
mv onechart*.tgz docs mv onechart*.tgz docs
helm dependency update charts/cron-job
helm package charts/cron-job helm package charts/cron-job
mv cron-job*.tgz docs mv cron-job*.tgz docs
helm package charts/namespaces helm package charts/namespaces
mv namespaces*.tgz docs mv namespaces*.tgz docs
helm package charts/static-site
mv static-site*.tgz docs
helm repo index docs --url https://chart.onechart.dev helm repo index docs --url https://chart.onechart.dev
debug: debug:
helm dependency update charts/onechart
helm template charts/onechart/ -f values.yaml --debug helm template charts/onechart/ -f values.yaml --debug
debug-cron-job:
helm dependency update charts/cron-job
helm template charts/cron-job/ -f values-cron-job.yaml --debug
debug-ui: debug-ui:
#gimlet chart configure -s charts/onechart/values.schema.json -u charts/onechart/helm-ui.json onechart/onechart #gimlet chart configure -s charts/onechart/values.schema.json -u charts/onechart/helm-ui.json onechart/onechart
/home/laszlo/projects/gimlet-cli/build/gimlet chart configure -s charts/onechart/values.schema.json -u charts/onechart/helm-ui.json onechart/onechart /home/laszlo/projects/gimlet-cli/build/gimlet chart configure -s charts/onechart/values.schema.json -u charts/onechart/helm-ui.json onechart/onechart
+2 -2
View File
@@ -4,7 +4,7 @@ A generic Helm chart for your application deployments.
Because no-one can remember the Kubernetes yaml syntax. Because no-one can remember the Kubernetes yaml syntax.
https://onechart.dev/ https://gimlet.io/docs/onechart-reference
## Getting started ## Getting started
@@ -30,7 +30,7 @@ helm install my-release onechart/onechart \
--set image.tag=1.19.3 --set image.tag=1.19.3
``` ```
See all [Examples](/examples/deploying-an-image) See all [Examples](/website/docs/examples/)
## Contribution Guidelines ## Contribution Guidelines
+23
View File
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
+18
View File
@@ -0,0 +1,18 @@
apiVersion: v2
name: common
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: library
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.0
+16
View File
@@ -0,0 +1,16 @@
{{- define "common.configmap.tpl" -}}
{{- if .Values.vars }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.vars }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
{{- end -}}
@@ -0,0 +1,16 @@
{{- define "common.customFileConfigmap.tpl" -}}
{{- range .Values.volumes }}
{{- if .fileName }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }}
namespace: {{ $.Release.Namespace }}
data:
{{ .fileName }}: |
{{- .fileContent | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}
+31
View File
@@ -0,0 +1,31 @@
{{- define "common.envFromRef.tpl" -}}
{{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets -}}
envFrom: &envFrom
{{- if .Values.vars }}
- configMapRef:
name: {{ template "common.robustName" .Release.Name }}
{{- end }}
{{- range .Values.existingSecrets }}
- secretRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
{{- range .Values.existingConfigMaps }}
- configMapRef:
name: {{ .name }}
optional: {{ .optional | default false }}
{{- end }}
{{- if .Values.secretEnabled }}
- secretRef:
name: {{ include "common.robustName" $.Release.Name }}
{{- end }}
{{- if .Values.secretName }}
- secretRef:
name: {{ .Values.secretName }}
{{- end }}
{{- if .Values.sealedSecrets }}
- secretRef:
name: {{ template "common.robustName" .Release.Name }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,3 +1,4 @@
{{- define "common.fileSecret.tpl" -}}
{{- range .Values.fileSecrets }} {{- range .Values.fileSecrets }}
--- ---
kind: Secret kind: Secret
@@ -11,3 +12,4 @@ data:
{{ $key }}: {{ $val | b64enc }} {{ $key }}: {{ $val | b64enc }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end -}}
+10
View File
@@ -0,0 +1,10 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Create robustName that can be used as Kubernetes resource name, and as subdomain as well
\w Latin letters, digits, underscore '_' .
\W all but \w .
*/}}
{{- define "common.robustName" -}}
{{ regexReplaceAll "\\W+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" }}
{{- end }}
+26
View File
@@ -0,0 +1,26 @@
{{- define "common.pvc.tpl" -}}
{{- range .Values.volumes }}
{{- if not (or .existingClaim .hostPath .fileName .emptyDir .existingConfigMap) }}
{{- $robustName := include "common.robustName" $.Release.Name }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s-%s" $robustName .name }}
namespace: {{ $.Release.Namespace }}
{{- if .pvcAnnotations }}
annotations:
{{- toYaml .pvcAnnotations | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .accessMode | default "ReadWriteOnce" }}
{{- if .storageClass }}
storageClassName: {{ .storageClass }}
{{- end }}
resources:
requests:
storage: {{ .size | default "1Gi" }}
{{- end }}
{{- end }}
{{- end -}}
@@ -1,5 +1,6 @@
{{- define "common.sealedFileSecret.tpl" -}}
{{- range .Values.sealedFileSecrets }} {{- range .Values.sealedFileSecrets }}
{{- $robustName := include "robustName" $.Release.Name }} {{- $robustName := include "common.robustName" $.Release.Name }}
--- ---
apiVersion: bitnami.com/v1alpha1 apiVersion: bitnami.com/v1alpha1
kind: SealedSecret kind: SealedSecret
@@ -22,3 +23,4 @@ spec:
name: {{ printf "%s-%s" $.Release.Name .name }} name: {{ printf "%s-%s" $.Release.Name .name }}
namespace: {{ $.Release.Namespace }} namespace: {{ $.Release.Namespace }}
{{- end }} {{- end }}
{{- end -}}
@@ -1,8 +1,9 @@
{{- if .Values.sealedSecrets }} {{- define "common.sealedSecret.tpl" -}}
{{- if .Values.sealedSecrets }}
apiVersion: bitnami.com/v1alpha1 apiVersion: bitnami.com/v1alpha1
kind: SealedSecret kind: SealedSecret
metadata: metadata:
name: {{ template "robustName" .Release.Name }} name: {{ template "common.robustName" .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "helm-chart.labels" . | nindent 4 }} {{- include "helm-chart.labels" . | nindent 4 }}
@@ -15,6 +16,7 @@ spec:
{{- end }} {{- end }}
template: template:
metadata: metadata:
name: {{ template "robustName" .Release.Name }} name: {{ template "common.robustName" .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
{{- end }} {{- end }}
{{- end -}}
@@ -0,0 +1,39 @@
{{- define "common.volumeMountsRef.tpl" -}}
{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}}
volumeMounts: &volumeMounts
{{- range .Values.volumes }}
{{- if not (hasPrefix "init-" .name) }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.sealedFileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- range .Values.fileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- range .Values.existingFileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- if .subPath}}
subPath: {{ .subPath }}
{{- end }}
readOnly: true
{{- end }}
{{- end }}
{{- end }}
+45
View File
@@ -0,0 +1,45 @@
{{- define "common.volumesRef.tpl" -}}
{{- if or (or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets) .Values.existingFileSecrets -}}
volumes:
{{- range .Values.volumes }}
- name: {{ .name }}
{{- if .emptyDir }}
emptyDir: {}
{{- else if .existingConfigMap }}
configMap:
name: {{ .existingConfigMap }}
{{- else if .fileName }}
configMap:
name: {{ template "common.robustName" (printf "%s-%s" $.Release.Name .name) }}
{{- else if .hostPath }}
hostPath:
path: {{ .hostPath.path }}
{{- if .hostPath.type }}
type: {{ .hostPath.type }}
{{- end }}
{{- else }}
persistentVolumeClaim:
{{- if .existingClaim }}
claimName: {{ .existingClaim }}
{{ else }}
claimName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- end }}
{{- end }}
{{- range .Values.sealedFileSecrets }}
- name: {{ .name }}
secret:
secretName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- range .Values.fileSecrets }}
- name: {{ .name }}
secret:
secretName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- range .Values.existingFileSecrets }}
- name: {{ .name }}
secret:
secretName: {{ .name }}
{{- end }}
{{- end }}
{{- end -}}
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.4.0
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
generated: "2023-10-20T10:53:13.982995773+02:00"
+6 -1
View File
@@ -15,4 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.2 version: 0.62.0
dependencies:
- name: common
version: 0.4.0
repository: file://../common
Binary file not shown.
+72
View File
@@ -0,0 +1,72 @@
[
{
"schemaIDs": [
"#/properties/schedule",
"#/properties/image",
"#/properties/shell",
"#/properties/command"
],
"uiSchema": {
"#/properties/replicas": {
"ui:widget": "range"
}
},
"metaData": {
"name": "Basics",
"icon": "M17 8l4 4m0 0l-4 4m4-4H3"
}
},
{
"schemaIDs": [
"#/properties/resources"
],
"uiSchema": {
},
"metaData": {
"name": "Resources",
"icon": "M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"
}
},
{
"schemaIDs": [
"#/properties/vars"
],
"uiSchema": {
"#/properties/vars": {
"additionalProperties": {
"type": "string"
}
}
},
"metaData": {
"name": "Environment Variables",
"icon": "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
}
},
{
"schemaIDs": [
"#/properties/sealedSecrets"
],
"uiSchema": {
"#/properties/sealedSecrets": {
"additionalProperties": {
"type": "string"
}
}
},
"metaData": {
"name": "Sealed Secrets",
"icon": "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
}
},
{
"schemaIDs": [
"#/properties/volumes"
],
"uiSchema": {},
"metaData": {
"name": "Volumes",
"icon": "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"
}
}
]
+10 -1
View File
@@ -48,7 +48,7 @@ Selector labels
*/}} */}}
{{- define "helm-chart.selectorLabels" -}} {{- define "helm-chart.selectorLabels" -}}
app.kubernetes.io/name: {{ include "helm-chart.name" . }} app.kubernetes.io/name: {{ include "helm-chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ template "robustName" .Release.Name }}
{{- end }} {{- end }}
{{/* {{/*
@@ -61,3 +61,12 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }} {{- default "default" .Values.serviceAccount.name }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Create robustName that can be used as Kubernetes resource name, and as subdomain as well
\w Latin letters, digits, underscore '_' .
\W all but \w .
*/}}
{{- define "robustName" -}}
{{ regexReplaceAll "\\W+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" }}
{{- end }}
+1 -13
View File
@@ -1,13 +1 @@
{{- if .Values.vars }} {{- include "common.configmap.tpl" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.vars }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
+15 -31
View File
@@ -1,4 +1,4 @@
apiVersion: batch/v1beta1 apiVersion: batch/v1
kind: CronJob kind: CronJob
metadata: metadata:
name: {{ .Release.Name }} name: {{ .Release.Name }}
@@ -7,10 +7,9 @@ metadata:
{{- include "helm-chart.labels" . | nindent 4 }} {{- include "helm-chart.labels" . | nindent 4 }}
spec: spec:
schedule: {{ .Values.schedule | quote }} schedule: {{ .Values.schedule | quote }}
successfulJobsHistoryLimit: 1 {{- with .Values.constraints }}
failedJobsHistoryLimit: 1 {{- toYaml . | nindent 2 }}
concurrencyPolicy: Forbid {{- end }}
startingDeadlineSeconds: 120
jobTemplate: jobTemplate:
spec: spec:
template: template:
@@ -26,41 +25,26 @@ spec:
{{- if .Values.vars }} {{- if .Values.vars }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- end }} {{- end }}
{{- if .Values.overrideCommand }}
command: command:
- {{ .Values.shell }} - {{ .Values.shell }}
- -c - -c
- {{ .Values.command | quote }} - {{ .Values.command | quote }}
envFrom: {{- end }}
{{- if .Values.vars }} {{- include "common.envFromRef.tpl" . | nindent 14 }}
- configMapRef: {{- include "common.volumeMountsRef.tpl" . | nindent 14 }}
name: {{ .Release.Name }}
{{- end }}
{{- if .Values.secret.enabled }}
- secretRef:
name: {{ .Release.Name }}
{{- end }}
volumeMounts:
{{- range .Values.volumes }}
- name: {{ .name }}
mountPath: {{ .path }}
{{- end }}
resources: resources:
{{- toYaml .Values.resources | nindent 16 }} {{- toYaml .Values.resources | nindent 16 }}
volumes: {{- include "common.volumesRef.tpl" . | nindent 10 }}
{{- range .Values.volumes }} {{- with .Values.nodeSelector }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{ with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{ toYaml . | nindent 8 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
{{ with .Values.affinity }} {{- with .Values.affinity }}
affinity: affinity:
{{ toYaml . | nindent 8 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
{{ with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations:
{{ toYaml . | nindent 8 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
@@ -0,0 +1 @@
{{- include "common.customFileConfigmap.tpl" . -}}
@@ -0,0 +1 @@
{{- include "common.fileSecret.tpl" . -}}
+1 -15
View File
@@ -1,15 +1 @@
{{- range .Values.volumes }} {{- include "common.pvc.tpl" . -}}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s-%s" $.Release.Name .name }}
namespace: {{ $.Release.Namespace }}
spec:
accessModes:
- {{ .accessMode | default "ReadWriteOnce" }}
storageClassName: {{ .storageClass | default "local-path" }}
resources:
requests:
storage: {{ .size | default "1Gi" }}
{{- end }}
@@ -0,0 +1 @@
{{- include "common.sealedFileSecret.tpl" . -}}
@@ -0,0 +1 @@
{{- include "common.sealedSecret.tpl" . -}}
@@ -13,7 +13,7 @@ tests:
path: spec.jobTemplate.spec.template.spec.containers[0].envFrom path: spec.jobTemplate.spec.template.spec.containers[0].envFrom
content: content:
configMapRef: configMapRef:
name: RELEASE-NAME name: release-name
- it: Should not reference configmap if vars are not set - it: Should not reference configmap if vars are not set
asserts: asserts:
- isNull: - isNull:
@@ -0,0 +1,17 @@
suite: test cron job
templates:
- cronJob.yaml
tests:
- it: Should have default constraints
asserts:
- equal:
path: spec.successfulJobsHistoryLimit
value: 1
- it: Should constraints be configurable
set:
constraints:
successfulJobsHistoryLimit: 2
asserts:
- equal:
path: spec.successfulJobsHistoryLimit
value: 2
@@ -0,0 +1,11 @@
suite: test cron job
templates:
- cronJob.yaml
tests:
- it: Should set schedule
set:
schedule: "*/1 * * * *"
asserts:
- equal:
path: spec.schedule
value: "*/1 * * * *"
@@ -0,0 +1,28 @@
suite: test deployment
templates:
- cronJob.yaml
tests:
- it: Should mount volume
set: &values
sealedFileSecrets:
- name: google-account-key
path: /google-account-key
filesToMount:
- name: key.json
sourcePath: my-google-acoount-key.json
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts
value:
- name: google-account-key
mountPath: /google-account-key
readOnly: true
- it: Should reference volume
set: *values
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.volumes
value:
- name: google-account-key
secret:
secretName: RELEASE-NAME-google-account-key
@@ -5,16 +5,16 @@ templates:
tests: tests:
- it: Should reference secret if secret is enabled - it: Should reference secret if secret is enabled
set: set:
secret.enabled: true secretEnabled: true
asserts: asserts:
- contains: - contains:
path: spec.jobTemplate.spec.template.spec.containers[0].envFrom path: spec.jobTemplate.spec.template.spec.containers[0].envFrom
content: content:
secretRef: secretRef:
name: RELEASE-NAME name: release-name
- it: Should not reference secret if secret is disabled - it: Should not reference secret if secret is disabled
set: set:
secret.enabled: false secretEnabled: false
asserts: asserts:
- isNull: - isNull:
path: spec.jobTemplate.spec.template.spec.containers[0].envFrom path: spec.jobTemplate.spec.template.spec.containers[0].envFrom
+323
View File
@@ -0,0 +1,323 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"required": [],
"properties": {
"image": {
"$id": "#/properties/image",
"type": "object",
"title": "Image",
"description": "The image to deploy",
"default": {},
"examples": [
{
"repository": "nginx",
"tag": "latest"
}
],
"required": [
"repository",
"tag"
],
"properties": {
"repository": {
"$id": "#/properties/image/properties/repository",
"type": "string",
"title": "Repository",
"description": "",
"default": "nginx",
"examples": [
"nginx"
]
},
"tag": {
"$id": "#/properties/image/properties/tag",
"type": "string",
"title": "Tag",
"description": "",
"default": "1.19.3",
"examples": [
"latest"
]
}
}
},
"podAnnotations": {
"$id": "#/properties/podAnnotations",
"type": "object",
"title": "The podAnnotations schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"resources": {
"$id": "#/properties/resources",
"type": "object",
"title": "",
"description": "",
"default": {},
"examples": [
{
"requests": {
"cpu": "200m",
"memory": "200mi"
},
"limits": {
"cpu": "200m",
"memory": "200mi"
}
}
],
"required": [],
"properties": {
"requests": {
"$id": "#/properties/resources/properties/requests",
"type": "object",
"title": "Requests",
"description": "The typical resources your app uses",
"default": {},
"examples": [
{
"cpu": "200m",
"memory": "200mi"
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/resources/properties/requests/properties/cpu",
"type": "string",
"title": "CPU",
"description": "",
"default": "200m",
"examples": [
"200m"
]
},
"memory": {
"$id": "#/properties/resources/properties/requests/properties/memory",
"type": "string",
"title": "Memory",
"description": "",
"default": "200Mi",
"examples": [
"200mi"
]
}
}
},
"limits": {
"$id": "#/properties/resources/properties/limits",
"type": "object",
"title": "Limits",
"description": "The maximum resources your app may use",
"default": {},
"examples": [
{
"cpu": "200m",
"memory": "200mi"
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/resources/properties/limits/properties/cpu",
"type": "string",
"title": "CPU",
"description": "The hard ceiling for the app's CPU usage. The app will be throttled to this limit. 1000m or 1000 CPU shares = 1 CPU core",
"default": "200m",
"examples": [
"200m"
]
},
"memory": {
"$id": "#/properties/resources/properties/limits/properties/memory",
"type": "string",
"title": "Memory",
"description": "The hard ceiling for the app's memory usage. The app will be RESTARTED if it reaches this limit",
"default": "200Mi",
"examples": [
"200mi"
]
}
}
}
}
},
"nodeSelector": {
"$id": "#/properties/nodeSelector",
"type": "object",
"title": "The nodeSelector schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"tolerations": {
"$id": "#/properties/tolerations",
"type": "array",
"title": "The tolerations schema",
"description": "An explanation about the purpose of this instance.",
"default": [],
"examples": [
[]
],
"additionalItems": true,
"items": {
"$id": "#/properties/tolerations/items"
}
},
"affinity": {
"$id": "#/properties/affinity",
"type": "object",
"title": "The affinity schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"secret": {
"$id": "#/properties/secret",
"type": "object",
"title": "The secret schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"enabled": false
}
],
"required": [
"enabled"
],
"properties": {
"enabled": {
"$id": "#/properties/secret/properties/enabled",
"type": "boolean",
"title": "The enabled schema",
"description": "An explanation about the purpose of this instance.",
"default": false,
"examples": [
false
]
}
},
"additionalProperties": true
},
"shell": {
"$id": "#/properties/shell",
"type": "string",
"title": "Shell",
"description": "The shell to use",
"default": "/bin/sh"
},
"command": {
"$id": "#/properties/command",
"type": "string",
"title": "Command",
"description": "The command to run in the cronjob",
"default": "echo \"I'm alive\""
},
"schedule": {
"$id": "#/properties/schedule",
"type": "string",
"title": "Schedule",
"description": "Schedule your cronjob",
"default": "*/1 * * * *"
},
"vars": {
"$id": "#/properties/vars",
"type": "object",
"title": "Environment variables",
"description": "",
"default": {},
"examples": [
{
"VAR_1": "value 1",
"VAR_2": "value 2"
}
],
"required": [],
"properties": {},
"additionalProperties": true
},
"sealedSecrets": {
"$id": "#/properties/sealedSecrets",
"type": "object",
"title": "Sealed Secrets",
"description": "",
"default": {},
"examples": [
{
"VAR_1": "value 1",
"VAR_2": "value 2"
}
],
"required": [],
"properties": {},
"additionalProperties": true
},
"volumes": {
"$id": "#/properties/volumes",
"type": "array",
"title": "Volumes",
"default": [],
"additionalItems": true,
"items": {
"$id": "#/properties/volumes/items",
"type": "object",
"properties": {
"name": {
"$id": "#/properties/volumes/items/anyOf/0/properties/name",
"type": "string",
"title": "Name",
"description": "The name of the volume. Used only to recognize the volumes purpose in the config later on",
"default": "data"
},
"path": {
"$id": "#/properties/volumes/items/anyOf/0/properties/path",
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
},
"size": {
"$id": "#/properties/volumes/items/anyOf/0/properties/size",
"type": "string",
"title": "Size",
"description": "",
"default": "10Gi"
},
"storageClass": {
"$id": "#/properties/volumes/items/anyOf/0/properties/storageClass",
"type": "string",
"title": "Storage Class",
"description": "The slug indicating the disk type in your cloud provider. `standard` on Google Cloud, `default` on Azure; `do-block-storage` on Digital Ocean",
"default": ""
}
}
}
}
},
"additionalProperties": true
}
+7
View File
@@ -5,6 +5,7 @@ image:
schedule: "*/1 * * * *" schedule: "*/1 * * * *"
command: | command: |
echo "I'm alive" echo "I'm alive"
overrideCommand: true
shell: "/bin/sh" shell: "/bin/sh"
nameOverride: "" nameOverride: ""
@@ -27,3 +28,9 @@ affinity: {}
secret: secret:
enabled: false enabled: false
constraints:
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
concurrencyPolicy: Forbid
startingDeadlineSeconds: 120
+1 -1
View File
@@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.0 version: 0.3.0
+18
View File
@@ -0,0 +1,18 @@
namespaces:
- name: staging
quota:
cpu: 32
memory: "64Gi"
storage: "500Gi"
overcommit:
cpu: 1
memory: 1
podMaximumResources:
cpu: 4
memory: "8Gi"
podDefaultResources:
cpu: "200m"
memory: "200Mi"
podResourceOvercommit:
cpu: 2
memory: 1
+19 -29
View File
@@ -1,22 +1,5 @@
{{- range .Values.namespaces }} {{- range .Values.namespaces }}
{{- $limits := $.Values.pod.limits }} {{- if and .podMaximumResources (and .podDefaultResources .podResourceOvercommit) }}
{{- if .pod }}
{{- if .pod.limits }}
{{- $limits = .pod.limits }}
{{- end }}
{{- end }}
{{- $overcommit := $.Values.pod.overcommit }}
{{- if .pod }}
{{- if .pod.overcommit }}
{{- $overcommit = .pod.overcommit }}
{{- end }}
{{- end }}
{{- $defaults := $.Values.pod.defaults }}
{{- if .pod }}
{{- if .pod.defaults }}
{{- $defaults = .pod.defaults }}
{{- end }}
{{- end }}
--- ---
apiVersion: v1 apiVersion: v1
kind: LimitRange kind: LimitRange
@@ -26,19 +9,26 @@ metadata:
spec: spec:
limits: limits:
- type: Container - type: Container
{{- if .podMaximumResources }}
max: max:
cpu: 4 cpu: {{ .podMaximumResources.cpu }}
memory: "8Gi" memory: {{ .podMaximumResources.memory }}
min: {{- end }}
cpu: "100m" {{- if .podDefaultResources }}
memory: "50Mi"
default: default:
cpu: {{ $defaults.cpu }} cpu: {{ .podDefaultResources.cpu }}
memory: {{ $defaults.memory }} memory: {{ .podDefaultResources.memory }}
defaultRequest: defaultRequest:
cpu: {{ $defaults.cpu }} cpu: {{ .podDefaultResources.cpu }}
memory: {{ $defaults.memory }} memory: {{ .podDefaultResources.memory }}
{{- end }}
maxLimitRequestRatio: maxLimitRequestRatio:
cpu: {{ $overcommit.cpu }} {{- if .podResourceOvercommit }}
memory: {{ $overcommit.memory }} cpu: {{ .podResourceOvercommit.cpu }}
memory: {{ .podResourceOvercommit.memory }}
{{ else }}
cpu: 1
memory: 1
{{- end }}
{{- end }}
{{- end }} {{- end }}
+2 -2
View File
@@ -4,8 +4,8 @@ apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
name: {{ .name }} name: {{ .name }}
{{- if .annotations }}
annotations: annotations:
{{- if .annotations }}
{{- toYaml .annotations | nindent 4 }} {{- toYaml .annotations | nindent 4 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
@@ -1,16 +1,5 @@
{{- range .Values.namespaces }} {{- range .Values.namespaces }}
{{- $budget := $.Values.namespace.budget }} {{- if and .quota .overcommit }}
{{- if .namespace }}
{{- if .namespace.budget }}
{{- $budget = .namespace.budget }}
{{- end }}
{{- end }}
{{- $overcommit := $.Values.namespace.overcommit }}
{{- if .namespace }}
{{- if .namespace.overcommit }}
{{- $overcommit = .namespace.overcommit }}
{{- end }}
{{- end }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ResourceQuota kind: ResourceQuota
@@ -18,9 +7,10 @@ metadata:
name: {{ .name }} name: {{ .name }}
spec: spec:
hard: hard:
limits.cpu: {{ $budget.cpu | mul $overcommit.cpu }} limits.cpu: {{ .quota.cpu | mul .overcommit.cpu }}
limits.memory: {{ $budget.memory | regexFind "[1-9]+" | mul $overcommit.memory }}{{ $budget.memory | regexFind "[a-zA-Z]+" }} limits.memory: {{ .quota.memory | regexFind "[1-9]+" | mul .overcommit.memory }}{{ .quota.memory | regexFind "[a-zA-Z]+" }}
requests.cpu: {{ $budget.cpu }} requests.cpu: {{ .quota.cpu }}
requests.memory: {{ $budget.memory }} requests.memory: {{ .quota.memory }}
requests.storage: {{ $budget.storage }} requests.storage: {{ .quota.storage }}
{{- end }} {{- end }}
{{- end -}}
+11 -47
View File
@@ -2,52 +2,19 @@ suite: test deployment
templates: templates:
- limit-range.yaml - limit-range.yaml
tests: tests:
- it: Should set default limits
set:
pod:
limits:
cpu: 4
memory: "8Gi"
defaults:
cpu: "200m"
memory: "200Mi"
overcommit:
cpu: 10
memory: 2
asserts:
- equal:
path: spec.limits
value:
- type: Container
max:
cpu: 4
memory: "8Gi"
min:
cpu: "100m"
memory: "50Mi"
default:
cpu: "200m"
memory: "200Mi"
defaultRequest:
cpu: "200m"
memory: "200Mi"
maxLimitRequestRatio:
cpu: 10
memory: 2
- it: Should set namespace specific limits - it: Should set namespace specific limits
set: set:
namespaces: namespaces:
- name: staging - name: staging
pod: podMaximumResources:
limits: cpu: 4
cpu: 4 memory: "8Gi"
memory: "8Gi" podDefaultResources:
defaults: cpu: "200m"
cpu: "200m" memory: "200Mi"
memory: "200Mi" podResourceOvercommit:
overcommit: cpu: 2
cpu: 10 memory: 1
memory: 2
asserts: asserts:
- equal: - equal:
path: spec.limits path: spec.limits
@@ -56,9 +23,6 @@ tests:
max: max:
cpu: 4 cpu: 4
memory: "8Gi" memory: "8Gi"
min:
cpu: "100m"
memory: "50Mi"
default: default:
cpu: "200m" cpu: "200m"
memory: "200Mi" memory: "200Mi"
@@ -66,5 +30,5 @@ tests:
cpu: "200m" cpu: "200m"
memory: "200Mi" memory: "200Mi"
maxLimitRequestRatio: maxLimitRequestRatio:
cpu: 10 cpu: 2
memory: 2 memory: 1
+7
View File
@@ -10,3 +10,10 @@ tests:
- equal: - equal:
path: metadata.name path: metadata.name
value: staging value: staging
- it: Should not set annotations if none provided in values
set:
namespaces:
- name: staging
asserts:
- isNull:
path: metadata.annotations
@@ -2,16 +2,37 @@ suite: test deployment
templates: templates:
- resource-quota.yaml - resource-quota.yaml
tests: tests:
- it: Should set default quota values - it: Should set namespace specific quotas
set: set:
namespace: namespaces:
budget: - name: staging
cpu: 32 quota:
memory: "64Gi" cpu: 32
storage: "500Gi" memory: "64Gi"
overcommit: storage: "500Gi"
cpu: 2 overcommit:
memory: 1 cpu: 1
memory: 1
asserts:
- equal:
path: spec.hard
value:
limits.cpu: 32
limits.memory: "64Gi"
requests.cpu: 32
requests.memory: "64Gi"
requests.storage: "500Gi"
- it: Should handle overcommit
set:
namespaces:
- name: staging
quota:
cpu: 32
memory: "64Gi"
storage: "500Gi"
overcommit:
cpu: 2
memory: 1
asserts: asserts:
- equal: - equal:
path: spec.hard path: spec.hard
@@ -21,29 +42,3 @@ tests:
requests.cpu: 32 requests.cpu: 32
requests.memory: "64Gi" requests.memory: "64Gi"
requests.storage: "500Gi" requests.storage: "500Gi"
- it: Should set namespace specific quotas
set:
namespaces:
- name: staging
namespace:
budget:
cpu: 8
memory: "16Gi"
storage: "100Gi"
namespace:
budget:
cpu: 32
memory: "64Gi"
storage: "500Gi"
overcommit:
cpu: 2
memory: 1
asserts:
- equal:
path: spec.hard
value:
limits.cpu: 16
limits.memory: "16Gi"
requests.cpu: 8
requests.memory: "16Gi"
requests.storage: "100Gi"
-715
View File
@@ -1,715 +0,0 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"namespaces": [
{
"name": "staging",
"namespace": {
"budget": {
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
},
"overcommit": {
"cpu": 2,
"memory": 1
}
},
"pod": {
"limits": {
"cpu": 4,
"memory": "8Gi"
},
"defaults": {
"cpu": "200m",
"memory": "200Mi"
},
"overcommit": {
"cpu": 10,
"memory": 2
}
}
}
],
"namespace": {
"budget": {
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
},
"overcommit": {
"cpu": 2,
"memory": 1
}
},
"pod": {
"limits": {
"cpu": 4,
"memory": "8Gi"
},
"defaults": {
"cpu": "200m",
"memory": "200Mi"
},
"overcommit": {
"cpu": 10,
"memory": 2
}
}
}
],
"required": [
"namespaces",
"namespace",
"pod"
],
"properties": {
"namespaces": {
"$id": "#/properties/namespaces",
"type": "array",
"title": "The namespaces schema",
"description": "An explanation about the purpose of this instance.",
"default": [],
"examples": [
[
{
"name": "staging",
"namespace": {
"budget": {
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
},
"overcommit": {
"cpu": 2,
"memory": 1
}
},
"pod": {
"limits": {
"cpu": 4,
"memory": "8Gi"
},
"defaults": {
"cpu": "200m",
"memory": "200Mi"
},
"overcommit": {
"cpu": 10,
"memory": 2
}
}
}
]
],
"additionalItems": true,
"items": {
"$id": "#/properties/namespaces/items",
"anyOf": [
{
"$id": "#/properties/namespaces/items/anyOf/0",
"type": "object",
"title": "The first anyOf schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"name": "staging",
"namespace": {
"budget": {
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
},
"overcommit": {
"cpu": 2,
"memory": 1
}
},
"pod": {
"limits": {
"cpu": 4,
"memory": "8Gi"
},
"defaults": {
"cpu": "200m",
"memory": "200Mi"
},
"overcommit": {
"cpu": 10,
"memory": 2
}
}
}
],
"required": [
"name",
"namespace",
"pod"
],
"properties": {
"name": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/name",
"type": "string",
"title": "The name schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"staging"
]
},
"namespace": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace",
"type": "object",
"title": "The namespace schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"budget": {
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
},
"overcommit": {
"cpu": 2,
"memory": 1
}
}
],
"required": [
"budget",
"overcommit"
],
"properties": {
"budget": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/budget",
"type": "object",
"title": "The budget schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
}
],
"required": [
"cpu",
"memory",
"storage"
],
"properties": {
"cpu": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/budget/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
32
]
},
"memory": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/budget/properties/memory",
"type": "string",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"64Gi"
]
},
"storage": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/budget/properties/storage",
"type": "string",
"title": "The storage schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"500Gi"
]
}
},
"additionalProperties": true
},
"overcommit": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/overcommit",
"type": "object",
"title": "The overcommit schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 2,
"memory": 1
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/overcommit/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
2
]
},
"memory": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/namespace/properties/overcommit/properties/memory",
"type": "integer",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
1
]
}
},
"additionalProperties": true
}
},
"additionalProperties": true
},
"pod": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod",
"type": "object",
"title": "The pod schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"limits": {
"cpu": 4,
"memory": "8Gi"
},
"defaults": {
"cpu": "200m",
"memory": "200Mi"
},
"overcommit": {
"cpu": 10,
"memory": 2
}
}
],
"required": [
"limits",
"defaults",
"overcommit"
],
"properties": {
"limits": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/limits",
"type": "object",
"title": "The limits schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 4,
"memory": "8Gi"
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/limits/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
4
]
},
"memory": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/limits/properties/memory",
"type": "string",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"8Gi"
]
}
},
"additionalProperties": true
},
"defaults": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/defaults",
"type": "object",
"title": "The defaults schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": "200m",
"memory": "200Mi"
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/defaults/properties/cpu",
"type": "string",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"200m"
]
},
"memory": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/defaults/properties/memory",
"type": "string",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"200Mi"
]
}
},
"additionalProperties": true
},
"overcommit": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/overcommit",
"type": "object",
"title": "The overcommit schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 10,
"memory": 2
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/overcommit/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
10
]
},
"memory": {
"$id": "#/properties/namespaces/items/anyOf/0/properties/pod/properties/overcommit/properties/memory",
"type": "integer",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
2
]
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
]
}
},
"namespace": {
"$id": "#/properties/namespace",
"type": "object",
"title": "The namespace schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"budget": {
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
},
"overcommit": {
"cpu": 2,
"memory": 1
}
}
],
"required": [
"budget",
"overcommit"
],
"properties": {
"budget": {
"$id": "#/properties/namespace/properties/budget",
"type": "object",
"title": "The budget schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 32,
"memory": "64Gi",
"storage": "500Gi"
}
],
"required": [
"cpu",
"memory",
"storage"
],
"properties": {
"cpu": {
"$id": "#/properties/namespace/properties/budget/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
32
]
},
"memory": {
"$id": "#/properties/namespace/properties/budget/properties/memory",
"type": "string",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"64Gi"
]
},
"storage": {
"$id": "#/properties/namespace/properties/budget/properties/storage",
"type": "string",
"title": "The storage schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"500Gi"
]
}
},
"additionalProperties": true
},
"overcommit": {
"$id": "#/properties/namespace/properties/overcommit",
"type": "object",
"title": "The overcommit schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 2,
"memory": 1
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/namespace/properties/overcommit/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
2
]
},
"memory": {
"$id": "#/properties/namespace/properties/overcommit/properties/memory",
"type": "integer",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
1
]
}
},
"additionalProperties": true
}
},
"additionalProperties": true
},
"pod": {
"$id": "#/properties/pod",
"type": "object",
"title": "The pod schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"limits": {
"cpu": 4,
"memory": "8Gi"
},
"defaults": {
"cpu": "200m",
"memory": "200Mi"
},
"overcommit": {
"cpu": 10,
"memory": 2
}
}
],
"required": [
"limits",
"defaults",
"overcommit"
],
"properties": {
"limits": {
"$id": "#/properties/pod/properties/limits",
"type": "object",
"title": "The limits schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 4,
"memory": "8Gi"
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/pod/properties/limits/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
4
]
},
"memory": {
"$id": "#/properties/pod/properties/limits/properties/memory",
"type": "string",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"8Gi"
]
}
},
"additionalProperties": true
},
"defaults": {
"$id": "#/properties/pod/properties/defaults",
"type": "object",
"title": "The defaults schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": "200m",
"memory": "200Mi"
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/pod/properties/defaults/properties/cpu",
"type": "string",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"200m"
]
},
"memory": {
"$id": "#/properties/pod/properties/defaults/properties/memory",
"type": "string",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": "",
"examples": [
"200Mi"
]
}
},
"additionalProperties": true
},
"overcommit": {
"$id": "#/properties/pod/properties/overcommit",
"type": "object",
"title": "The overcommit schema",
"description": "An explanation about the purpose of this instance.",
"default": {},
"examples": [
{
"cpu": 10,
"memory": 2
}
],
"required": [
"cpu",
"memory"
],
"properties": {
"cpu": {
"$id": "#/properties/pod/properties/overcommit/properties/cpu",
"type": "integer",
"title": "The cpu schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
10
]
},
"memory": {
"$id": "#/properties/pod/properties/overcommit/properties/memory",
"type": "integer",
"title": "The memory schema",
"description": "An explanation about the purpose of this instance.",
"default": 0,
"examples": [
2
]
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
},
"additionalProperties": true
}
+1 -40
View File
@@ -1,40 +1 @@
namespaces: namespaces: []
- name: staging
namespace:
budget:
cpu: 32
memory: "64Gi"
storage: "500Gi"
overcommit:
cpu: 2
memory: 1
pod:
limits:
cpu: 4
memory: "8Gi"
defaults:
cpu: "200m"
memory: "200Mi"
overcommit:
cpu: 10
memory: 2
namespace:
budget:
cpu: 32
memory: "64Gi"
storage: "500Gi"
overcommit:
cpu: 2
memory: 1
pod:
limits:
cpu: 4
memory: "8Gi"
defaults:
cpu: "200m"
memory: "200Mi"
overcommit:
cpu: 10
memory: 2
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: file://../common
version: 0.4.0
digest: sha256:d4eccd332ada7362f429e04b82022f5605a02e2d3aa7b9fdf8adaf4f6c9e03eb
generated: "2023-10-20T10:52:47.237955041+02:00"
+6 -1
View File
@@ -15,4 +15,9 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.21.0 version: 0.62.0
dependencies:
- name: common
version: 0.4.0
repository: file://../common
Binary file not shown.
+62 -9
View File
@@ -19,8 +19,7 @@
"schemaIDs": [ "schemaIDs": [
"#/properties/resources" "#/properties/resources"
], ],
"uiSchema": { "uiSchema": {},
},
"metaData": { "metaData": {
"name": "Resources", "name": "Resources",
"icon": "M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z" "icon": "M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z"
@@ -28,7 +27,8 @@
}, },
{ {
"schemaIDs": [ "schemaIDs": [
"#/properties/probe" "#/properties/probe",
"#/properties/livenessProbe"
], ],
"uiSchema": { "uiSchema": {
"#/properties/probe": { "#/properties/probe": {
@@ -49,6 +49,25 @@
"ui:widget": "range" "ui:widget": "range"
} }
} }
},
"#/properties/livenessProbe": {
"settings": {
"initialDelaySeconds": {
"ui:widget": "range"
},
"periodSeconds": {
"ui:widget": "range"
},
"successThreshold": {
"ui:widget": "range"
},
"timeoutSeconds": {
"ui:widget": "range"
},
"failureThreshold": {
"ui:widget": "range"
}
}
} }
}, },
"metaData": { "metaData": {
@@ -74,6 +93,7 @@
}, },
{ {
"schemaIDs": [ "schemaIDs": [
"#/properties/secretEnabled",
"#/properties/sealedSecrets" "#/properties/sealedSecrets"
], ],
"uiSchema": { "uiSchema": {
@@ -84,7 +104,7 @@
} }
}, },
"metaData": { "metaData": {
"name": "Sealed Secrets", "name": "Secrets",
"icon": "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" "icon": "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
} }
}, },
@@ -92,7 +112,18 @@
"schemaIDs": [ "schemaIDs": [
"#/properties/volumes" "#/properties/volumes"
], ],
"uiSchema": {}, "uiSchema": {
"#/properties/volumes": {
"items": {
"emptyDir": {
"ui:widget": "hidden"
},
"configMapValue": {
"ui:widget": "textarea"
}
}
}
},
"metaData": { "metaData": {
"name": "Volumes", "name": "Volumes",
"icon": "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4" "icon": "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"
@@ -104,19 +135,41 @@
], ],
"uiSchema": {}, "uiSchema": {},
"metaData": { "metaData": {
"name": "Host Names", "name": "Ingress",
"icon": "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" "icon": "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
} }
}, },
{ {
"schemaIDs": [ "schemaIDs": [
"#/properties/podDisruptionBudgetEnabled", "#/properties/podDisruptionBudgetEnabled",
"#/properties/spreadAcrossNodes" "#/properties/spreadAcrossNodes",
"#/properties/podAnnotations",
"#/properties/podLabels"
], ],
"uiSchema": {}, "uiSchema": {},
"metaData": { "metaData": {
"name": "High Availability", "name": "Deployment fine-tuning",
"icon": "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" "icon": "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"
} }
},
{
"schemaIDs": [
"#/properties/name",
"#/properties/description",
"#/properties/ownerName",
"#/properties/ownerIm",
"#/properties/gitSha",
"#/properties/gitRepository",
"#/properties/documentation",
"#/properties/logs",
"#/properties/metrics",
"#/properties/traces",
"#/properties/issues"
],
"uiSchema": {},
"metaData": {
"name": "Service Catalog",
"icon": "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"
}
} }
] ]
+2 -2
View File
@@ -48,7 +48,7 @@ Selector labels
*/}} */}}
{{- define "helm-chart.selectorLabels" -}} {{- define "helm-chart.selectorLabels" -}}
app.kubernetes.io/name: {{ include "helm-chart.name" . }} app.kubernetes.io/name: {{ include "helm-chart.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ template "robustName" .Release.Name }}
{{- end }} {{- end }}
{{/* {{/*
@@ -68,5 +68,5 @@ Create robustName that can be used as Kubernetes resource name, and as subdomain
\W all but \w . \W all but \w .
*/}} */}}
{{- define "robustName" -}} {{- define "robustName" -}}
{{ regexReplaceAll "[^0-9A-Za-z_\\.]+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" | trimPrefix "-" }} {{ regexReplaceAll "\\W+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" }}
{{- end }} {{- end }}
+1 -13
View File
@@ -1,13 +1 @@
{{- if .Values.vars }} {{- include "common.configmap.tpl" . -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.vars }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
@@ -0,0 +1 @@
{{- include "common.customFileConfigmap.tpl" . -}}
+71 -51
View File
@@ -5,11 +5,26 @@ metadata:
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "helm-chart.labels" . | nindent 4 }} {{- include "helm-chart.labels" . | nindent 4 }}
annotations:
kubectl.kubernetes.io/default-container: {{ template "robustName" .Release.Name }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
{{- end }}
spec: spec:
replicas: {{ .Values.replicas }} replicas: {{ .Values.replicas }}
selector: selector:
matchLabels: matchLabels:
{{- include "helm-chart.selectorLabels" . | nindent 6 }} {{- include "helm-chart.selectorLabels" . | nindent 6 }}
{{- $singleReplica := eq (.Values.replicas | int64) 1 }}
{{- $strategyNotDefined := not .Values.strategy }}
{{- if and (and .Values.volumes $singleReplica) $strategyNotDefined}}
strategy:
type: Recreate
{{- end }}
{{- if .Values.strategy }}
strategy:
type: {{ .Values.strategy }}
{{- end }}
template: template:
metadata: metadata:
annotations: annotations:
@@ -17,7 +32,16 @@ spec:
{{- with .Values.podAnnotations }} {{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
{{- end }}
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
labels: labels:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "helm-chart.selectorLabels" . | nindent 8 }} {{- include "helm-chart.selectorLabels" . | nindent 8 }}
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
@@ -26,6 +50,32 @@ spec:
{{- end }} {{- end }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if .Values.serviceAccount }}
serviceAccountName: {{ .Values.serviceAccount }}
{{- end }}
initContainers:
{{- range .Values.initContainers }}
- name: {{ .name }}
image: "{{ .image }}:{{ .tag }}"
imagePullPolicy: {{ .imagePullPolicy | default "IfNotPresent" }}
{{- if .command }}
command:
- {{ $.Values.shell }}
- -c
- {{ .command | quote}}
{{- end }}
volumeMounts:
{{- range $.Values.volumes }}
{{- if (or (hasPrefix "shared-" .name) (hasPrefix "init-" .name))}}
- mountPath: {{ .path }}
name: {{ .name }}
{{- end }}
{{- end }}
{{- if .securityContext }}
securityContext:
{{- toYaml .securityContext | nindent 12 }}
{{- end}}
{{- end }}
containers: containers:
- name: {{ template "robustName" .Release.Name }} - name: {{ template "robustName" .Release.Name }}
securityContext: &securityContext securityContext: &securityContext
@@ -38,27 +88,13 @@ spec:
- -c - -c
- {{ .Values.command | quote }} - {{ .Values.command | quote }}
{{- end }} {{- end }}
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }} {{- include "common.envFromRef.tpl" . | nindent 10 }}
envFrom: &envFrom
{{- if .Values.vars }}
- configMapRef:
name: {{ template "robustName" .Release.Name }}
{{- end }}
{{- if .Values.secretEnabled }}
- secretRef:
name: {{ .Values.secretName | default (include "robustName" $.Release.Name) }}
{{- end }}
{{- if .Values.sealedSecrets }}
- secretRef:
name: {{ template "robustName" .Release.Name }}
{{- end }}
{{- end }}
ports: ports:
{{- if not .Values.ports }} {{- if not .Values.ports }}
- name: http - name: http
containerPort: {{ .Values.containerPort }} containerPort: {{ .Values.containerPort }}
protocol: TCP protocol: TCP
{{ else }} {{- else }}
{{- range .Values.ports }} {{- range .Values.ports }}
- name: {{ .name }} - name: {{ .name }}
containerPort: {{ .containerPort }} containerPort: {{ .containerPort }}
@@ -75,25 +111,26 @@ spec:
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} {{- if .Values.livenessProbe.enabled }}
volumeMounts: &volumeMounts livenessProbe:
{{- range .Values.volumes }} httpGet:
- name: {{ .name }} path: {{ .Values.livenessProbe.path }}
mountPath: {{ .path }} port: {{ .Values.containerPort }}
{{- end }} scheme: HTTP
{{- range .Values.sealedFileSecrets }} {{- with .Values.livenessProbe.settings }}
- name: {{ .name }} {{- toYaml . | nindent 12 }}
mountPath: {{ .path }}
readOnly: true
{{- end }}
{{- range .Values.fileSecrets }}
- name: {{ .name }}
mountPath: {{ .path }}
readOnly: true
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
{{- if not .Values.resources.ignore }}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- if .Values.resources.ignoreLimits }}
requests:
{{- toYaml .Values.resources.requests | nindent 14 }}
{{- else }}
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.sidecar }} {{- if .Values.sidecar }}
- name: {{ template "robustName" .Release.Name }}-sidecar - name: {{ template "robustName" .Release.Name }}-sidecar
securityContext: *securityContext securityContext: *securityContext
@@ -104,31 +141,14 @@ spec:
- -c - -c
- {{ .Values.sidecar.command | quote }} - {{ .Values.sidecar.command | quote }}
{{- end }} {{- end }}
{{- if or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets }} {{- if or (or (or (or (or (.Values.vars) (.Values.secretEnabled)) .Values.sealedSecrets) .Values.secretName) .Values.existingConfigMaps) .Values.existingSecrets }}
envFrom: *envFrom envFrom: *envFrom
{{- end }} {{- end }}
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} {{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }}
volumeMounts: *volumeMounts volumeMounts: *volumeMounts
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if or (or (.Values.volumes) (.Values.sealedFileSecrets)) .Values.fileSecrets }} {{- include "common.volumesRef.tpl" . | nindent 6 }}
volumes:
{{- range .Values.volumes }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- range .Values.sealedFileSecrets }}
- name: {{ .name }}
secret:
secretName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- range .Values.fileSecrets }}
- name: {{ .name }}
secret:
secretName: {{ printf "%s-%s" $.Release.Name .name }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@@ -0,0 +1,3 @@
{{- if .Values.extraDeploy }}
{{ .Values.extraDeploy }}
{{- end }}
@@ -0,0 +1 @@
{{- include "common.fileSecret.tpl" . -}}
+29 -14
View File
@@ -1,36 +1,51 @@
{{/* OneChart ingress snippet */}} {{/* OneChart ingress snippet */}}
{{- define "onechart.ingress" }} {{- define "onechart.ingress" }}
{{- $robustName := include "robustName" .root.Release.Name -}} {{- $robustName := include "robustName" .root.Release.Name -}}
{{- $resourceName := $robustName -}}
{{- if .longName }}
{{- $resourceName = printf "%s-%s" $robustName (include "robustName" .ingress.host) -}}
{{- end }}
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
{{- if .longName }} name: {{ $resourceName }}
name: {{ $robustName }}-{{ template "robustName" .ingress.host }}
{{- else }}
name: {{ $robustName }}
{{- end }}
namespace: {{ .root.Release.Namespace }} namespace: {{ .root.Release.Namespace }}
labels: labels:
{{- include "helm-chart.labels" .root | nindent 4 }} {{- include "helm-chart.labels" .root | nindent 4 }}
{{- with .ingress.annotations }} {{- if or (or .root.Values.gitSha .ingress.annotations) .root.Values.gitRepository }}
annotations: annotations:
{{- toYaml . | nindent 4 }} {{- if .ingress.annotations }}
{{- toYaml .ingress.annotations | nindent 4 }}
{{- end }}
{{- if .root.Values.gitSha }}
gimlet.io/git-sha: {{ .root.Values.gitSha }}
{{- end }}
{{- if .root.Values.gitRepository }}
gimlet.io/git-repository: {{ .root.Values.gitRepository }}
{{- end }}
{{- end }} {{- end }}
spec: spec:
{{- if .ingress.ingressClassName }}
ingressClassName: {{ .ingress.ingressClassName }}
{{- end }}
{{- if default false .ingress.tlsEnabled }} {{- if default false .ingress.tlsEnabled }}
tls: tls:
- hosts: - hosts:
- {{ template "robustName" .ingress.host | quote }} - {{ .ingress.host | quote }}
secretName: {{ printf "tls-%s" $robustName }} secretName: {{ printf "tls-%s" $resourceName }}
{{- end }} {{- end }}
rules: rules:
- host: {{ template "robustName" .ingress.host | quote }} - host: {{ .ingress.host | quote }}
http: http:
paths: paths:
- backend: - path: {{ .ingress.path | default "/" | quote }}
serviceName: {{ $robustName }} pathType: "Prefix"
servicePort: {{ .root.Values.containerPort }} backend:
service:
name: {{ $robustName }}
port:
number: {{ if .root.Values.svcPort }}{{ .root.Values.svcPort }}{{ else }}{{ .root.Values.containerPort }}{{ end }}
{{- end }} {{- end }}
{{- with .Values.ingress }} {{- with .Values.ingress }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{- if and (.Values.podDisruptionBudgetEnabled) (gt (.Values.replicas | int64) 1) }} {{- if and (.Values.podDisruptionBudgetEnabled) (gt (.Values.replicas | int64) 1) }}
apiVersion: policy/v1beta1 apiVersion: policy/v1
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ template "robustName" .Release.Name }} name: {{ template "robustName" .Release.Name }}
+1 -16
View File
@@ -1,16 +1 @@
{{- range .Values.volumes }} {{- include "common.pvc.tpl" . -}}
{{- $robustName := include "robustName" $.Release.Name }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s-%s" $robustName .name }}
namespace: {{ $.Release.Namespace }}
spec:
accessModes:
- {{ .accessMode | default "ReadWriteOnce" }}
storageClassName: {{ .storageClass | default "local-path" }}
resources:
requests:
storage: {{ .size | default "1Gi" }}
{{- end }}
@@ -0,0 +1 @@
{{- include "common.sealedFileSecret.tpl" . -}}
@@ -0,0 +1 @@
{{- include "common.sealedSecret.tpl" . -}}
+41 -1
View File
@@ -5,6 +5,46 @@ metadata:
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{- include "helm-chart.labels" . | nindent 4 }} {{- include "helm-chart.labels" . | nindent 4 }}
{{- if or (or (or (or (or .Values.gitRepository .Values.gitSha) .Values.serviceName) .Values.serviceDescription) .Values.ownerName) .Values.ownerIm }}
annotations:
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- $parts := split "/" .Values.gitRepository }}
v1alpha1.opensca.dev/vcs.owner: {{ $parts._0 }}
v1alpha1.opensca.dev/vcs.name: {{ $parts._1 }}
{{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
v1alpha1.opensca.dev/version.sha: {{ .Values.gitSha }}
{{- end }}
{{- if .Values.serviceName }}
v1alpha1.opensca.dev/name: {{ .Values.serviceName | quote }}
{{- end }}
{{- if .Values.serviceDescription }}
v1alpha1.opensca.dev/description: {{ .Values.serviceDescription | quote }}
{{- end }}
{{- if .Values.ownerName }}
v1alpha1.opensca.dev/owner.name: {{ .Values.ownerName | quote }}
{{- end }}
{{- if .Values.ownerIm }}
v1alpha1.opensca.dev/owner.im: {{ .Values.ownerIm | quote }}
{{- end }}
{{- if .Values.documentation }}
v1alpha1.opensca.dev/documentation: {{ .Values.documentation | quote }}
{{- end }}
{{- if .Values.logs }}
v1alpha1.opensca.dev/logs: {{ .Values.logs | quote }}
{{- end }}
{{- if .Values.metrics }}
v1alpha1.opensca.dev/metrics: {{ .Values.metrics | quote }}
{{- end }}
{{- if .Values.issues }}
v1alpha1.opensca.dev/issues: {{ .Values.issues | quote }}
{{- end }}
{{- if .Values.traces }}
v1alpha1.opensca.dev/traces: {{ .Values.traces | quote }}
{{- end }}
{{- end }}
spec: spec:
type: {{ if .Values.nodePortEnabled }}NodePort{{ else if .Values.loadbalancerEnabled }}LoadBalancer{{ else }}ClusterIP{{ end }} type: {{ if .Values.nodePortEnabled }}NodePort{{ else if .Values.loadbalancerEnabled }}LoadBalancer{{ else }}ClusterIP{{ end }}
{{- if .Values.stickySessions }} {{- if .Values.stickySessions }}
@@ -22,7 +62,7 @@ spec:
{{- if .Values.nodePort }} {{- if .Values.nodePort }}
nodePort: {{ .Values.nodePort }} nodePort: {{ .Values.nodePort }}
{{- end }} {{- end }}
{{ else }} {{- else }}
{{- range .Values.ports }} {{- range .Values.ports }}
- name: {{ .name }} - name: {{ .name }}
port: {{ if .svcPort }}{{ .svcPort }}{{ else }}{{ .containerPort }}{{ end }} port: {{ if .svcPort }}{{ .svcPort }}{{ else }}{{ .containerPort }}{{ end }}
@@ -0,0 +1,42 @@
{{ if .Values.monitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "helm-chart.labels" . | nindent 4 }}
{{- if or .Values.gitRepository .Values.gitSha }}
annotations:
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
{{- end }}
{{- end }}
spec:
endpoints:
- interval: 60s
params:
format:
- prometheus
path: {{ default "/metrics" .Values.monitor.path }}
{{ if .Values.monitor.portName }}
port: {{ .Values.monitor.portName }}
{{ else if not .Values.ports }}
port: http
{{ else }}
port: {{ index .Values.ports 0 "name" }}
{{ end }}
scheme: {{ default "http" .Values.monitor.scheme }}
{{ if .Values.monitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.monitor.scrapeTimeout }}
{{ end }}
namespaceSelector:
matchNames:
- "{{ .Release.Namespace }}"
selector:
matchLabels:
{{- include "helm-chart.selectorLabels" . | nindent 6 }}
{{ end }}
@@ -0,0 +1,22 @@
suite: test deployment
templates:
- custom-file-configmap.yaml
tests:
- it: Should create configmaps for custom string files
set:
volumes:
- fileName: myFile.conf
fileContent: |
blablabla
bla
path: /randomPath/myFile.conf
subPath: myFile.conf
asserts:
- hasDocuments:
count: 1
- equal:
path: data
value:
myFile.conf: |
blablabla
bla
@@ -16,5 +16,23 @@ tests:
name: release-name name: release-name
- it: Should not reference configmap if vars are not set - it: Should not reference configmap if vars are not set
asserts: asserts:
- isNull: - isNull:
path: spec.template.spec.containers[0].envFrom
- it: Should reference to existing configmaps
set:
existingConfigMaps:
- name: firstcm
optional: true
- name: secondcm
optional: true
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom path: spec.template.spec.containers[0].envFrom
content:
configMapRef:
name: firstcm
optional: true
configMapRef:
name: secondcm
optional: true
@@ -0,0 +1,44 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
- pvc.yaml
tests:
- it: Should mount volume
set:
existingFileSecrets:
- name: my-existing-secret
path: /config
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: my-existing-secret
mountPath: /config
readOnly: true
- it: Should mount volume with optional subPath
set:
existingFileSecrets:
- name: my-existing-secret
path: /config/config.yaml
subPath: config.yml
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: my-existing-secret
mountPath: /config/config.yaml
subPath: config.yml
readOnly: true
- it: Should reference volume
set:
existingFileSecrets:
- name: my-existing-secret
path: /config
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: my-existing-secret
secret:
secretName: my-existing-secret
@@ -18,6 +18,22 @@ tests:
- name: google-account-key - name: google-account-key
mountPath: /google-account-key mountPath: /google-account-key
readOnly: true readOnly: true
- it: Should mount volume with optional subPath
set:
fileSecrets:
- name: google-account-key
path: /config/google-account-key
subPath: google-account-key
secrets:
key.json: supersecret
asserts:
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: google-account-key
mountPath: /config/google-account-key
subPath: google-account-key
readOnly: true
- it: Should reference volume - it: Should reference volume
set: set:
fileSecrets: fileSecrets:
@@ -0,0 +1,38 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set name, image and tag
set:
initContainers:
- name: pod1
image: nginx
tag: 1.2.2
asserts:
- equal:
path: spec.template.spec.initContainers[0].name
value: pod1
- equal:
path: spec.template.spec.initContainers[0].image
value: "nginx:1.2.2"
- it: Should set command
set:
initContainers:
- command: "while true; do date; sleep 2; done &&
ls /data &&
printf something"
asserts:
- equal:
path: spec.template.spec.initContainers[0].command
value: ['/bin/sh', '-c', 'while true; do date; sleep 2; done && ls /data && printf something']
- it: Should set security context
set:
initContainers:
- securityContext:
runAsNonRoot: true
asserts:
- equal:
path: spec.template.spec.initContainers[0].securityContext.runAsNonRoot
value: true
@@ -0,0 +1,45 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set a liveness probe
set:
livenessProbe:
enabled: true
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
path: "/"
port: 80
scheme: HTTP
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
failureThreshold: 3
- it: Should not set a livenessProbe
asserts:
- isNull:
path: spec.template.spec.containers[0].livenessProbe
- it: Should tune liveness probe
set:
livenessProbe:
enabled: true
settings:
periodSeconds: 30
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
path: "/"
port: 80
scheme: HTTP
initialDelaySeconds: 0
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 3
failureThreshold: 3
@@ -0,0 +1,17 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set custom labels
set:
podLabels:
label1: val1
label2: val2
asserts:
- equal:
path: spec.template.metadata.labels.label1
value: val1
- equal:
path: spec.template.metadata.labels.label2
value: val2
@@ -0,0 +1,40 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should render resoucres if not ignored by default
set:
{}
asserts:
- isNotNull:
path: spec.template.spec.containers[0].resources
- it: Should ignore resources if ignore flag is set
set:
resources:
ignore: true
asserts:
- isNull:
path: spec.template.spec.containers[0].resources
- it: Should ignore resources limits when ignoreLimits flag is set
set:
resources:
ignoreLimits: true
asserts:
- isNull:
path: spec.template.spec.containers[0].resources.limits
- isNotNull:
path: spec.template.spec.containers[0].resources.requests
- it: Should create requests when ignoreLimits flag is set
set:
resources:
ignoreLimits: true
requests:
cpu: "1000m"
memory: "200Mi"
asserts:
- isNotNull:
path: spec.template.spec.containers[0].resources.requests
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 1000m
@@ -1,6 +1,6 @@
suite: test deployment suite: test deployment
templates: templates:
- sealed-file-secret.yaml - sealedFileSecret.yaml
tests: tests:
- it: Should generate a sealed secret with the file - it: Should generate a sealed secret with the file
set: &values set: &values
@@ -12,15 +12,8 @@ tests:
content: content:
secretRef: secretRef:
name: release-name name: release-name
- it: Should not reference secret if secret is disabled - it: Should reference secret by name
set: set:
secretEnabled: false
asserts:
- isNull:
path: spec.template.spec.containers[0].envFrom
- it: Should not reference secret if secret is disabled
set:
secretEnabled: true
secretName: my-custom-secret secretName: my-custom-secret
asserts: asserts:
- contains: - contains:
@@ -38,3 +31,20 @@ tests:
content: content:
secretRef: secretRef:
name: release-name name: release-name
- it: Should reference to existing secrets
set:
existingSecrets:
- name: firstsecret
optional: true
- name: secondsecret
optional: true
asserts:
- contains:
path: spec.template.spec.containers[0].envFrom
content:
secretRef:
name: firstsecret
optional: true
secretRef:
name: secondsecret
optional: true
@@ -31,3 +31,191 @@ tests:
- name: data - name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: RELEASE-NAME-data claimName: RELEASE-NAME-data
- it: Should recreate to avoid stuck deployments
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
size: 10Gi
storageClass: default
asserts:
- equal:
path: spec.strategy.type
value: Recreate
- it: Should strategy take precedence
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
size: 10Gi
storageClass: default
strategy: RollingUpdate
asserts:
- equal:
path: spec.strategy.type
value: RollingUpdate
- it: Should strategy be set
set:
strategy: Dummy
asserts:
- equal:
path: spec.strategy.type
value: Dummy
- it: Should use the existing claim
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
existingClaim: my-static-claim
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: data
persistentVolumeClaim:
claimName: my-static-claim
- it: Should use emptyDir
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
emptyDir: true
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: data
emptyDir: {}
- it: Should use hostPath
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
hostPath:
path: /somewhere/over/the/rainbow
type: DirectoryOrCreate
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: data
hostPath:
path: /somewhere/over/the/rainbow
type: DirectoryOrCreate
- it: Should use hostPath without type
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
hostPath:
path: /somewhere/over/the/rainbow
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: data
hostPath:
path: /somewhere/over/the/rainbow
- it: Should use emptyDir
set:
volumes:
- name: myScratchDisk
path: /randomPath
emptyDir: true
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: myScratchDisk
emptyDir: {}
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: myScratchDisk
mountPath: /randomPath
- it: Should use a configMap
set:
volumes:
- existingConfigMap: my-configmap
name: volume-name
path: /randomPath/app.conf
subPath: app.conf
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: volume-name
configMap:
name: my-configmap
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: volume-name
mountPath: /randomPath/app.conf
subPath: app.conf
- it: Should use a configmap with custom value
set:
volumes:
- name: volume-name
fileName: myfile.conf
fileContent: |
blablabla
bla
path: /randomPath/myfile.conf
subPath: myfile.conf
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: volume-name
configMap:
name: release-name-volume-name
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: volume-name
mountPath: /randomPath/myfile.conf
subPath: myfile.conf
- it: Should mount a volume only for the init container
set:
initContainers:
- name : pod
volumes:
- name: init-volume
path: /data
emptyDir: true
asserts:
- equal:
path: spec.template.spec.volumes
value:
- name: init-volume
emptyDir: {}
- equal:
path: spec.template.spec.initContainers[0].volumeMounts
value:
- name: init-volume
mountPath: /data
- notEqual:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: init-volume
emptyDir: {}
- it: Should mount a shared volume between the main container and the init container
set:
initContainers:
- name: pod
volumes:
- name: shared-volume
path: /data
emptyDir: true
asserts:
- equal:
path: spec.template.spec.initContainers[0].volumeMounts
value:
- name: shared-volume
mountPath: /data
- equal:
path: spec.template.spec.containers[0].volumeMounts
value:
- name: shared-volume
mountPath: /data
@@ -0,0 +1,57 @@
suite: test service
templates:
- extraDeploy.yaml
tests:
- it: Should include additional yaml pieces
set:
extraDeploy: |
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-network-policy
namespace: default
spec:
podSelector:
matchLabels:
role: db
policyTypes:
- Ingress
- Egress
ingress:
- from:
- ipBlock:
cidr: 172.17.0.0/16
except:
- 172.17.1.0/24
- namespaceSelector:
matchLabels:
project: myproject
- podSelector:
matchLabels:
role: frontend
ports:
- protocol: TCP
port: 6379
egress:
- to:
- ipBlock:
cidr: 10.0.0.0/24
ports:
- protocol: TCP
port: 5978
asserts:
- equal:
path: kind
value: NetworkPolicy
- it: Should include multiple yaml pieces
set:
extraDeploy: |
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
asserts:
- hasDocuments:
count: 2
+46 -11
View File
@@ -20,10 +20,14 @@ tests:
- host: chart-example.local - host: chart-example.local
http: http:
paths: paths:
- backend: - path: "/"
serviceName: release-name pathType: "Prefix"
servicePort: 80 backend:
- it: Should conform to DNS names service:
name: release-name
port:
number: 80
- it: Should pass ingress host name as is, user must sanitize it
set: set:
ingress: ingress:
host: feature/my_branch.local host: feature/my_branch.local
@@ -33,28 +37,41 @@ tests:
path: spec.tls path: spec.tls
value: value:
- hosts: - hosts:
- feature-my-branch.local - feature/my_branch.local
secretName: tls-release-name secretName: tls-release-name
- equal: - equal:
path: spec.rules path: spec.rules
value: value:
- host: feature-my-branch.local - host: feature/my_branch.local
http: http:
paths: paths:
- backend: - path: "/"
serviceName: release-name pathType: "Prefix"
servicePort: 80 backend:
service:
name: release-name
port:
number: 80
- it: Should set Ingress annotation - it: Should set Ingress annotation
set: set:
ingress: ingress:
host: chart-example.local host: chart-example.local
annotations: annotations:
kubernetes.io/ingress.class: nginx just/a-random: annotation
asserts: asserts:
- equal: - equal:
path: metadata.annotations path: metadata.annotations
value: value:
kubernetes.io/ingress.class: nginx just/a-random: annotation
- it: Should set ingress class
set:
ingress:
host: chart-example.local
ingressClassName: nginx
asserts:
- equal:
path: spec.ingressClassName
value: nginx
- it: Should generate multiple ingresses - it: Should generate multiple ingresses
set: set:
ingresses: ingresses:
@@ -83,3 +100,21 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 3
- it: Should have unique TLS secret names
set:
ingresses:
- host: chart-example.local
tlsEnabled: true
annotations:
kubernetes.io/ingress.class: nginx
- host: another.local
tlsEnabled: true
annotations:
kubernetes.io/ingress.class: nginx
asserts:
- equal:
path: spec.tls
value:
- hosts:
- chart-example.local
secretName: tls-release-name-chart-example-local
@@ -0,0 +1,21 @@
suite: test ingress
templates:
- ingress.yaml
tests:
- it: Should default
set:
ingress:
host: chart-example.local
asserts:
- equal:
path: spec.rules[0].http.paths[0].path
value: "/"
- it: Should use path
set:
ingress:
host: chart-example.local
path: "/mypath"
asserts:
- equal:
path: spec.rules[0].http.paths[0].path
value: "/mypath"
@@ -0,0 +1,23 @@
suite: test deployment
templates:
- ingress.yaml
tests:
- it: Should use container port
set:
ingress:
host: chart-example.local
containerPort: 1234
asserts:
- equal:
path: spec.rules[0].http.paths[0].backend.service.port.number
value: 1234
- it: Should use service port
set:
ingress:
host: chart-example.local
svcPort: 1234
containerPort: 5678
asserts:
- equal:
path: spec.rules[0].http.paths[0].backend.service.port.number
value: 1234
@@ -0,0 +1,18 @@
suite: test service
templates:
- ingress.yaml
tests:
- it: Should set Gimlet taxonomy on Ingress
set:
gitRepository: github.com/laszlocph/demo-app
gitSha: xyz
ingress:
host: chart-example.local
tlsEnabled: true
asserts:
- equal:
path: metadata.annotations
value:
gimlet.io/git-repository: github.com/laszlocph/demo-app
gimlet.io/git-sha: xyz
+33
View File
@@ -13,3 +13,36 @@ tests:
- equal: - equal:
path: spec.storageClassName path: spec.storageClassName
value: default value: default
- it: Should assign annotations to the PVC
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
size: 10Gi
storageClass: default
pvcAnnotations:
rancher.io/local-path/volume-type: local
asserts:
- equal:
path: metadata.annotations
value:
rancher.io/local-path/volume-type: local
- it: Should not generate a claim when using existing claim
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
existingClaim: my-static-claim
asserts:
- hasDocuments:
count: 0
- it: Should not generate a claim when using host path
set:
volumes:
- name: data
path: /var/lib/1clickinfra/data
hostPath:
path: /data/test
asserts:
- hasDocuments:
count: 0
@@ -1,6 +1,6 @@
suite: test deployment suite: test deployment
templates: templates:
- sealed-secret.yaml - sealedSecret.yaml
tests: tests:
- it: Should put sealed secrets in SealedSecret - it: Should put sealed secrets in SealedSecret
set: set:
@@ -0,0 +1,35 @@
suite: test service
templates:
- service.yaml
tests:
- it: Should set Gimlet taxonomy
set:
gitRepository: laszlocph/demo-app
gitSha: xyz
serviceName: cart-backend
serviceDescription: "Backend to manage shopping cart state, written in Go"
ownerName: "backend-team"
ownerIm: "#backend-team"
documentation: https://confluence.mycompany.com/cart-backend
logs: https://grafana.mycompany.com/logs
metrics: https://grafana.mycompany.com/cart-dashboard
issues: https://jira.mycompany.com/cart-backend
traces: https://jaeger.mycompany.com/cart-dashboard
asserts:
- equal:
path: metadata.annotations
value:
gimlet.io/git-repository: laszlocph/demo-app
gimlet.io/git-sha: xyz
v1alpha1.opensca.dev/vcs.owner: laszlocph
v1alpha1.opensca.dev/vcs.name: demo-app
v1alpha1.opensca.dev/version.sha: xyz
v1alpha1.opensca.dev/name: cart-backend
v1alpha1.opensca.dev/description: "Backend to manage shopping cart state, written in Go"
v1alpha1.opensca.dev/owner.name: "backend-team"
v1alpha1.opensca.dev/owner.im: "#backend-team"
v1alpha1.opensca.dev/documentation: https://confluence.mycompany.com/cart-backend
v1alpha1.opensca.dev/logs: https://grafana.mycompany.com/logs
v1alpha1.opensca.dev/metrics: https://grafana.mycompany.com/cart-dashboard
v1alpha1.opensca.dev/issues: https://jira.mycompany.com/cart-backend
v1alpha1.opensca.dev/traces: https://jaeger.mycompany.com/cart-dashboard
+535 -35
View File
@@ -15,6 +15,7 @@
"nameOverride": "", "nameOverride": "",
"fullnameOverride": "", "fullnameOverride": "",
"podAnnotations": {}, "podAnnotations": {},
"podLabels": {},
"podSecurityContext": { "podSecurityContext": {
"fsGroup": 999 "fsGroup": 999
}, },
@@ -84,6 +85,53 @@
} }
} }
}, },
"initContainers": {
"$id": "#/properties/initcontainers",
"type": "array",
"title": "Init Containers",
"default": [],
"additionalItems": true,
"items": {
"$id": "#/properties/initcontainers/items",
"type": "object",
"anyOf": [
{
"id": "#/properties/volumes/oneOf/0",
"title": "InitContainer",
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"description": "The name of the init container"
},
"image": {
"type": "string",
"title": "Image"
},
"tag": {
"type": "string",
"title": "Tag"
},
"imagePullPolicy": {
"type": "string",
"title": "Command",
"default": "IfNotPresent"
},
"command": {
"type": "string",
"title": "Command"
}
},
"required": [
"name",
"image",
"tag"
]
}
]
}
},
"replicas": { "replicas": {
"$id": "#/properties/replicas", "$id": "#/properties/replicas",
"type": "integer", "type": "integer",
@@ -133,8 +181,8 @@
"podAnnotations": { "podAnnotations": {
"$id": "#/properties/podAnnotations", "$id": "#/properties/podAnnotations",
"type": "object", "type": "object",
"title": "The podAnnotations schema", "title": "Pod annotations",
"description": "An explanation about the purpose of this instance.", "description": "Annotations to place on pods",
"default": {}, "default": {},
"examples": [ "examples": [
{} {}
@@ -142,6 +190,95 @@
"required": [], "required": [],
"additionalProperties": true "additionalProperties": true
}, },
"podLabels": {
"$id": "#/properties/podLabels",
"type": "object",
"title": "Pod labels",
"description": "Labels to place on pods",
"default": {},
"examples": [
{}
],
"required": [],
"additionalProperties": true
},
"name": {
"$id": "#/properties/name",
"type": "string",
"title": "Service Name",
"description": "The service name for unique identification",
"default": ""
},
"description": {
"$id": "#/properties/description",
"type": "string",
"title": "Service Description",
"description": "Human readable text description of the service",
"default": ""
},
"ownerName": {
"$id": "#/properties/ownerName",
"type": "string",
"title": "Owner",
"description": "The person or team who is responsible for this service",
"default": ""
},
"ownerIm": {
"$id": "#/properties/ownerIm",
"type": "string",
"title": "Owner IM",
"description": "Instant messaging channel, or direct message handle of the owner. prefix with # for channels, prefix with @ for direct messages.",
"default": ""
},
"documentation": {
"$id": "#/properties/documentation",
"type": "string",
"title": "Link to Documentation",
"description": "Link to documentation. The link's preferred usage is in a href html tag.",
"default": ""
},
"logs": {
"$id": "#/properties/logs",
"type": "string",
"title": "Link to Logs",
"description": "Link to log aggregation platform. The link's preferred usage is in a href html tag.",
"default": ""
},
"metrics": {
"$id": "#/properties/metrics",
"type": "string",
"title": "Link to Metrics",
"description": "Link to metrics dashboard. The link's preferred usage is in a href html tag.",
"default": ""
},
"issues": {
"$id": "#/properties/issues",
"type": "string",
"title": "Link to Issues",
"description": "Link to issue tracker. The link's preferred usage is in a href html tag.",
"default": ""
},
"traces": {
"$id": "#/properties/traces",
"type": "string",
"title": "Link to Traces",
"description": "Link to application traces. The link's preferred usage is in a href html tag.",
"default": ""
},
"gitSha": {
"$id": "#/properties/gitSha",
"type": "string",
"title": "Commit Hash",
"description": "The git hash that you are deploying",
"default": ""
},
"gitRepository": {
"$id": "#/properties/gitRepository",
"type": "string",
"title": "GitHub Repository",
"description": "The git repository that you are deploying",
"default": ""
},
"podSecurityContext": { "podSecurityContext": {
"$id": "#/properties/podSecurityContext", "$id": "#/properties/podSecurityContext",
"type": "object", "type": "object",
@@ -212,6 +349,26 @@
], ],
"required": [], "required": [],
"properties": { "properties": {
"ignore": {
"$id": "#/properties/resources/properties/ignore",
"type": "boolean",
"title": "Ignore",
"description": "If set to true, resource configuration will be ignored",
"default": false,
"examples": [
true
]
},
"ignoreLimits": {
"$id": "#/properties/resources/properties/ignoreLimits",
"type": "boolean",
"title": "Ignore limits",
"description": "If set to true, limits in resource configuration will be ignored",
"default": false,
"examples": [
true
]
},
"requests": { "requests": {
"$id": "#/properties/resources/properties/requests", "$id": "#/properties/resources/properties/requests",
"type": "object", "type": "object",
@@ -334,7 +491,7 @@
"$id": "#/properties/probe", "$id": "#/properties/probe",
"type": "object", "type": "object",
"title": "Healthcheck", "title": "Healthcheck",
"description": "The Kubernetes Readiness probe that determines whether your app is healthy and if should receive traffic", "description": "The Kubernetes Readiness probe determines whether your app is healthy and if it should receive traffic",
"default": {}, "default": {},
"examples": [ "examples": [
{ {
@@ -385,10 +542,10 @@
"$id": "#/properties/probe/properties/settings/properties/initialDelaySeconds", "$id": "#/properties/probe/properties/settings/properties/initialDelaySeconds",
"type": "integer", "type": "integer",
"title": "Initial Delay Seconds", "title": "Initial Delay Seconds",
"description": "Number of seconds after the container has started before the probes is initiated", "description": "Number of seconds after the container has started before the probe is initiated",
"default": 0, "default": 0,
"minimum": 0, "minimum": 0,
"maximum": 60 "maximum": 180
}, },
"periodSeconds": { "periodSeconds": {
"$id": "#/properties/probe/properties/settings/properties/periodSeconds", "$id": "#/properties/probe/properties/settings/properties/periodSeconds",
@@ -421,7 +578,107 @@
"$id": "#/properties/probe/properties/settings/properties/failureThreshold", "$id": "#/properties/probe/properties/settings/properties/failureThreshold",
"type": "integer", "type": "integer",
"title": "Failure Threshold", "title": "Failure Threshold",
"description": "When a probe fails, Kubernetes will tries this many times before giving up. Giving up the pod will be marked Unready and won't get any traffic", "description": "When a probe fails, Kubernetes will try this many times before giving up. Giving up the pod will be marked Unready and won't get any traffic",
"default": 3,
"minimum": 1,
"maximum": 15
}
}
}
}
},
"livenessProbe": {
"$id": "#/properties/livenessProbe",
"type": "object",
"title": "Liveness check",
"description": "The Kubernetes Liveness probe determines whether your app is healthy and if it should be restarted",
"default": {},
"examples": [
{
"enabled": false,
"path": "/"
}
],
"required": [
"enabled",
"path"
],
"properties": {
"enabled": {
"$id": "#/properties/livenessProbe/properties/enabled",
"type": "boolean",
"title": "",
"description": "",
"default": false,
"examples": [
false
]
},
"path": {
"$id": "#/properties/livenessProbe/properties/path",
"type": "string",
"title": "Path",
"description": "Fill in the description",
"default": "/",
"examples": [
"/"
]
},
"settings": {
"$id": "#/properties/livenessProbe/properties/settings",
"type": "object",
"title": "Probe thresholds",
"description": "Tune the probe behavior",
"examples": [
{
"failureThreshold": 3,
"periodSeconds": 10,
"successThreshold": 1,
"timeoutSeconds": 10
}
],
"properties": {
"initialDelaySeconds": {
"$id": "#/properties/livenessProbe/properties/settings/properties/initialDelaySeconds",
"type": "integer",
"title": "Initial Delay Seconds",
"description": "Number of seconds after the container has started before the probe is initiated",
"default": 0,
"minimum": 0,
"maximum": 180
},
"periodSeconds": {
"$id": "#/properties/livenessProbe/properties/settings/properties/periodSeconds",
"type": "integer",
"title": "Period",
"description": "How often (in seconds) to perform the probe",
"default": 10,
"minimum": 1,
"maximum": 60
},
"successThreshold": {
"$id": "#/properties/livenessProbe/properties/settings/properties/successThreshold",
"type": "integer",
"title": "Success Threshold",
"description": "Minimum consecutive successes for the probe to be considered successful after having failed",
"default": 1,
"minimum": 1,
"maximum": 15
},
"timeoutSeconds": {
"$id": "#/properties/livenessProbe/properties/settings/properties/timeoutSeconds",
"type": "integer",
"title": "Timeout",
"description": "Number of seconds after which the probe times out",
"default": 3,
"minimum": 1,
"maximum": 30
},
"failureThreshold": {
"$id": "#/properties/livenessProbe/properties/settings/properties/failureThreshold",
"type": "integer",
"title": "Failure Threshold",
"description": "When a probe fails, Kubernetes will try this many times before giving up. Giving up the pod will be marked Unready and won't get any traffic",
"default": 3, "default": 3,
"minimum": 1, "minimum": 1,
"maximum": 15 "maximum": 15
@@ -484,10 +741,17 @@
"properties": {}, "properties": {},
"additionalProperties": true "additionalProperties": true
}, },
"secretEnabled": {
"$id": "#/properties/secretEnabled",
"type": "boolean",
"title": "Existing secret",
"description": "If enabled, a secret will be referenced from the deployment whose name matches the deployment name",
"default": false
},
"sealedSecrets": { "sealedSecrets": {
"$id": "#/properties/sealedSecrets", "$id": "#/properties/sealedSecrets",
"type": "object", "type": "object",
"title": "Sealed Secrets", "title": "Sealed secrets",
"description": "", "description": "",
"default": {}, "default": {},
"examples": [ "examples": [
@@ -527,6 +791,16 @@
"my-release.mycompany.com" "my-release.mycompany.com"
] ]
}, },
"path": {
"$id": "#/properties/ingress/properties/ingressPath",
"type": "string",
"title": "Path",
"description": "The API path where your service is accessible",
"default": "/",
"examples": [
"/api/myservice"
]
},
"tlsEnabled": { "tlsEnabled": {
"$id": "#/properties/ingress/properties/tlsEnabled", "$id": "#/properties/ingress/properties/tlsEnabled",
"type": "boolean", "type": "boolean",
@@ -541,7 +815,7 @@
"$id": "#/properties/ingress/properties/annotations", "$id": "#/properties/ingress/properties/annotations",
"type": "object", "type": "object",
"title": "Annotations", "title": "Annotations",
"description": "", "description": "Annotations are used to control ingress behavior. See the full list for the Ingress Nginx project at https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/. Use the `cert-manager.io/cluster-issuer:\"letsencrypt\"` one to request TLS certificates, `kubernetes.io/ingress.class: \"nginx\"` to select an ingress controller.",
"default": {}, "default": {},
"examples": [ "examples": [
{ {
@@ -552,6 +826,49 @@
} }
} }
}, },
"existingFileSecrets": {
"$id": "#/properties/existingFileSecrets",
"type": "array",
"title": "Existing file secrets",
"description": "Allows to mount existing secrets into a container",
"default": [],
"additionalItems": true,
"items": {
"$id": "#/properties/existingFileSecrets/items",
"type": "object",
"anyOf": [
{
"id": "#/properties/existingFileSecrets/oneOf/0",
"title": "existingFileSecrets",
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"description": "The name of the existing secret to mount",
"default": "data"
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
},
"subPath": {
"type": "string",
"title": "SubPath",
"description": "The optinal mount subpath inside the container, to only mount a specific file but not a complete directory.",
"default": "config.yaml"
}
},
"required": [
"name",
"path"
]
}
]
}
},
"volumes": { "volumes": {
"$id": "#/properties/volumes", "$id": "#/properties/volumes",
"type": "array", "type": "array",
@@ -561,38 +878,221 @@
"items": { "items": {
"$id": "#/properties/volumes/items", "$id": "#/properties/volumes/items",
"type": "object", "type": "object",
"properties": { "anyOf": [
"name": { {
"$id": "#/properties/volumes/items/anyOf/0/properties/name", "id": "#/properties/volumes/oneOf/0",
"type": "string", "title": "Volume",
"title": "Name", "type": "object",
"description": "The name of the volume. Used only to recognize the volumes purpose in the config later on", "properties": {
"default": "data" "name": {
"type": "string",
"title": "Name",
"description": "The name of the volume. Used only to recognize the volumes purpose in the config later on",
"default": "data"
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
},
"size": {
"type": "string",
"title": "Size",
"description": "eg: 10Gi"
},
"storageClass": {
"type": "string",
"title": "Storage Class",
"description": "The slug indicating the disk type in your cloud provider. `standard` on Google Cloud, `default` on Azure; `do-block-storage` on Digital Ocean"
},
"pvcAnnotations": {
"type": "object",
"title": "Annotations",
"description": "Annotations are used to control the persistance claim behavior.",
"default": {},
"examples": [
{
"rancher.io/local-path/volume-type": "local"
}
],
"additionalProperties": true
}
},
"required": [
"name",
"path",
"size"
]
}, },
"path": { {
"$id": "#/properties/volumes/items/anyOf/0/properties/path", "id": "#/properties/volumes/oneOf/1",
"type": "string", "title": "Use an existing volume claim",
"title": "Path", "type": "object",
"description": "The mount path inside the container", "properties": {
"default": "/data" "name": {
"type": "string",
"title": "Name",
"description": "The name of the volume. Used only to recognize the volumes purpose in the config later on",
"default": "data"
},
"existingClaim": {
"type": "string",
"title": "Existing Claim",
"description": "Use an existing PersistentVolumeClaim"
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
}
},
"required": [
"name",
"path",
"existingClaim"
]
}, },
"size": { {
"$id": "#/properties/volumes/items/anyOf/0/properties/size", "id": "#/properties/volumes/oneOf/2",
"type": "string", "title": "Use a path from the host",
"title": "Size", "type": "object",
"description": "", "properties": {
"default": "10Gi" "name": {
"type": "string",
"title": "Name",
"description": "The name of the volume. Used only to recognize the volumes purpose in the config later on",
"default": "data"
},
"hostPath": {
"type": "object",
"title": "Path on the host",
"description": "Use a physical path on the host machine",
"properties": {
"path": {
"type": "string",
"title": "Path on Host",
"description": "Use a physical path on the host machine"
},
"type": {
"type": "string",
"title": "Path Type",
"enum": [
"DirectoryOrCreate",
"Directory",
"FileOrCreate",
"File",
"Socket",
"CharDevice",
"BlockDevice"
]
}
},
"required": [
"path"
]
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
}
},
"required": [
"name",
"path",
"hostPath"
]
}, },
"storageClass": { {
"$id": "#/properties/volumes/items/anyOf/0/properties/storageClass", "id": "#/properties/volumes/oneOf/3",
"type": "string", "title": "Use an ephemeral volume",
"title": "Storage Class", "type": "object",
"description": "The slug indicating the disk type in your cloud provider. `standard` on Google Cloud, `default` on Azure; `do-block-storage` on Digital Ocean", "properties": {
"default": "" "name": {
"type": "string",
"title": "Name",
"default": "ephemeral-volume"
},
"emptyDir": {
"type": "boolean",
"title": "ephemeral volume (emptyDir)",
"description": "Enable to use a non-persistent disk",
"default": true
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
}
},
"required": [
"name",
"emptyDir",
"path"
]
},
{
"id": "#/properties/volumes/oneOf/4",
"title": "Mount an existing configMap as a file",
"type": "object",
"properties": {
"existingConfigMap": {
"type": "string",
"title": "Name",
"description": "The name of the configMap to mount",
"default": "data"
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data/dummy.conf"
},
"subPath": {
"type": "string",
"title": "subPath",
"description": "Mount single file",
"default": "dummy.conf"
}
},
"required": [
"existingConfigMap",
"path"
]
},
{
"id": "#/properties/volumes/oneOf/5",
"title": "Custom string to mount as a file",
"type": "object",
"properties": {
"fileName": {
"type": "string",
"title": "File name"
},
"fileContent": {
"type": "string",
"title": "File content"
},
"path": {
"type": "string",
"title": "Path",
"description": "The mount path inside the container",
"default": "/data"
}
},
"required": [
"fileName",
"fileContent",
"path"
]
} }
} ]
} }
} }
}, },
"additionalProperties": true "additionalProperties": true
} }
+27 -1
View File
@@ -3,6 +3,16 @@ image:
tag: "latest" tag: "latest"
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
# ingress:
# host: chart-example.local
# ingressClassName: nginx
# tlsEnabled: true
# annotations:
# cert-manager.io/cluster-issuer: letsencrypt-staging
# vars:
# MY_VAR: "value"
replicas: 1 replicas: 1
nameOverride: "" nameOverride: ""
@@ -10,6 +20,8 @@ fullnameOverride: ""
podAnnotations: {} podAnnotations: {}
podLabels: {}
podSecurityContext: podSecurityContext:
fsGroup: 999 fsGroup: 999
@@ -29,7 +41,6 @@ nodeSelector: {}
tolerations: [] tolerations: []
probe: probe:
enabled: false enabled: false
path: "/" path: "/"
@@ -40,6 +51,17 @@ probe:
timeoutSeconds: 3 timeoutSeconds: 3
failureThreshold: 3 failureThreshold: 3
# Before you use a liveness probe: https://srcco.de/posts/kubernetes-liveness-probes-are-dangerous.html
livenessProbe:
enabled: false
path: "/"
settings:
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
failureThreshold: 3
secretEnabled: false secretEnabled: false
shell: "/bin/sh" shell: "/bin/sh"
@@ -48,3 +70,7 @@ podDisruptionBudgetEnabled: true
spreadAcrossNodes: false spreadAcrossNodes: false
nodePortEnabled: false nodePortEnabled: false
# Set true to enable service monitor.
monitor:
enabled: false
+23
View File
@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
+18
View File
@@ -0,0 +1,18 @@
apiVersion: v2
name: static-site
description: Chart to build and deploy static sites
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.62.0
+30
View File
@@ -0,0 +1,30 @@
[
{
"schemaIDs": [
"#/properties/gitCloneUrl",
"#/properties/buildImage",
"#/properties/buildScript",
"#/properties/builtAssets"
],
"uiSchema": {
"#/properties/buildScript": {
"ui:widget": "textarea",
"ui:rows": 10
}
},
"metaData": {
"name": "Build",
"icon": "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"
}
},
{
"schemaIDs": [
"#/properties/ingress"
],
"uiSchema": {},
"metaData": {
"name": "Ingress",
"icon": "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"
}
}
]
+1
View File
@@ -0,0 +1 @@
+71
View File
@@ -0,0 +1,71 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "staticSite.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "staticSite.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "staticSite.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "staticSite.labels" -}}
helm.sh/chart: {{ include "staticSite.chart" . }}
{{ include "staticSite.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "staticSite.selectorLabels" -}}
app.kubernetes.io/name: {{ include "staticSite.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "staticSite.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "staticSite.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Create robustName that can be used as Kubernetes resource name, and as subdomain as well
\w Latin letters, digits, underscore '_' .
\W all but \w .
*/}}
{{- define "robustName" -}}
{{ regexReplaceAll "\\W+" . "-" | replace "_" "-" | lower | trunc 63 | trimSuffix "-" }}
{{- end }}
@@ -0,0 +1,72 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "staticSite.labels" . | nindent 4 }}
{{- if or .Values.gitRepository .Values.gitSha }}
annotations:
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
{{- end }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "staticSite.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "staticSite.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.serviceAccount }}
serviceAccountName: {{ .Values.serviceAccount }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: static-files
emptyDir: {}
initContainers:
- name: init-con
image: {{ .Values.buildImage }}
{{- if .Values.buildScript }}
command:
- sh
- -c
- |
git clone {{ .Values.gitCloneUrl}} &&
cd {{ regexFind "([^\\/]+$)" .Values.gitCloneUrl | replace ".git" "" }} &&
{{ .Values.buildScript | nindent 12}}
mkdir -p /usr/share/nginx/html &&
cp -r ./{{ .Values.builtAssets }}. /usr/share/nginx/html
{{- end }}
volumeMounts:
- name: static-files
mountPath: /usr/share/nginx/html
containers:
- name: {{ template "robustName" .Release.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: static-files
mountPath: /usr/share/nginx/html
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
+52
View File
@@ -0,0 +1,52 @@
{{/* OneChart ingress snippet */}}
{{- define "onechart.ingress" }}
{{- $robustName := include "robustName" .root.Release.Name -}}
{{- $resourceName := $robustName -}}
{{- if .longName }}
{{- $resourceName = printf "%s-%s" $robustName (include "robustName" .ingress.host) -}}
{{- end }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $resourceName }}
namespace: {{ .root.Release.Namespace }}
labels:
{{- include "staticSite.labels" .root | nindent 4 }}
{{- if or (or .root.Values.gitSha .ingress.annotations) .root.Values.gitRepository }}
annotations:
{{- if .ingress.annotations }}
{{- toYaml .ingress.annotations | nindent 4 }}
{{- end }}
{{- end }}
spec:
{{- if .ingress.ingressClassName }}
ingressClassName: {{ .ingress.ingressClassName }}
{{- end }}
{{- if default false .ingress.tlsEnabled }}
tls:
- hosts:
- {{ .ingress.host | quote }}
secretName: {{ printf "tls-%s" $resourceName }}
{{- end }}
rules:
- host: {{ .ingress.host | quote }}
http:
paths:
- path: {{ .ingress.path | default "/" | quote }}
pathType: "Prefix"
backend:
service:
name: {{ $robustName }}
port:
number: {{ .root.Values.service.port }}
{{- end }}
{{- with .Values.ingress }}
{{- template "onechart.ingress" (dict "root" $ "ingress" .) }}
{{- end }}
{{- range .Values.ingresses }}
{{template "onechart.ingress" (dict "root" $ "ingress" . "longName" true) }}
{{- end }}
+25
View File
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "robustName" .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "staticSite.labels" . | nindent 4 }}
{{- if or .Values.gitRepository .Values.gitSha }}
annotations:
{{- if .Values.gitRepository }}
gimlet.io/git-repository: {{ .Values.gitRepository }}
{{- end }}
{{- if .Values.gitSha }}
gimlet.io/git-sha: {{ .Values.gitSha }}
{{- end }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "staticSite.selectorLabels" . | nindent 4 }}
@@ -0,0 +1,12 @@
suite: test deployment
templates:
- deployment.yaml
tests:
- it: Should set image, tag and command
set:
gitCloneUrl: https:/github.com/mycompany/myrepo.git
buildImage: nginx:x.y.z
asserts:
- equal:
path: spec.template.spec.initContainers[0].image
value: nginx:x.y.z
@@ -0,0 +1,120 @@
suite: test deployment
templates:
- ingress.yaml
tests:
- it: Should set Ingress host name
set:
ingress:
host: chart-example.local
tlsEnabled: true
asserts:
- equal:
path: spec.tls
value:
- hosts:
- chart-example.local
secretName: tls-release-name
- equal:
path: spec.rules
value:
- host: chart-example.local
http:
paths:
- path: "/"
pathType: "Prefix"
backend:
service:
name: release-name
port:
number: 80
- it: Should pass ingress host name as is, user must sanitize it
set:
ingress:
host: feature/my_branch.local
tlsEnabled: true
asserts:
- equal:
path: spec.tls
value:
- hosts:
- feature/my_branch.local
secretName: tls-release-name
- equal:
path: spec.rules
value:
- host: feature/my_branch.local
http:
paths:
- path: "/"
pathType: "Prefix"
backend:
service:
name: release-name
port:
number: 80
- it: Should set Ingress annotation
set:
ingress:
host: chart-example.local
annotations:
just/a-random: annotation
asserts:
- equal:
path: metadata.annotations
value:
just/a-random: annotation
- it: Should set ingress class
set:
ingress:
host: chart-example.local
ingressClassName: nginx
asserts:
- equal:
path: spec.ingressClassName
value: nginx
- it: Should generate multiple ingresses
set:
ingresses:
- host: chart-example.local
annotations:
kubernetes.io/ingress.class: nginx
- host: another.local
annotations:
kubernetes.io/ingress.class: nginx
asserts:
- hasDocuments:
count: 2
- it: Should generate multiple ingresses
set:
ingress:
host: chart-example.local
annotations:
kubernetes.io/ingress.class: nginx
ingresses:
- host: chart-example.local
annotations:
kubernetes.io/ingress.class: nginx
- host: another.local
annotations:
kubernetes.io/ingress.class: nginx
asserts:
- hasDocuments:
count: 3
- it: Should have unique TLS secret names
set:
ingresses:
- host: chart-example.local
tlsEnabled: true
annotations:
kubernetes.io/ingress.class: nginx
- host: another.local
tlsEnabled: true
annotations:
kubernetes.io/ingress.class: nginx
asserts:
- equal:
path: spec.tls
value:
- hosts:
- chart-example.local
secretName: tls-release-name-chart-example-local
@@ -0,0 +1,21 @@
suite: test ingress
templates:
- ingress.yaml
tests:
- it: Should default
set:
ingress:
host: chart-example.local
asserts:
- equal:
path: spec.rules[0].http.paths[0].path
value: "/"
- it: Should use path
set:
ingress:
host: chart-example.local
path: "/mypath"
asserts:
- equal:
path: spec.rules[0].http.paths[0].path
value: "/mypath"
@@ -0,0 +1,12 @@
suite: test deployment
templates:
- ingress.yaml
tests:
- it: Should use service port
set:
ingress:
host: chart-example.local
asserts:
- equal:
path: spec.rules[0].http.paths[0].backend.service.port.number
value: 1234
+116
View File
@@ -0,0 +1,116 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "The root schema",
"description": "The root schema comprises the entire JSON document.",
"default": {},
"examples": [
{
"gitCloneUrl": "https://github.com/gimlet-io/hugo-site.git",
"buildImage": "node:latest",
"buildScript": "npm install && npm install -g gatsby-cli && gatsby build",
"builtAssets": "public/"
}
],
"required": [
"gitCloneUrl",
"buildImage",
"buildScript",
"builtAssets"
],
"properties": {
"gitCloneUrl": {
"$id": "#/properties/gitCloneUrl",
"type": "string",
"title": "Repo url",
"description": "The static site's git repository",
"default": "https://github.com/gimlet-io/reactjs-test-app.git"
},
"buildImage": {
"$id": "#/properties/buildImage",
"type": "string",
"title": "Build image",
"description": "The image that will be used for the build proccess",
"default": "node:latest"
},
"buildScript": {
"$id": "#/properties/buildScript",
"type": "string",
"title": "Build script",
"description": "Commands required for the build to be completed",
"default": "# !/usr/bin/env bash\n\nnpm install\nnpm run build"
},
"builtAssets": {
"$id": "#/properties/builtAssets",
"type": "string",
"title": "Built assets",
"description": "The folder containing the build's generated files",
"default": "build/"
},
"ingress": {
"$id": "#/properties/ingress",
"type": "object",
"title": "Incoming traffic",
"description": "",
"default": {},
"examples": [
{
"tlsEnabled": false,
"annotations": {
"kubernetes.io/ingress.class": "nginx"
},
"host": "my-release.mycompany.com"
}
],
"required": [],
"properties": {
"host": {
"$id": "#/properties/ingress/properties/host",
"type": "string",
"title": "Host Name",
"description": "Where your application will be accessible",
"default": "",
"examples": [
"my-release.mycompany.com"
]
},
"path": {
"$id": "#/properties/ingress/properties/ingressPath",
"type": "string",
"title": "Path",
"description": "The API path where your service is accessible",
"default": "/",
"examples": [
"/api/myservice"
]
},
"tlsEnabled": {
"$id": "#/properties/ingress/properties/tlsEnabled",
"type": "boolean",
"title": "HTTPS",
"description": "",
"default": false,
"examples": [
false
]
},
"annotations": {
"$id": "#/properties/ingress/properties/annotations",
"type": "object",
"title": "Annotations",
"description": "Annotations are used to control ingress behavior. See the full list for the Ingress Nginx project at https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/. Use the `cert-manager.io/cluster-issuer:\"letsencrypt\"` one to request TLS certificates, `kubernetes.io/ingress.class: \"nginx\"` to select an ingress controller.",
"default": {},
"examples": [
{
"kubernetes.io/ingress.class": "nginx"
}
],
"additionalProperties": true
}
}
}
},
"additionalProperties": true
}
+60
View File
@@ -0,0 +1,60 @@
# Default values for static-site.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
tag: latest
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext:
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
runAsUser: 0
service:
type: ClusterIP
port: 80
# ingress:
# host: dummyapp.127.0.0.1.nip.io
# ingressClassName: nginx
# tlsEnabled: false
# annotations:
# cert-manager.io/cluster-issuer: letsencrypt-staging
resources:
requests:
cpu: 200m
memory: 200Mi
limits:
cpu: 200m
memory: 200Mi
nodeSelector: {}
tolerations: []
affinity: {}
# values to build and deploy static sites
gitCloneUrl: https://github.com/gimlet-io/reactjs-test-app.git
buildImage: "node:latest"
buildScript: |
npm install && npm run build
builtAssets: build/
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More