diff --git a/README.md b/README.md index 70bac0d..c07f21f 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,13 @@ api: version: "2.1.4" replicaCount: "1" serviceType: "ClusterIP" + resources: #Optional + limits: + cpu: 500m + memory: 1024Mi + requests: + cpu: 200m + memory: 256Mi properties: databaseType: "SQL_AZURE" # Replace with "H2" (ONLY FOR TESTING), "SQL_AZURE", "POSTGRESQL" or "MYSQL" databaseHostname: "mysuperdatabse.database.windows.net" # Replace with the real value @@ -101,6 +108,13 @@ executor: version: "1.5.4" replicaCount: "1" serviceType: "ClusterIP" + resources: #Optional + limits: + cpu: 1000m + memory: 1024Mi + requests: + cpu: 500m + memory: 256Mi properties: toolsRepository: "https://github.com/AzBuilder/terrakube-extensions" # Default extension repository toolsBranch: "main" #Default branch for extensions @@ -113,6 +127,13 @@ registry: version: "2.1.4" replicaCount: "1" serviceType: "ClusterIP" + resources: #Optional + limits: + cpu: 500m + memory: 1024Mi + requests: + cpu: 200m + memory: 256Mi ## UI Properties ui: @@ -120,6 +141,13 @@ ui: version: "0.5.0" replicaCount: "1" serviceType: "ClusterIP" + resources: + limits: + cpu: 500m + memory: 512Mi + requests: + cpu: 200m + memory: 256Mi ## Ingress properties ingress: @@ -132,7 +160,6 @@ ingress: annotations: # This annotations can change based on requirements. The followin is an example using nginx ingress and lets encrypt kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/enable-cors: "true" cert-manager.io/cluster-issuer: letsencrypt api: enabled: true @@ -142,7 +169,6 @@ ingress: annotations: # This annotations can change based on requirements. The followin is an example using nginx ingress and lets encrypt kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/enable-cors: "true" nginx.ingress.kubernetes.io/rewrite-target: /$2 nginx.ingress.kubernetes.io/configuration-snippet: "proxy_set_header Authorization $http_authorization;" cert-manager.io/cluster-issuer: letsencrypt @@ -154,7 +180,6 @@ ingress: annotations: # This annotations can change based on requirements. The followin is an example using nginx ingress and lets encrypt kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/enable-cors: "true" cert-manager.io/cluster-issuer: letsencrypt ``` diff --git a/templates/deployment-api.yaml b/templates/deployment-api.yaml index d2d40d2..7d5528a 100644 --- a/templates/deployment-api.yaml +++ b/templates/deployment-api.yaml @@ -18,6 +18,9 @@ spec: containers: - name: terrakube-api image: azbuilder/api-server:{{ .Values.api.version }} + {{- if .Values.api.resources }} + resources: {{- toYaml .Values.api.resources | nindent 12 }} + {{- end }} ports: - containerPort: 8080 envFrom: diff --git a/templates/deployment-executor.yaml b/templates/deployment-executor.yaml index 53c3de5..44b967d 100644 --- a/templates/deployment-executor.yaml +++ b/templates/deployment-executor.yaml @@ -18,6 +18,9 @@ spec: containers: - name: terrakube-executor image: azbuilder/executor:{{ .Values.executor.version }} + {{- if .Values.executor.resources }} + resources: {{- toYaml .Values.executor.resources | nindent 12 }} + {{- end }} ports: - containerPort: 8090 envFrom: diff --git a/templates/deployment-registry.yaml b/templates/deployment-registry.yaml index dc09b25..0f02bd8 100644 --- a/templates/deployment-registry.yaml +++ b/templates/deployment-registry.yaml @@ -18,6 +18,9 @@ spec: containers: - name: terrakube-registry image: azbuilder/open-registry:{{ .Values.registry.version }} + {{- if .Values.registry.resources }} + resources: {{- toYaml .Values.registry.resources | nindent 12 }} + {{- end }} ports: - containerPort: 8075 envFrom: diff --git a/templates/deployment-ui.yaml b/templates/deployment-ui.yaml index 22c6a63..88c065c 100644 --- a/templates/deployment-ui.yaml +++ b/templates/deployment-ui.yaml @@ -18,6 +18,9 @@ spec: containers: - name: terrakube-ui image: azbuilder/terrakube-ui:{{ .Values.ui.version }} + {{- if .Values.ui.resources }} + resources: {{- toYaml .Values.ui.resources | nindent 12 }} + {{- end }} ports: - containerPort: 8080 envFrom: diff --git a/values.schema.json b/values.schema.json index 5b7f2f9..4b58abb 100644 --- a/values.schema.json +++ b/values.schema.json @@ -81,6 +81,9 @@ "description": "Kubernetes service type", "enum": ["ClusterIP", "NodePort", "LoadBalancer", "ExternalName"] }, + "resources": { + "type": "object" + }, "properties": { "type": "object", "required": ["databaseType", "databaseHostname", "databaseName", "databaseUser", "databasePassword"], @@ -129,6 +132,9 @@ "description": "Kubernetes service type", "enum": ["ClusterIP", "NodePort", "LoadBalancer", "ExternalName"] }, + "resources": { + "type": "object" + }, "properties": { "type": "object", "required": ["toolsRepository", "toolsBranch"], @@ -172,6 +178,9 @@ "serviceType": { "description": "Kubernetes service type", "enum": ["ClusterIP", "NodePort", "LoadBalancer", "ExternalName"] + }, + "resources": { + "type": "object" } } }, @@ -194,6 +203,9 @@ "serviceType": { "description": "Kubernetes service type", "enum": ["ClusterIP", "NodePort", "LoadBalancer", "ExternalName"] + }, + "resources": { + "type": "object" } } }, diff --git a/values.yaml b/values.yaml index 30a42db..04d7672 100644 --- a/values.yaml +++ b/values.yaml @@ -23,6 +23,7 @@ api: version: "" replicaCount: "" serviceType: "" + resources: {} properties: databaseType: "" databaseHostname: "" @@ -36,6 +37,7 @@ executor: version: "" replicaCount: "" serviceType: "" + resources: {} properties: toolsRepository: "https://github.com/AzBuilder/terrakube-extensions" toolsBranch: "main" @@ -48,6 +50,7 @@ registry: version: "" replicaCount: "" serviceType: "" + resources: {} ## UI Properties ui: @@ -55,6 +58,7 @@ ui: version: "" replicaCount: "" serviceType: "" + resources: {} ## Ingress properties ingress: