├── .gitignore ├── .github └── ISSUE_TEMPLATE │ ├── hyscale-bug-report.md │ └── hyscale-feature-request.md ├── CHANGELOG.md ├── README.md ├── schema ├── profile-spec.json └── service-spec.json ├── LICENSE └── docs └── hyscale-spec-reference.md /.gitignore: -------------------------------------------------------------------------------- 1 | #IDE specific 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.log 6 | *.project 7 | *.classpath 8 | .settings/ 9 | .idea/* 10 | .metadata/ 11 | 12 | 13 | #general files 14 | *.swp 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/hyscale-bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: HyScale Bug Report 3 | about: Describe HyScale Bug 4 | title: '' 5 | labels: '' 6 | assignees: vijaySamanuri 7 | 8 | --- 9 | 10 | Summary : 11 | --- 12 | **Steps to replicate:** 13 | 14 | **Expected result:** 15 | 16 | **Actual result:** 17 | 18 | **Screenshots/Additional info:** 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/hyscale-feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: HyScale Feature request 3 | about: Suggest an idea/features 4 | title: '' 5 | labels: '' 6 | assignees: vijaySamanuri 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe:** 11 | 12 | **Describe the solution you'd like:** 13 | 14 | **Describe alternatives you've considered:** 15 | 16 | **Additional context:** 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # v0.6.5 Release 2 | 3 | ### Features: 4 | 5 | * Added loadBalancer field in spec for Load Balancer Support 6 | 7 | # v0.6.4 Release 8 | 9 | ### Features: 10 | 11 | * Added allowTraffic field in spec to support Network Traffic Policy 12 | * Added ports field for Agents 13 | 14 | # v0.6.3 Release 15 | 16 | ### Features: 17 | 18 | * Added k8sSnippets section in spec to support Kubernetes Snippets 19 | 20 | # v0.6.2.1 Release 21 | 22 | ### Features: 23 | 24 | * Added target field to support multistage dockerfiles in dockerfile of hspec 25 | 26 | # v0.6.2 Release 27 | 28 | ### Features: 29 | 30 | * Supporting Pattern validation for Port type 31 | 32 | # v0.6.1.1 Release 33 | 34 | ### Fixes: 35 | 36 | * Fixes for profile schema data type's 37 | 38 | # v0.6.1 Release 39 | 40 | ### Features: 41 | 42 | * Added profile file support for Configuration Management. 43 | 44 | 45 | # v0.6 Release 46 | 47 | ### Features: 48 | 49 | * Added agents section in spec to support sidecar attachments. 50 | 51 | * Updated replicas field to support autoscaling setting. 52 | 53 | * Updated Json schema and docs to support agents, replicas. 54 | 55 | 56 | # v0.5 Release 57 | 58 | This is the first open source Release of hspec 59 | 60 | ### Features: 61 | 62 | * Added standalone Json schema for the hyscale service spec. 63 | 64 | * Added hyscale spec reference document. 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![HyScale](https://www.hyscale.io/wp-content/uploads/2019/01/hyscale-logo.png) 2 | 3 | ### hspec 4 | 5 | ##### An Application centric Specification for deploying cloud native applications. 6 | 7 | hspec (Service Specification) is used to declaratively describe the service and its related configuration. It provides abstraction on top of kubernetes deployment infrastructure. It enables users to operate on top of applications & services rather than low level infrastructure resource objects. 8 | 9 | Additionally the hprof (Environment Profile) file is meant for environment related overrides/differences. It can override certain service related configurations like memory & cpu sizes, secrets, no.of replicas etc for specific Environments such as testing, staging, production etc. 10 | 11 | A simple hspec looks like : 12 | 13 | ```yaml 14 | name: myservice 15 | image: 16 | registry: registry.hub.docker.com 17 | name: library/tomcat 18 | tag: 8.5.0-jre8 19 | 20 | volumes: 21 | - name: tomcat-logs-dir 22 | path: /usr/local/tomcat/logs 23 | 24 | replicas: 2 25 | external: true 26 | ports: 27 | - port: 8080/tcp 28 | healthCheck: 29 | httpPath: /docs/images/tomcat.gif 30 | ``` 31 | 32 | A sample hprof looks like below: 33 | 34 | ```yaml 35 | environment: stage 36 | overrides: myservice 37 | volumes: 38 | - name: tomcat-logs-dir 39 | size: 2Gi 40 | 41 | replicas: 42 | min: 1 43 | max: 4 44 | cpuThreshold: 30% 45 | ``` 46 | 47 | For full spec reference [click here](docs/hyscale-spec-reference.md). 48 | 49 | hspec runtime implementation is [HyScale](https://github.com/hyscale/hyscale) tool. To get started with an example of using hspec to deploy application onto kubernetes, please follow hyscale [tutorial](https://github.com/hyscale/hyscale/wiki/Tutorial). 50 | -------------------------------------------------------------------------------- /schema/profile-spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "type": "object", 4 | "description": "Profile Spec declares the changes required in-service specification for a particular environment.", 5 | "definitions": { 6 | "io.hyscale.api.map.string": { 7 | "description": "Describes the key-value pair of any attribute", 8 | "type": "object", 9 | "additionalProperties": { 10 | "type": [ 11 | "string", 12 | "number", 13 | "boolean" 14 | ] 15 | } 16 | }, 17 | "io.hyscale.api.list.string": { 18 | "description": "Describes the keys of any attribute", 19 | "type": "array", 20 | "items": { 21 | "type": [ 22 | "string", 23 | "number" 24 | ], 25 | "description": "string key" 26 | } 27 | }, 28 | "io.hyscale.api.replicas.Replicas": { 29 | "description": "Defines the replicas of the service", 30 | "required": [ 31 | "max", 32 | "cpuThreshold" 33 | ], 34 | "type": "object", 35 | "properties": { 36 | "min": { 37 | "type": "integer", 38 | "description": "specifies the min no.of replicas required for this service " 39 | }, 40 | "max": { 41 | "type": "integer", 42 | "description": "specifies the max no.of replicas required for this service " 43 | }, 44 | "cpuThreshold": { 45 | "type": "string", 46 | "pattern": "\\d+%", 47 | "description": "specifies the cpu threshold in percentage for the replicas to scale " 48 | } 49 | } 50 | }, 51 | "io.hyscale.api.loadBalancer.Mappings":{ 52 | "type": "array", 53 | "description": "defines loadBalancer mappings", 54 | "items": { 55 | "type": "object", 56 | "description": "defines paths mappings for port", 57 | "properties": { 58 | "port": { 59 | "anyOf": [ 60 | { 61 | "type": "integer" 62 | }, 63 | { 64 | "type": "string", 65 | "pattern": "(([0-9])+)(\\/(tcp|TCP|udp|UDP|http|HTTP|https|HTTPS))?" 66 | } 67 | ], 68 | "description": "defines port number along with type. default type is tcp." 69 | }, 70 | "contextPaths": { 71 | "description": "describes context paths for the specified port", 72 | "$ref": "#/definitions/io.hyscale.api.list.string" 73 | } 74 | } 75 | } 76 | } 77 | }, 78 | "required": [ 79 | "environment", 80 | "overrides" 81 | ], 82 | "properties": { 83 | "replicas": { 84 | "anyOf": [ 85 | { 86 | "type": "integer" 87 | }, 88 | { 89 | "$ref": "#/definitions/io.hyscale.api.replicas.Replicas" 90 | } 91 | ], 92 | "description": "defines the number of replicas that this service should run", 93 | "default": 1 94 | }, 95 | "volumes": { 96 | "type": "array", 97 | "description": "The Volumes array", 98 | "items": { 99 | "type": "object", 100 | "description": "describes provision and attachment of volume", 101 | "required": [ 102 | "name" 103 | ], 104 | "properties": { 105 | "name": { 106 | "type": "string", 107 | "description": "name of the volume" 108 | }, 109 | "size": { 110 | "type": "string", 111 | "description": "size of volume", 112 | "default": "1g" 113 | }, 114 | "storageClass": { 115 | "type": "string", 116 | "description": "defines the class for storage provider of your cluster volumes" 117 | } 118 | } 119 | } 120 | }, 121 | "secrets": { 122 | "anyOf": [ 123 | { 124 | "$ref": "#/definitions/io.hyscale.api.list.string" 125 | }, 126 | { 127 | "$ref": "#/definitions/io.hyscale.api.map.string" 128 | } 129 | ], 130 | "description": "defines all secrets" 131 | }, 132 | "props": { 133 | "description": "props is an unstructured key value map", 134 | "$ref": "#/definitions/io.hyscale.api.map.string" 135 | }, 136 | "memory": { 137 | "description": "Defines the range of memory the service has to use in the container for this environment", 138 | "type": "string", 139 | "pattern": "(\\d+(Ki|Mi|Gi|Ti|Pi|Ei|[numkMGTPE]|))+(-\\d+(Ki|Mi|Gi|Ti|Pi|Ei|[numkMGTPE]|))*" 140 | }, 141 | "cpu": { 142 | "description": "Defines the range of cpu the service has to use in the container for this environment", 143 | "type": "string", 144 | "pattern": "([\\d.\\d]+m)+(-[\\d.\\d]+m)*" 145 | }, 146 | "k8sSnippets": { 147 | "description": "Define the list of k8sSnippets that needs to patched in the generated manifest files", 148 | "$ref": "#/definitions/io.hyscale.api.list.string" 149 | }, 150 | "allowTraffic": { 151 | "type": "array", 152 | "description": "Define rules to restrict traffic to the service", 153 | "items": { 154 | "type" : "object", 155 | "properties" : { 156 | "ports" : { 157 | "description": "Define the ports of this service which are accessible from other services", 158 | "$ref": "#/definitions/io.hyscale.api.list.string" 159 | }, 160 | "from" : { 161 | "description": "Define the list of services which can access this service ports", 162 | "$ref": "#/definitions/io.hyscale.api.list.string" 163 | } 164 | } 165 | } 166 | }, 167 | "loadBalancer": { 168 | "type": "object", 169 | "description": "Defines rules for creation of load balancer to the service", 170 | "items": { 171 | "type" : "object", 172 | "properties" : { 173 | "provider" : { 174 | "description": "Defines the provider of the load balancer", 175 | "type": "string" 176 | }, 177 | "className" : { 178 | "description": "Define the Ingress className", 179 | "type": "string" 180 | }, 181 | "host" : { 182 | "description": "Define the host using which this service should be accessed", 183 | "type": "string" 184 | }, 185 | "sticky" : { 186 | "description": "Enables session stickiness ", 187 | "type": "boolean" 188 | }, 189 | "tlsSecret" : { 190 | "description": "Define the TLS secret name", 191 | "type": "string" 192 | }, 193 | "mapping" : { 194 | "description": "Define ports and corresponding context path mapping for each port", 195 | "$ref": "#/definitions/io.hyscale.api.loadBalancer.Mappings" 196 | }, 197 | "headers": { 198 | "description": "Define headers", 199 | "$ref": "#/definitions/io.hyscale.api.map.string" 200 | }, 201 | "labels" : { 202 | "description": "Define labels", 203 | "$ref": "#/definitions/io.hyscale.api.map.string" 204 | } 205 | } 206 | } 207 | } 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | Copyright 2019 Pramati Prism, Inc. 179 | 180 | Licensed under the Apache License, Version 2.0 (the "License"); 181 | you may not use this file except in compliance with the License. 182 | You may obtain a copy of the License at 183 | 184 | http://www.apache.org/licenses/LICENSE-2.0 185 | 186 | Unless required by applicable law or agreed to in writing, software 187 | distributed under the License is distributed on an "AS IS" BASIS, 188 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 189 | See the License for the specific language governing permissions and 190 | limitations under the License. 191 | -------------------------------------------------------------------------------- /schema/service-spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "type": "object", 4 | "description": "Service Spec declares the image specification and the desired state of the service ", 5 | "definitions": { 6 | "io.hyscale.api.image.Dockerfile": { 7 | "description": "Describes dockerfile settings to create container image.", 8 | "properties": { 9 | "path": { 10 | "description": "defines buildcontext path", 11 | "type": "string", 12 | "default": "./" 13 | }, 14 | "dockerfilePath": { 15 | "description": "defines the path to dockerfile. Effective dockerfile is $path/$dockerfilePath", 16 | "type": "string", 17 | "default": "Dockerfile" 18 | }, 19 | "target": { 20 | "description": "specify an intermediate build stage by name as a final stage for the resulting image in case of multi-stage dockerfile. Docker will read the instruction upto that specified stage from dockerfile while building the image.", 21 | "type": "string" 22 | }, 23 | "args": { 24 | "description": "args is the list of build arguments to be passed during container image build. should be given in this format = ", 25 | "$ref": "#/definitions/io.hyscale.api.map.string" 26 | } 27 | }, 28 | "type": "object" 29 | }, 30 | "io.hyscale.api.image.buildSpec.Artifact": { 31 | "description": "Describes artifact source and destination inside container.", 32 | "properties": { 33 | "name": { 34 | "description": "defines the name of the artifact. should be unique", 35 | "type": "string" 36 | }, 37 | "source": { 38 | "description": "defines the source path of the artifact. should be relative path if provider is local. full remote url if http is given, file path to the artifact in the remote ssh", 39 | "type": "string" 40 | }, 41 | "destination": { 42 | "description": "defines the destination path inside container.", 43 | "type": "string" 44 | } 45 | }, 46 | "required": [ 47 | "name", 48 | "source", 49 | "destination" 50 | ], 51 | "type": "object" 52 | }, 53 | "io.hyscale.api.image.BuildSpec": { 54 | "description": "Describes buildSpec settings to create container image.", 55 | "properties": { 56 | "stackImage": { 57 | "description": "defines stackImage full name", 58 | "type": "string" 59 | }, 60 | "artifacts": { 61 | "description": "defines the artifact list", 62 | "items": { 63 | "$ref": "#/definitions/io.hyscale.api.image.buildSpec.Artifact" 64 | }, 65 | "type": "array" 66 | }, 67 | "configCommandsScript": { 68 | "description": "defines a script containing configuration commands. script execution happens at the time of image build", 69 | "type": "string" 70 | }, 71 | "configCommands": { 72 | "description": "defines configuration commands. execution happens at the time of image build", 73 | "type": "string" 74 | }, 75 | "runCommandsScript": { 76 | "description": "defines a script containing run commands. Gets executed at the time of container start", 77 | "type": "string" 78 | }, 79 | "runCommands": { 80 | "description": "defines run commands. Gets executed at the time of container start", 81 | "type": "string" 82 | } 83 | }, 84 | "required": [ 85 | "stackImage" 86 | ], 87 | "type": "object" 88 | }, 89 | "io.hyscale.api.image.Image": { 90 | "description": "Describes container Image, could be from dockerfile or buildSpec", 91 | "properties": { 92 | "name": { 93 | "description": "Name of final Image", 94 | "type": "string" 95 | }, 96 | "tag": { 97 | "description": "tag defines the final image tag", 98 | "anyOf": [ 99 | { 100 | "type": "string", 101 | "pattern": "^[a-z0-9]+([._-][a-z0-9]+)*" 102 | }, 103 | { 104 | "type": "number" 105 | } 106 | ] 107 | }, 108 | "registry": { 109 | "description": "docker registry url along with namespace", 110 | "type": "string", 111 | "default": "registry.hub.docker.com" 112 | }, 113 | "dockerfile": { 114 | "$ref": "#/definitions/io.hyscale.api.image.Dockerfile", 115 | "description": "dockerfile describes how to build container image using dockerfile." 116 | }, 117 | "buildSpec": { 118 | "$ref": "#/definitions/io.hyscale.api.image.BuildSpec", 119 | "description": "buildSpec describes what the image should contain like stack, artifact and configuration. It is considered as an alternative to dockerfile spec" 120 | } 121 | }, 122 | "required": [ 123 | "name" 124 | ], 125 | "type": "object" 126 | }, 127 | "io.hyscale.api.props.PropsVolumePath": { 128 | "description": "Defines the absolute path to where the props have to be mounted in the container", 129 | "type": "string" 130 | }, 131 | "io.hyscale.api.secrets.SecretsVolumePath": { 132 | "description": "Defines the absolute path to where the secrets have to be mounted in the container", 133 | "type": "string" 134 | }, 135 | "io.hyscale.api.map.string": { 136 | "description": "Describes the key-value pair of any attribute", 137 | "type": "object", 138 | "additionalProperties": { 139 | "type": [ 140 | "string", 141 | "number", 142 | "boolean" 143 | ] 144 | } 145 | }, 146 | "io.hyscale.api.list.string": { 147 | "description": "Defines the keys of any attribute of the service", 148 | "type": "array", 149 | "items": { 150 | "type": ["string","number"], 151 | "description": "string key" 152 | } 153 | }, 154 | "io.hyscale.api.replicas.Replicas": { 155 | "description": "Defines the replicas of the service", 156 | "type": "object", 157 | "properties": { 158 | "min": { 159 | "type": "integer", 160 | "description": "specifies the min no.of replicas required for this service ", 161 | "default": 1 162 | }, 163 | "max": { 164 | "type": "integer", 165 | "description": "specifies the max no.of replicas required for this service " 166 | }, 167 | "cpuThreshold": { 168 | "type": "string", 169 | "pattern": "\\d+%", 170 | "description": "specifies the cpu threshold in percentage for the replicas to scale " 171 | } 172 | }, 173 | "required": [ 174 | "max", 175 | "cpuThreshold" 176 | ] 177 | }, 178 | "io.hyscale.api.ports.Ports": { 179 | "type": "array", 180 | "description": "defines ports", 181 | "items": { 182 | "type": "object", 183 | "description": "defines port along with healthcheck and lbmappings if any", 184 | "required": [ 185 | "port" 186 | ], 187 | "properties": { 188 | "port": { 189 | "anyOf": [ 190 | { 191 | "type": "integer" 192 | }, 193 | { 194 | "type": "string", 195 | "pattern": "(([0-9])+)(\\/(tcp|TCP|udp|UDP|http|HTTP|https|HTTPS))?" 196 | } 197 | ], 198 | "description": "defines port number along with type. default type is tcp." 199 | }, 200 | "healthCheck": { 201 | "type": "object", 202 | "description": "The Healthcheck Schema", 203 | "properties": { 204 | "httpPath": { 205 | "type": "string", 206 | "description": "describes httpPath of http healthcheck" 207 | } 208 | } 209 | } 210 | } 211 | } 212 | }, 213 | "io.hyscale.api.loadBalancer.Mappings":{ 214 | "type": "array", 215 | "description": "defines loadBalancer mappings", 216 | "items": { 217 | "type": "object", 218 | "description": "defines path mappings for ports", 219 | "properties": { 220 | "port": { 221 | "anyOf": [ 222 | { 223 | "type": "integer" 224 | }, 225 | { 226 | "type": "string", 227 | "pattern": "(([0-9])+)(\\/(tcp|TCP|udp|UDP|http|HTTP|https|HTTPS))?" 228 | } 229 | ], 230 | "description": "defines port number along with type. default type is tcp." 231 | }, 232 | "contextPaths": { 233 | "description": "describes context paths for the specified port", 234 | "$ref": "#/definitions/io.hyscale.api.list.string" 235 | } 236 | } 237 | } 238 | } 239 | }, 240 | "required": [ 241 | "name", 242 | "image" 243 | ], 244 | "properties": { 245 | "hspecVersion": { 246 | "description": "Defines the hspec version", 247 | "type": "string", 248 | "enum": [ 249 | "0.5", 250 | "0.6", 251 | "0.6.1", 252 | "0.6.1.1", 253 | "0.6.2", 254 | "0.6.3", 255 | "0.6.4" 256 | ] 257 | }, 258 | "name": { 259 | "description": "name of service spec, also used as endpoint", 260 | "type": "string" 261 | }, 262 | "image": { 263 | "description": "image specification", 264 | "$ref": "#/definitions/io.hyscale.api.image.Image" 265 | }, 266 | "replicas": { 267 | "anyOf": [ 268 | { 269 | "type": "integer" 270 | }, 271 | { 272 | "$ref": "#/definitions/io.hyscale.api.replicas.Replicas" 273 | } 274 | ], 275 | "description": "number of replicas of this service", 276 | "default": 1 277 | }, 278 | "volumes": { 279 | "type": "array", 280 | "description": "The Volumes array", 281 | "items": { 282 | "type": "object", 283 | "description": "describes provision and attachment of volume", 284 | "required": [ 285 | "name", 286 | "path" 287 | ], 288 | "properties": { 289 | "name": { 290 | "type": "string", 291 | "description": "name of the volume" 292 | }, 293 | "path": { 294 | "type": "string" 295 | }, 296 | "size": { 297 | "type": "string", 298 | "description": "size of volume", 299 | "default": "1g" 300 | }, 301 | "storageClass": { 302 | "type": "string", 303 | "description": "defines the class for storage provider of your cluster volumes" 304 | } 305 | } 306 | } 307 | }, 308 | "secrets": { 309 | "description": "defines all secrets", 310 | "anyOf": [ 311 | { 312 | "$ref": "#/definitions/io.hyscale.api.list.string" 313 | }, 314 | { 315 | "$ref": "#/definitions/io.hyscale.api.map.string" 316 | } 317 | ] 318 | }, 319 | "props": { 320 | "description": "props is an unstructured key value map", 321 | "$ref": "#/definitions/io.hyscale.api.map.string" 322 | }, 323 | "propsVolumePath": { 324 | "description": "Defines the absolute path to where the props have to be mounted in the container", 325 | "$ref": "#/definitions/io.hyscale.api.props.PropsVolumePath" 326 | }, 327 | "external": { 328 | "description": "Exposes the service externally ", 329 | "type": "boolean" 330 | }, 331 | "ports": { 332 | "$ref": "#/definitions/io.hyscale.api.ports.Ports", 333 | "description": "defines ports" 334 | }, 335 | "secretsVolumePath": { 336 | "description": "Defines the absolute path to where the secrets have to be mounted in the container", 337 | "$ref": "#/definitions/io.hyscale.api.secrets.SecretsVolumePath" 338 | }, 339 | "memory": { 340 | "description": "Defines the range of memory the service has to use in the container", 341 | "type": "string", 342 | "pattern": "(\\d+(Ki|Mi|Gi|Ti|Pi|Ei|[numkMGTPE]|))+(-\\d+(Ki|Mi|Gi|Ti|Pi|Ei|[numkMGTPE]|))*" 343 | }, 344 | "cpu": { 345 | "description": "Defines the range of cpu the service has to use in the container", 346 | "type": "string", 347 | "pattern": "([\\d.\\d]+m)+(-[\\d.\\d]+m)*" 348 | }, 349 | "startCommand": { 350 | "description": "Defines the command which gets executed at the time of container start", 351 | "type": "string", 352 | "pattern": "[\\w,]*" 353 | }, 354 | "agents": { 355 | "description": "Describes the list of sidecars to be attached to the service", 356 | "items": { 357 | "type": "object", 358 | "properties": { 359 | "image": { 360 | "type": "string", 361 | "description": "Describes the sidecar image" 362 | }, 363 | "name": { 364 | "type": "string", 365 | "description": "Describes the name of the sidecar" 366 | }, 367 | "props": { 368 | "$ref": "#/definitions/io.hyscale.api.map.string", 369 | "description": "Describes the properties of the service sidecar as key-value pairs " 370 | }, 371 | "propsVolumePath": { 372 | "$ref": "#/definitions/io.hyscale.api.props.PropsVolumePath", 373 | "description": "Describes the properties volume of the service" 374 | }, 375 | "secrets": { 376 | "anyOf": [ 377 | { 378 | "$ref": "#/definitions/io.hyscale.api.list.string" 379 | }, 380 | { 381 | "$ref": "#/definitions/io.hyscale.api.map.string" 382 | } 383 | ], 384 | "description": "Describes the secrets of the service as an array" 385 | }, 386 | "secretsVolumePath": { 387 | "$ref": "#/definitions/io.hyscale.api.secrets.SecretsVolumePath", 388 | "description": "Describes the secrets volume of the service." 389 | }, 390 | "ports": { 391 | "$ref": "#/definitions/io.hyscale.api.ports.Ports", 392 | "description": "defines ports" 393 | }, 394 | "volumes": { 395 | "type": "array", 396 | "description": "Describes the shared volumes of the service", 397 | "items": { 398 | "type": "object", 399 | "description": "Describes the volumes for agents", 400 | "properties": { 401 | "attach": { 402 | "type": "string", 403 | "description": "Defines the volume name of the service that has to be attached to the sidecar." 404 | }, 405 | "mountPath": { 406 | "type": "string", 407 | "description": "Defines the mount path that volume has to be mounted on the sidecar" 408 | } 409 | }, 410 | "required": [ 411 | "attach", 412 | "mountPath" 413 | ] 414 | } 415 | } 416 | }, 417 | "description": "defines the agent with its properties" 418 | }, 419 | "type": "array" 420 | }, 421 | "k8sSnippets": { 422 | "description": "Define the list of k8sSnippets that needs to patched in the generated manifest files", 423 | "$ref": "#/definitions/io.hyscale.api.list.string" 424 | }, 425 | "allowTraffic": { 426 | "type": "array", 427 | "description": "Define rules to restrict traffic to the service", 428 | "items": { 429 | "type" : "object", 430 | "properties" : { 431 | "ports" : { 432 | "description": "Define the ports of this service which are accessible from other services", 433 | "$ref": "#/definitions/io.hyscale.api.list.string" 434 | }, 435 | "from" : { 436 | "description": "Define the list of services which can access this service ports", 437 | "$ref": "#/definitions/io.hyscale.api.list.string" 438 | } 439 | } 440 | } 441 | }, 442 | "loadBalancer":{ 443 | "type": "object", 444 | "description": "Defines rules for creation of load balancer to the service", 445 | "items": { 446 | "type" : "object", 447 | "properties" : { 448 | "provider" : { 449 | "description": "Defines the provider of the load balancer", 450 | "type": "string" 451 | }, 452 | "className" : { 453 | "description": "Define the Ingress className", 454 | "type": "string" 455 | }, 456 | "host" : { 457 | "description": "Define the host or domain", 458 | "type": "string" 459 | }, 460 | "sticky" : { 461 | "description": "Enables session stickiness ", 462 | "type": "boolean" 463 | }, 464 | "tlsSecret" : { 465 | "description": "Defines name of the TLS secret resource", 466 | "type": "string" 467 | }, 468 | "mapping" : { 469 | "description": "Define ports and corresponding context path mapping for each port", 470 | "$ref": "#/definitions/io.hyscale.api.loadBalancer.Mappings" 471 | }, 472 | "headers": { 473 | "description": "Define headers", 474 | "$ref": "#/definitions/io.hyscale.api.map.string" 475 | }, 476 | "labels" : { 477 | "description": "Define labels", 478 | "$ref": "#/definitions/io.hyscale.api.map.string" 479 | } 480 | } 481 | } 482 | } 483 | } 484 | } 485 | -------------------------------------------------------------------------------- /docs/hyscale-spec-reference.md: -------------------------------------------------------------------------------- 1 | 2 | # Hyscale Spec File Reference 3 | 4 | > Version 0.6.5.1
5 | 6 | 7 | Table of contents 8 | ================= 9 | 10 | 11 | * [Overview](#overview) 12 | * [Reference Spec File](#Reference-Spec-File-with-all-options) 13 | * [Example Spec](#Example) 14 | * [Field Reference](#Field-Reference) 15 | * [Spec Template File](#Spec-Template-File) 16 | * [Profile Files](#Profile-Files) 17 | 18 | 19 | 20 | ## Overview 21 | 22 | * The Hyscale Service Spec file is meant for user to declaratively describe the service/application and its related configuration. 23 | * Hyscale Spec File is a valid YAML file. 24 | * Abstracts Kubernetes concepts/knowledge with a simplified DSL. 25 | * Developer friendly and can be added to version control. 26 | * Spec file should end with “.hspec” so that service specs can be easily identified. 27 | * Filename should be named exactly as per service name `.hspec` 28 | * Multiple spec files can be present in a directory. 29 | * Support environment profiles (eg: dev, stage and prod etc.) Env props and customizations are in profile file. 30 | * Profile files may mirror some of the fields given in the service spec. Only few fields allowed as indicated in this reference. Any fields specified in profile may get merged or override the ones given in spec, this behaviour is specified below for each field. `Future item` 31 | * Supports camel case for keys. Along with camel case, Uppercase for keys can be accepted in the future. In case of Uppercase, multi-word keys are separated by underscore `(_)` delimiter. 32 | 33 | * Works for any service be it bespoke, off-the-shelf, stateless, stateful, etc. 34 | * Following Infra targets are assumed : 35 | * kubernetes cluster from ~/.kube/config 36 | * registry authentication credentials from ~/.docker/config.json 37 | 38 | ## Reference Spec File with all options 39 | 40 | 41 | ```yaml 42 | 43 | name: # should be same as in filename 44 | image: 45 | name: 46 | registry: 47 | tag: 48 | dockerfile: 49 | path: # default is ./ 50 | dockerfilePath: # default is /Dockerfile 51 | args: 52 | : 53 | buildSpec: 54 | stackImage: [/][:] 55 | artifacts: 56 | - name: 57 | source: # eg: /login/target/{{ buildNumber }}/login.war 58 | destination: 59 | 60 | configCommandsScript: # output of this script is baked inside image 61 | configCommands: |- 62 | 63 | [] 64 | . 65 | . 66 | [] 67 | 68 | runCommandsScript: # runs on container start 69 | 70 | # CMD in dockerfile 71 | runCommands: |- 72 | # Executes while container start 73 | [] 74 | [] 75 | . 76 | . 77 | [] 78 | 79 | startCommand: # command+args in k8s yaml, overrides ENTRYPOINT+CMD 80 | replicas: # one of integer or struct 81 | # represents the number of instances of this service 82 | # you can directly declare a integer like `replicas: 2` (default is 1) 83 | # or use struct for autoscaling setting 84 | 85 | memory: [-] # Supported units are 86 | # 1. Ki|Mi|Gi|Ti|Pi|Ei as power of two equivalents 87 | # 2. n|u|m|k|M|G|T|P|E as plain integers 88 | cpu: [-] # Supported units are `m` or `none` 89 | 90 | external: # default is false 91 | ports: 92 | - port: [/] # default type is tcp 93 | healthCheck: 94 | httpPath: # default is false 95 | 96 | [- port: /] 97 | 98 | volumes: 99 | - name: 100 | path: 101 | [size: ] # default size is 1G 102 | # Supported units are 103 | # 1. Ki|Mi|Gi|Ti|Pi|Ei as power of two equivalents 104 | # 2. n|u|m|k|M|G|T|P|E as plain integers 105 | storageClass: 106 | 107 | propsVolumePath: 108 | props: 109 | : [(][)] # default type is string 110 | [: ] 111 | . 112 | [: ] 113 | 114 | secrets: # Secrets accept both list of keys & key value pairs 115 | - # Incase of list, secret should be created prior as - 116 | - # - : 117 | # - : 118 | - # - : 119 | 120 | secretsVolumePath: 121 | agents: 122 | - name: 123 | image: [/][:] 124 | props: 125 | : [(][)] 126 | [: [(][)] 127 | secrets: # Secrets accept both list of keys & key value pairs 128 | - # Incase of list, secret should be created prior as - 129 | - # - : 130 | # - : 131 | - # - : 132 | secretsVolumePath: 133 | volumes: 134 | - mountPath: 135 | attach: # use same name as service vol for sharing 136 | [readOnly: ] # readOnly is valid for shared volume 137 | [- mountPath: 138 | attach: ] 139 | [readOnly: ] 140 | propsVolumePath: 141 | ports: 142 | - port: [/] # default type is tcp 143 | healthCheck: 144 | httpPath: # default is false 145 | 146 | [- port: /] 147 | k8sSnippets: 148 | - <"path-to-customSnippetFile1"> # Relative path to the k8s snippet is expected here 149 | - [<"path-to-customSnippetFile2">] 150 | . 151 | . 152 | - [<"path-to-customSnippetFileN">] 153 | allowTraffic: # External should be false 154 | - ports: 155 | -[/] # Should be available in the service spec 156 | [-/] # default type is tcp 157 | from: 158 | - # Other services that can connect to this service 159 | [-] 160 | loadBalancer: 161 | provider: 162 | className: 163 | host: 164 | sticky: # default is false 165 | tlsSecret: 166 | mapping: 167 | - port: [/] # Should be available in service spec 168 | contextPaths: 169 | - # Path mappings for the defined port 170 | [-] 171 | headers: 172 | : 173 | [: ] 174 | . 175 | [: ] 176 | labels: 177 | : 178 | [: ] 179 | . 180 | [: ] 181 | ``` 182 | 183 | Here is the [Service Spec Schema](../schema/service-spec.json) 184 | 185 | ## Example 186 | 187 | 188 | ```yaml 189 | 190 | name: hrms-frontend 191 | image: 192 | name: gcr.io/hyscale-hrms/hrms-frontend:1.0 193 | dockerfile: {} # all default values 194 | replicas: 1 195 | volumes: 196 | - name: logs 197 | path: /usr/local/tomcat/logs 198 | size: 1Gi 199 | - name: data 200 | path: /data 201 | size: 2Gi 202 | 203 | secrets: 204 | - keystore_password 205 | 206 | props: 207 | max_conn: file(./config/config.xml) 208 | country: india 209 | region: hyderabad 210 | mysql_ost: endpoint(mysqldb) 211 | max_threads: 15 212 | server_xml: file(./config/tomcat/server.xml) 213 | external: true 214 | ports: 215 | - port: 8080/tcp 216 | healthCheck: 217 | httpPath: /hrms 218 | 219 | agents: 220 | - name: fluentd 221 | image: quay.io/fluentd_elasticsearch/fluentd 222 | props: 223 | FLUENTD_ARGS: --no-supervisor -vv 224 | volumes: 225 | - mountPath: /mnt/log 226 | attach: tomcat-logs 227 | 228 | ``` 229 | 230 | 231 | ## Field Reference 232 | 233 | *Note: A Boolean represents a true/false value. Booleans are formatted as English words (“true”/“false”, “yes”/“no” or “on”/“off”) for readability and may be abbreviated as a single character “y”/“n” or “Y”/“N”.* 234 | 235 | y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF 236 | 237 | *all the above expressions are considered to be boolean values not a string . If you want to refer the value as string use quotes like "yes".* 238 | 239 | 240 | 241 | 243 | 245 | 247 | 249 | 250 | 251 | 253 | 255 | 257 | 272 | 273 | 274 | 276 | 278 | 280 | 287 | 288 | 289 | 291 | 293 | 295 | 305 | 306 | 307 | 309 | 311 | 313 | 323 | 324 | 325 | 327 | 329 | 331 | 344 | 345 | 346 | 348 | 350 | 352 | 363 | 364 | 365 | 367 | 369 | 371 | 375 | 376 | 377 | 379 | 381 | 383 | 415 | 416 | 417 | 419 | 421 | 423 | 443 | 444 | 445 | 447 | 449 | 451 | 457 | 458 | 459 | 461 | 463 | 465 | 471 | 472 | 473 | 474 | 475 | 476 | 482 | 483 | 484 | 485 | 487 | 489 | 491 | 497 | 498 | 499 | 501 | 503 | 505 | 511 | 512 |
Field 242 | Type 244 | default 246 | Explanation 248 |
image 252 | struct 254 | 256 | Can’t be overridden 258 |

259 | Describes an image to be deployed. 260 |

261 | image section contains following: 262 |

    263 | 264 |
  1. name and tag 265 | 266 |
  2. Registry url where the image resides 267 | 268 |
  3. dockerfile or buildSpec fields 269 |
  4. 270 |
271 |
replicas 275 | int 277 | 1 279 | Optional 281 |

282 | Can be overridden 283 |

284 | Number of instances of the service i.e represents the number of instances of this service 285 | You can directly declare a integer like `replicas: 2` (default is 1) or by autoscaling setting (struct) 286 |

memory 290 | string 292 | 294 | Optional 296 |

297 | Can be overridden 298 |

299 | Specify the range 300 |

301 | [<minMemory>-]<maxMemory> 302 |

303 | Eg: 512m-1024m or 512m 304 |

cpu 308 | string 310 | 312 | Optional 314 |

315 | Can be overridden 316 |

317 | Specify the cpu range 318 |

319 | [<minCpu>-]<maxCpu> 320 |

321 | Eg: 60-80 or 50 322 |

startCommand 326 | string 328 | 330 | Optional 332 |

333 | Can't be overridden 334 |

    335 | 336 |
  • startCommand is a command which gets executed at the time of container start 337 | 338 |
  • it includes both ENTRYPOINT and CMD separated by space delimiter 339 | 340 |
  • User may refer to the runCommandsScript above in CMD 341 |
  • 342 |
343 |
external 347 | string 349 | false 351 | Optional 353 |

354 | 355 |

    356 | 357 |
  • Exposes the service externally. 358 | 359 |
  • External IP would be assigned for the service. 360 |
  • 361 |
362 |
ports 366 | list 368 | 370 | Can be overridden 372 |

373 | List of ports to be declared along healthcheck and ingressrules if any. 374 |

props 378 | list 380 | 382 | Optional 384 |

385 | Can be overridden 386 |

 387 | 
 388 | <keyName>:[<file/endpoint/string>(]<value>[)]
 389 | 
 390 | 
391 |
    392 | 393 |
  • List of key value pairs 394 | 395 |
  • Value is typed and can be of type: string, file, endpoint. 396 |
      397 |
    • if the value is file typed. utf-8 content of the file will be sent. 398 | 399 |
    • if the value is endpoint typed. service discovery name of the given service is passed as the value. 400 | 401 |
    • 402 |
    403 | 404 | 405 |
  • DEFAULT type is string 406 |
  • 407 |
408 |

409 | Eg: 410 |

 props:
 411 |    MAX_NO_OF_CONNECTIONS: STRING(10)
 412 |    MYSQL_HOST: ENDPOINT(mysql)
 413 |    KEY_FILE: FILE(/tmp/file.txt)
414 |
secrets 418 | list 420 | 422 | Optional 424 |

425 | Can be overridden 426 |

427 | 428 |

429 | List of secret key Names 430 | 431 | _Note: The secret should be pre-created by the k8s-admin in your namespace as appName-serviceName. 432 | The appName & serviceName should be normalized to lowercase & replace dot(.) as hyphen(-) ,space( ) as hyphen(-). 433 | Eg: appName=Sample, namespace=Sample dev results in secret of sample-sample-dev._ 434 | 435 |

436 | Eg: 437 |


 438 | secrets:
 439 | - "MYSQL_ROOT_PASSWORD"
 440 | 
 441 | 
442 |
volumes 446 | list 448 | 450 | Optional 452 |

453 | Can be overridden 454 |

455 | List of volumes to be specified in a pod. 456 |

agents 460 | list 462 | 464 | Optional 466 |

467 | Can be overridden 468 |

469 | List of sidecars to be attached to the pod. 470 |

k8sSnippetslistOptional 477 |

478 | Can be overridden 479 |

480 | List of k8s snippets that needs to be patched on the generated manifest files. 481 |

allowTraffic 486 | list 488 | 490 | Optional 492 |

493 | Can be overridden 494 |

495 | List to define what all services can connect to the service and to which ports 496 |

loadBalancer 500 | list 502 | 504 | Optional 506 |

507 | Can be overridden 508 |

509 | List to define routing rules and configurations for setting up a loadBalancer for the service. 510 |

513 | 514 | 515 | ### image 516 | 517 | Following are the fields of image section. 518 | 519 | 520 | 521 | 522 | 524 | 526 | 528 | 530 | 531 | 532 | 534 | 536 | 538 | 542 | 543 | 544 | 546 | 548 | 550 | 552 | 553 | 554 | 556 | 558 | 560 | 562 | 563 | 564 | 566 | 568 | 570 | 572 | 573 | 574 | 576 | 578 | 580 | 582 | 583 | 584 | 588 | 590 | 592 | 605 | 606 |
Field 523 | Type 525 | default 527 | Explanation 529 |
name 533 | string 535 | 537 | Name of the image to be built 539 |

540 | Note: retagging should be done for the already provided image 541 |

tag 545 | string 547 | latest 549 | Tag would be overridden if tagpolicy is mentioned 551 |
registry 555 | string 557 | docker.io/library 559 | registry url along with the namespace 561 |
buildSpec 565 | struct 567 | 569 | Optional generate Docker and build with local docker daemon 571 |
dockerfile 575 | struct 577 | 579 | Optional build with Dockerfile using local docker daemon 581 |
tagPolicy 585 |

586 | (future, currently unspecified) 587 |

struct 589 | sha256 591 | Optional 593 |

594 | Supports following tag policies 595 |

    596 | 597 |
  • Gitcommit 598 | 599 |
  • sha256 600 | 601 |
  • dateTime 602 |
  • 603 |
604 |
607 | 608 | 609 | #### Builders: 610 | 611 | Hyscale supports following to build your image: 612 | 613 | * hyscaleBuildSpec locally with Docker 614 | * Dockerfile with local docker 615 | 616 | > Note: 617 | Following additional building mechanisms can be supported in future:
618 | Dockerfile with kaniko in-cluster
619 | jib maven and gradle projects locally
620 | bazel locally
621 | Cloud-native build packs
622 | 623 | ## buildSpec 624 | 625 | HyscaleBuildSpec locally with Docker 626 | 627 | 628 | 629 | 631 | 633 | 635 | 637 | 638 | 639 | 641 | 643 | 645 | 647 | 648 | 649 | 651 | 653 | 655 | 657 | 658 | 659 | 661 | 663 | 665 | 667 | 668 | 669 | 671 | 673 | 675 | 677 | 678 | 679 | 681 | 683 | 685 | 687 | 688 | 689 | 691 | 693 | 695 | 697 | 698 |
Option 630 | Type 632 | default 634 | Explanation 636 |
stackImage 640 | string 642 | 644 | Stack indicates the base image on top of which artifacts and configuration is layered. 646 |
artifacts 650 | list 652 | 654 | Optional Represents the list of artifacts to be present inside the container at defined destinations. 656 |
configCommandsScript 660 | string 662 | 664 | Optional path-to-script relative or absolute path to a config-Commands script 666 |
configCommands 670 | list 672 | 674 | Optional Array of commands which is invoked during image build. The commands are also part of the image. 676 |
runCommandsScript 680 | string 682 | 684 | Optional path-to-script relative or absolute path to a run-Commands script 686 |
runCommands 690 | list 692 | 694 | Optional runCommand is a command which gets executed at the time of container start and is baked into the image 696 |
699 | 700 | 701 | ### stackImage 702 | 703 | ` 704 | stack: [/][:] 705 | ` 706 | 707 | * Stack indicates the base image on top of which artifacts and configuration is layered. 708 | * registryUrl is `optional`. 709 | * tag or digest is `optional`. latest is assumed. 710 | 711 | 712 | 713 | Eg: 714 | 715 | ```yaml 716 | stackImage: tomcat:8.5 717 | ``` 718 | 719 | ### artifacts 720 | 721 | > can be overridden 722 | 723 | ```yaml 724 | artifacts: 725 | - name: 726 | destination: 727 | provider: [ssh/http/local] # default local (ssh, http will be implemented in future versions) 728 | source: 729 | ``` 730 | 731 | 732 | #### Fields: 733 | 734 | 735 | 736 | 737 | 739 | 741 | 743 | 745 | 746 | 747 | 749 | 751 | 753 | 755 | 756 | 757 | 759 | 761 | 763 | 765 | 766 | 767 | 769 | 771 | 773 | 816 | 817 | 818 | 820 | 822 | 824 | 826 | 827 |
Option 738 | Type 740 | default 742 | Description 744 |
name 748 | string 750 | 752 | Name of the artifact 754 |
destination 758 | string 760 | 762 | Destination path to copy the artifact inside the container 764 |
provider 768 | string 770 | 772 | Optional type of provider. Could be one of: 774 |
    775 | 776 |
  • local 777 |
      778 | 779 |
    • Artifact available locally 780 | 781 |
    • Relative path to the artifact is expected in the source field 782 |
    • 783 |
    784 | 785 |
  • ssh 786 |
      787 | 788 |
    • Artifact available remotely 789 | 790 |
    • Accessible through ssh 791 | 792 |
    • Auth credentials can be mentioned in infrastructure spec 793 | 794 |
    • source is ssh url 795 |
    • 796 |
    797 | 798 |
  • http 799 |
      800 | 801 |
    • Artifact available remotely 802 | 803 |
    • Accessible through http 804 | 805 |
    • Auth credentials can be mentioned in infrastructure spec 806 | 807 |
    • Source is http url 808 | 809 |

      810 | 811 |

    • 812 |
    813 |
  • 814 |
815 |
source 819 | string 821 | 823 | Url to the artifact 825 |
828 | 829 | 830 | * List of artifacts to be copied inside the container image 831 | * Copies the artifact mentioned in sourcePath of local folder to destinationPath inside image 832 | * Artifact can be from one of the following sources: 833 | * local 834 | * Remote (like jfrog, jenkins etc..) 835 | 836 | ### configCommandsScript 837 | 838 | > Optional _string type_ 839 | 840 | * Path to a Script containing config commands. 841 | * It is mutually exclusive with configCommands field. 842 | * If configCommands is given and not empty configCommandsScript has no effect. 843 | 844 | ### runCommandsScript 845 | 846 | > Optional _string type_ 847 | 848 | 849 | 850 | * Path to a Script containing runConfig commands. 851 | * It is mutually exclusive with runCommands field. 852 | * If runCommands is given and not empty runCommandsScript has no effect. 853 | 854 | ### dockerfile 855 | 856 | Use local docker to build docker image with the given Dockerfile 857 | 858 | ```yaml 859 | dockerfile: 860 | target: 861 | path: # Optional buildcontext path 862 | dockerfilePath: # Optional path to Dockerfile 863 | useBuildKit: # use buildKit for building (will be implemented in future versions) 864 | buildArgs: 865 | - 866 | [- ] 867 | . 868 | . 869 | [- ] 870 | ``` 871 | 872 | 873 | 874 | 876 | 878 | 880 | 882 | 883 | 884 | 886 | 888 | 890 | 892 | 893 | 894 | 896 | 898 | 900 | 902 | 903 | 904 | 906 | 908 | 910 | 912 | 913 | 914 | 916 | 918 | 920 | 922 | 923 | 924 | 926 | 928 | 930 | 932 | 933 |
Option 875 | Type 877 | default 879 | Explanation 881 |
path 885 | string 887 | ./ 889 | Optional buildContext for docker build 891 |
dockerfilePath 895 | string 897 | ./Dockerfile 899 | Optional dockerfile path with in the build context 901 |
target 905 | string 907 | 909 | Optional target stage to be built 911 |
useBuildKit 915 | boolean 917 | 919 | Optional Use buildkit (will be implemented in future versions) 921 |
buildArgs 925 | list 927 | 929 | Optional List of build arguments to be passed 931 |
934 | 935 | 936 | Eg: 937 | 938 | ```yaml 939 | dockerfile: 940 | path: ./ 941 | dockerfilePath: Dockerfile.build 942 | target: finalstage 943 | useBuildKit: false 944 | buildArgs: 945 | - foo=value1 946 | - bar=value2 947 | ``` 948 | 949 | ### ports 950 | 951 | List of port objects. 952 | 953 | ```yaml 954 | ports: 955 | - port: [/] 956 | healthCheck: 957 | httpPath: # optional if not http type 958 | 959 | [- port: /] 960 | ``` 961 | 962 | **Port Object contains:** 963 | 964 | * Port to be declared in a pod 965 | * A portType can be any one of (tcp, TCP, udp, UDP, http, HTTP, https, HTTPS) 966 | * Healthcheck if available for the port to be specified along with the port definition 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 |
port - typeIs Healthcheck path definedHealthCheck is performed on
TCPtrueHTTP
TCPfalseTCP
HTTPtrueHTTP
HTTPfalseTCP
HTTPStrueHTTPS
HTTPSfalseTCP
1005 | 1006 | 1007 | > Note: 1008 | Currently Health Check would be present for only one port if any. If there are multiple healthChecks declared first healthCheck will be picked. 1009 | 1010 | Following are the **Fields** of Port object: 1011 | 1012 | 1013 | 1014 | 1015 | 1017 | 1019 | 1021 | 1023 | 1024 | 1025 | 1027 | 1029 | 1031 | 1038 | 1039 | 1040 | 1042 | 1044 | 1046 | 1085 | 1086 | 1087 |
Option 1016 | Type 1018 | default 1020 | Explanation 1022 |
port 1026 | string 1028 | 1030 | <portNumber>[/<portType>] 1032 |
    1033 |
  • portNumber Port Number to be declared in pod 0-65535 1034 |
  • portType tcp/udp 1035 |
  • 1036 |
1037 |
healthCheck 1041 | struct 1043 | http incase healthCheckPath is given, tcp if nothing given 1045 | Optional 1047 |
1048 | healthCheck:
1049 |     type: <tcp/http/udp> # optional type of health check (will be implemented in future versions)
1050 |     httpPath: <httpPath> # optional if not type: http 
1051 | 
1052 |

1053 | type 1054 |

1055 | type string Optional 1056 |

1057 | Type of HealthCheck for the specified port 1058 |

    1059 | 1060 |
  • tcp 1061 | 1062 |
  • http 1063 | 1064 |

    1065 | http incase httpPath is given, tcp if nothing given 1066 |

    1067 | Note: exec/command healthchecks should be mentioned in a separate section 1068 |

  • 1069 |
1070 |

1071 | httpPath 1072 |
1073 | type string Optional 1074 |
1075 | http Path for http health check 1076 |
1077 | 1078 | Eg: 1079 |
1080 |

1081 | healthcheck:
1082 |     httpPath: /hmrs 
1083 | 
1084 |
1088 | 1089 | 1090 | Eg: 1091 | 1092 | ```yaml 1093 | ports: 1094 | - port: 8080/TCP 1095 | healthCheck: 1096 | httpPath: "/hrms" # optional 1097 | - port: 8008/TCP 1098 | ``` 1099 | ### volumes 1100 | 1101 | List of volume Objects. 1102 | 1103 | ```yaml 1104 | volumes:# optional can be inferred from docker inspection and default 2 GB + default sc 1105 | - name: 1106 | path: 1107 | [size: ] 1108 | ``` 1109 | 1110 | **volume Object contains:** 1111 | 1112 | * name - volume name 1113 | * path - mount Path inside container 1114 | * size - volume size to provision using environment defined storage class. 1115 | 1116 | ` 1117 | Note: 1118 | volumes referring other volumes is _future, currently unspecified_ 1119 | ` 1120 | 1121 | Following are the **Fields** in volume object 1122 | 1123 | 1124 | 1125 | 1127 | 1129 | 1131 | 1133 | 1134 | 1135 | 1137 | 1139 | 1141 | 1149 | 1150 | 1151 | 1153 | 1155 | 1157 | 1161 | 1162 | 1163 | 1165 | 1167 | 1169 | 1177 | 1178 |
Option 1126 | Type 1128 | default 1130 | Explanation 1132 |
name 1136 | string 1138 | 1140 | Name of volume 1142 |

1143 | should be up to maximum length of 253 characters and consist of lower case alphanumeric characters, -, and ., but certain resources have more specific restrictions. 1144 |

1145 | Eg: 1146 |

1147 | name: logsDirectory 1148 |

path 1152 | string 1154 | 1156 | Mount Path of the volume inside container 1158 |

1159 | Eg: path: /usr/local/tomcat/logs 1160 |

size 1164 | string 1166 | 1Gi 1168 | Optional 1170 |

1171 | Size of volume to be provisioned 1172 |

1173 | Makes use of environment tied kubernetes storage class to provision volume. 1174 |

1175 | Eg: size: 1Gi 1176 |

1179 | 1180 | 1181 | Eg: 1182 | 1183 | 1184 | ```yaml 1185 | volumes: 1186 | - name: tomcat-logs 1187 | path: /usr/local/content/tomcat/current/logs 1188 | size: 1Gi 1189 | 1190 | - name: data 1191 | path: /usr/local/content/tomcat/current/webapps 1192 | ``` 1193 | 1194 | ### replicas 1195 | 1196 | Autoscaling Setting. 1197 | 1198 | 1199 | *Note : Autoscaling will be effective only if cpu is specified* 1200 | 1201 | ```yaml 1202 | replicas: 1203 | min: # minimum number of instances to start (default is 1) 1204 | max: # maximum number of instances 1205 | cpuThreshold: # Average pod cpu utilization threshold as percent that will cause a scale event 1206 | ``` 1207 | 1208 | ### agents 1209 | 1210 | List of agent (aka sidecar) objects. 1211 | 1212 | ```yaml 1213 | agents: 1214 | - name: 1215 | image: 1216 | props: 1217 | - "=()" 1218 | [- "=()"] 1219 | volumes: 1220 | - mountPath: 1221 | attach: 1222 | [- mountPath: 1223 | attach: ] 1224 | secrets: # Secrets accept both list of keys & key value pairs 1225 | - # Incase of list, secret should be created prior as - 1226 | - # - : 1227 | # - : 1228 | - # - : 1229 | secretsVolumePath: 1230 | propsVolumePath: 1231 | ports: 1232 | - port: [/] # default type is tcp 1233 | healthCheck: 1234 | httpPath: # default is false 1235 | 1236 | [- port: /] 1237 | 1238 | ``` 1239 | 1240 | **agent Object contains:** 1241 | 1242 | * name - name of sidecar attachment 1243 | * image - sidecar image full name 1244 | * props - list of env including secrets 1245 | * volumes - list of volumes 1246 | * secrets - list of secrets 1247 | * ports - list of ports 1248 | 1249 | Following are the **Fields** in agent object 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1293 | 1295 | 1297 | 1315 | 1316 | 1317 | 1318 | 1319 | 1320 | 1321 | 1322 |
Option Type default Explanation
name string Name of sidecar Attachment

should be up to maximum length of 253 characters and consist of lower case alphanumeric characters, -, and ., but certain resources have more specific restrictions.

Eg:

name: fluentd

image string sidecar with version

Eg:

sidecar: fluentd:5.6

props list 2 Optional

=[(][)]

    1275 | 1276 |
  • List of key value pairs 1277 | 1278 |
  • Value is typed and can be of type: string, file, endpoint 1279 | 1280 |
  • DEFAULT type is string 1281 | 1282 |

    Eg:

    props:

    - "FLUENTD_ARGS=--no-supervisor -vv"

    - "system.input.conf=file(/system.input.conf)"

    - "output.conf=file(/tmp/output.conf)"

volumes list List of volumes to be declared for a sidecar
secrets 1292 | list 1294 | 1296 | Optional Can be overridden 1298 |

1299 | 1300 |

1301 | List of secret key Names 1302 | 1303 | _Note: The secret should be pre-created by the k8s-admin in your namespace as appName-serviceName. 1304 | The appName & serviceName should be normalized to lowercase & replace dot(.) as hyphen(-) ,space( ) as hyphen(-). 1305 | Eg: appName=Sample, namespace=Sample dev results in secret of sample-sample-dev._ 1306 | 1307 |

1308 | Eg: 1309 |


1310 | secrets:
1311 | - "MYSQL_ROOT_PASSWORD"
1312 | 
1313 | 
1314 |
ports list List of ports to be declared for a sidecar
1323 | 1324 | ### k8sSnippets 1325 | 1326 | List of k8s snippets that needs to be patched on the generated manifest files. 1327 | 1328 | ```yaml 1329 | k8sSnippets: 1330 | - <"path-to-customSnippetFile1"> # Relative path to the k8s snippet is expected here 1331 | - [<"path-to-customSnippetFile2">] 1332 | . 1333 | . 1334 | - [<"path-to-customSnippetFileN">] 1335 | ``` 1336 | 1337 | ### allowTraffic 1338 | 1339 | > can be overridden 1340 | 1341 | Provides list of other services that can connect to the ports in this service. If the service is external, allowTraffic rules cannot be specified. 1342 | 1343 | Traffic rules when defined in profile file will replace the rules defined in service spec 1344 | 1345 | ```yaml 1346 | allowTraffic: # External should be false 1347 | -ports: 1348 | -[/] # Should be available in the service spec 1349 | [-/port-type] # Default type is tcp 1350 | from: 1351 | - # Other services that can connect to this service 1352 | [-] 1353 | ``` 1354 | 1355 | 1356 | 1357 | 1359 | 1361 | 1363 | 1364 | 1365 | 1367 | 1369 | 1371 | 1372 | 1373 | 1375 | 1377 | 1379 | 1380 |
Option 1358 | Type 1360 | Explanation 1362 |
ports 1366 | string 1368 | Optional Service ports which are accessible 1370 |
from 1374 | string 1376 | Optional services which can access this service 1378 |
1381 | 1382 | Eg: In this case hrdatabase service can only connect to the service at port 80 or 81. No other service can connect in such case. 1383 | 1384 | ```yaml 1385 | allowTraffic: 1386 | -ports: 1387 | -80/tcp 1388 | -81/https 1389 | from: 1390 | -hrdatabase 1391 | ``` 1392 | ### loadBalancer 1393 | 1394 | List to define routing rules and configurations for setting up a loadBalancer for the service. 1395 | 1396 | ```yaml 1397 | loadBalancer: 1398 | - provider: 1399 | - className: 1400 | - host: 1401 | - sticky: 1402 | - tlsSecret: 1403 | - mapping: 1404 | - port: [/] 1405 | contextPaths: 1406 | - 1407 | [-] 1408 | - headers: 1409 | : 1410 | [: ] 1411 | . 1412 | [: ] 1413 | - labels: 1414 | : 1415 | [: ] 1416 | . 1417 | [: ] 1418 | 1419 | ``` 1420 | 1421 | Following are the **Fields** in loadBalancer object 1422 | 1423 | 1424 | 1425 | 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | 1441 | 1442 | 1443 | 1444 | 1445 | 1447 | 1448 | 1449 | 1450 | 1451 | 1452 | 1453 | 1454 | 1455 | 1457 | 1459 | 1461 | 1467 | 1468 | 1469 | 1470 | 1471 | 1472 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | 1483 | 1485 | 1486 |
Option Type default Explanation
provider string Defines the name of the loadBalancer provider.
className string Defines the name of the Ingress class
host String

Defines the name of the host

Ex) host: domain-name.com 1446 |

sticky boolean false Enable/Disable Session stickiness
tlsSecret 1456 | String 1458 | 1460 | 1462 |

1463 | 1464 |

1465 | Define TLS Secret name 1466 |

mapping Struct Defines paths mappings for various ports of the service

headers Map Defines the headers for the LB resource
labels Map

Defines the labels for the LB resource 1484 |

1487 | 1488 | ### Spec Template File 1489 | 1490 | > will be implemented in future versions 1491 | 1492 | For Off-the-Shelf (OTS) services as well as for commonly used configurations of known services, spec template files could be made available as a starting point. Once a spec template is downloaded for use, it can be extended to create a service spec (hspec) in order to override commonly specified configurations. 1493 | 1494 | For example, a mysql spec template may include things like 3306 for ports, `/var/lib/mysql/` as a volume path, etc. Anyone extending this template to create their hspec may wish to override things like the password secret, etc. 1495 | 1496 | The following rules apply to a spec template: 1497 | 1498 | 1. Spec templates are valid YAML files. 1499 | 2. Spec template end with the extension `htpl.yaml` 1500 | 3. A template file must include a `name` and `version` attribute. Name is same as in the filename of the template. Name & version would be used in the hspec which extends. 1501 | 4. The filename of the spec template should be same as the service name + version. Eg. `-.htpl.yaml` 1502 | 5. A template file may include any of the fields that a regular hspec can have, except as per the following. 1503 | 6. A template file cannot include: 1504 | 1. buildSpec & dockerSpec 1505 | 2. external 1506 | 1507 | ``` 1508 | NOTE: Consideration for future versions of spec templates: 1509 | a. Spec Templates as bundles (htpl.tar) 1510 | b. This enables things like artifacts, dockerfiles, config files, etc. to be included in the htpl bundle. 1511 | c. This will enable support for buildSpec and dockerSpec. 1512 | d. The bundle could be name.htpl.tar which expands and should mandatorily include name.htpl.yaml 1513 | e. Allow remote spec template repositories & corresponding spec 1514 | ``` 1515 | 1516 | 1517 | ## Extending a Spec Template 1518 | > (htpl) into a Service Spec (hspec) 1519 | 1520 | In a service spec, use the `extends` field as follows: 1521 | 1522 | ` 1523 | extends: : 1524 | ` 1525 | In the hspec, any **props, secrets, volumes, ports** specified are merged or overridden if having same keyname. 1526 | 1527 | `image` is overridden if specified in hspec, and the `image` given in the htpl is used as stack image within the buildSpec. 1528 | 1529 | 1530 | ``` 1531 | Future versions may support: 1532 | Specifying a remote URL in the extends field 1533 | `$remove: ` in the hspec in order to skip that key & corresponding sub-tree from the htpl 1534 | Consider extending multiple htpl files in a single hspec file 1535 | ``` 1536 | 1537 | 1538 | 1539 | ## Profile Files 1540 | 1541 | In order to deploy a service into different environments (such as QA, Stage, UAT, etc.), it maybe necessary to override certain fields to customize as per that environment. This is supported by the use of profile files. 1542 | 1543 | A profile file may override a spec file by specifying the following: 1544 | 1545 | ```yaml 1546 | environment: 1547 | overrides: 1548 | ``` 1549 | 1550 | Profile files should be `-.hprof` 1551 | 1552 | For example, `dev` profile for service spec `web.hspec` would be `dev-web.hprof` 1553 | 1554 | The following fields of service spec can be overridden or additionally specified (merged) in a profile file: 1555 | 1556 | **props, secrets, replicas, resource-limits, size of volumes, allowTraffic. 1557 | 1558 | _(overrides if same keyname)_ 1559 | 1560 | ### Reference Profile File with all options 1561 | 1562 | ```yaml 1563 | 1564 | environement: 1565 | overrides: 1566 | 1567 | memory: [-] # overrides the range of memory defined in the service spec 1568 | cpu: [-] # overrides the range of cpu defined in the service spec 1569 | 1570 | replicas: # overrides the no of replicas defined in the service spec 1571 | 1572 | volumes: 1573 | - name: 1574 | [size: ] # overrides the size of volumes defined in the service spec 1575 | [storageClass: ] 1576 | 1577 | props: # overrides the prop values which are defined in the service spec 1578 | : [(][)] 1579 | [: ] 1580 | . 1581 | [: ] 1582 | 1583 | secrets: # overrides the secret values which are defined in the service spec 1584 | - : 1585 | - : 1586 | 1587 | - : 1588 | 1589 | allowTraffic: # Will override allowTraffic rules of service spec 1590 | - ports: 1591 | - # Should be available in the service spec 1592 | [-] 1593 | from: 1594 | - # Other services that can connect to this service 1595 | [-] 1596 | loadBalancer: 1597 | - provider: 1598 | - className: 1599 | - host: 1600 | - sticky: # default is false 1601 | - tlsSecret: 1602 | - mapping: 1603 | - port: [/] # Should be available in service spec 1604 | contextPaths: 1605 | - # Path mappings for the defined port 1606 | [-] 1607 | - headers: 1608 | : 1609 | [: ] 1610 | . 1611 | [: ] 1612 | - labels: 1613 | : 1614 | [: ] 1615 | . 1616 | [: ] 1617 | ``` 1618 | 1619 | ### Example of a Profile file 1620 | 1621 | dev-hrms-frontend.hprof 1622 | 1623 | ```yaml 1624 | 1625 | environment: dev 1626 | overrides: hrms-frontend 1627 | 1628 | cpu: 512Mi 1629 | replicas: 2 1630 | props: 1631 | max_threads: 20 1632 | server_xml: file(./config/tomcat/server.xml) 1633 | 1634 | volumes: 1635 | - name: logs 1636 | size: 2Gi 1637 | 1638 | ``` 1639 | 1640 | stage-hrms-frontend.hprof 1641 | ```yaml 1642 | 1643 | environment: stage 1644 | overrides: hrms-frontend 1645 | 1646 | cpu: 768Mi 1647 | replicas: 3 1648 | 1649 | props: 1650 | max_threads: 10 1651 | server_xml: file(./config/tomcat/server.xml) 1652 | 1653 | volumes: 1654 | - name: logs 1655 | size: 4Gi 1656 | 1657 | ``` 1658 | 1659 | 1660 | ``` 1661 | Future versions may support: 1662 | Disabling of healthChecks using an additional field in the relevant section such as: 1663 | $disable: true 1664 | ``` 1665 | --------------------------------------------------------------------------------