From 39efdbdc5bb0c566a1c37c2e86abde6bb109a8e2 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 5 Feb 2026 15:57:07 +0530 Subject: [PATCH 01/29] Initial Helm charts for openshift Signed-off-by: Chandrakala Subramanyam --- charts/kruize/Chart.yaml | 28 +++ charts/kruize/LICENSE | 201 ++++++++++++++++++ charts/kruize/README.md | 3 + charts/kruize/templates/_helpers.tpl | 71 +++++++ charts/kruize/templates/configmap-kruize.yaml | 81 +++++++ charts/kruize/templates/configmap-nginx.yaml | 32 +++ charts/kruize/templates/cronjobs.yaml | 95 +++++++++ .../templates/kruize-db-deployment.yaml | 49 +++++ .../kruize/templates/kruize-db-service.yaml | 17 ++ .../kruize/templates/kruize-deployment.yaml | 61 ++++++ charts/kruize/templates/kruize-service.yaml | 21 ++ .../kruize/templates/kruize-ui-nginx-pod.yaml | 25 +++ .../templates/kruize-ui-nginx-service.yaml | 15 ++ charts/kruize/templates/role.yaml | 64 ++++++ charts/kruize/templates/rolebinding.yaml | 70 ++++++ charts/kruize/templates/service-account.yaml | 12 ++ charts/kruize/templates/service-monitor.yaml | 22 ++ charts/kruize/templates/storage-pv.yaml | 19 ++ charts/kruize/templates/storage-pvc.yaml | 16 ++ .../templates/tests/test-connection.yaml | 16 ++ charts/kruize/values.yaml | 190 +++++++++++++++++ 21 files changed, 1108 insertions(+) create mode 100644 charts/kruize/Chart.yaml create mode 100644 charts/kruize/LICENSE create mode 100644 charts/kruize/README.md create mode 100644 charts/kruize/templates/_helpers.tpl create mode 100644 charts/kruize/templates/configmap-kruize.yaml create mode 100644 charts/kruize/templates/configmap-nginx.yaml create mode 100644 charts/kruize/templates/cronjobs.yaml create mode 100644 charts/kruize/templates/kruize-db-deployment.yaml create mode 100644 charts/kruize/templates/kruize-db-service.yaml create mode 100644 charts/kruize/templates/kruize-deployment.yaml create mode 100644 charts/kruize/templates/kruize-service.yaml create mode 100644 charts/kruize/templates/kruize-ui-nginx-pod.yaml create mode 100644 charts/kruize/templates/kruize-ui-nginx-service.yaml create mode 100644 charts/kruize/templates/role.yaml create mode 100644 charts/kruize/templates/rolebinding.yaml create mode 100644 charts/kruize/templates/service-account.yaml create mode 100644 charts/kruize/templates/service-monitor.yaml create mode 100644 charts/kruize/templates/storage-pv.yaml create mode 100644 charts/kruize/templates/storage-pvc.yaml create mode 100644 charts/kruize/templates/tests/test-connection.yaml create mode 100644 charts/kruize/values.yaml diff --git a/charts/kruize/Chart.yaml b/charts/kruize/Chart.yaml new file mode 100644 index 0000000..2bda1eb --- /dev/null +++ b/charts/kruize/Chart.yaml @@ -0,0 +1,28 @@ +apiVersion: v2 +name: kruize +description: Optimize resources used by your containerized workloads + +appVersion: "0.8.1" +home: "https://kruize.io" +icon: "https://raw.githubusercontent.com/kruize/kruize-helm/main/docs/images/kruize-icon.png" + +type: application +version: "0.1.0" + +keywords: +- containers +- monitoring +- performance +kubeVersion: '>= 1.25.0-0' + +sources: +- https://github.com/kruize/autotune +- https://github.com/kruize/kruize-ui + +maintainers: +- name: Dinakar Guniguntala + url: https://github.com/dinogun +- name: Chandrakala Subramanyam + url: https://github.com/chandrams + + diff --git a/charts/kruize/LICENSE b/charts/kruize/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/charts/kruize/LICENSE @@ -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. diff --git a/charts/kruize/README.md b/charts/kruize/README.md new file mode 100644 index 0000000..4ca5090 --- /dev/null +++ b/charts/kruize/README.md @@ -0,0 +1,3 @@ +# Kruize Helm Chart + +A Helm chart for deploying Kruize on OpenShift diff --git a/charts/kruize/templates/_helpers.tpl b/charts/kruize/templates/_helpers.tpl new file mode 100644 index 0000000..d3ed9e2 --- /dev/null +++ b/charts/kruize/templates/_helpers.tpl @@ -0,0 +1,71 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "kruize.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 "kruize.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 "kruize.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels. +*/}} +{{- define "kruize.labels" -}} +helm.sh/chart: {{ include "kruize.chart" . }} +{{ include "kruize.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels. +*/}} +{{- define "kruize.selectorLabels" -}} +app.kubernetes.io/name: {{ include "kruize.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use. +*/}} +{{- define "kruize.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "kruize.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Get the name for managed deployments. +*/}} +{{- define "kruize.deploymentName" -}} +{{- $version := semver .Chart.AppVersion -}} +{{- printf "%s-v%d" (include "kruize.fullname" .) $version.Major -}} +{{- end -}} + diff --git a/charts/kruize/templates/configmap-kruize.yaml b/charts/kruize/templates/configmap-kruize.yaml new file mode 100644 index 0000000..6126333 --- /dev/null +++ b/charts/kruize/templates/configmap-kruize.yaml @@ -0,0 +1,81 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $fullName }}-config + namespace: {{ .Release.Namespace }} +data: + dbconfigjson: | + { + "database": { + "adminPassword": {{ .Values.db.adminPassword }}, + "adminUsername": {{ .Values.db.adminUser }}, + "hostname": "{{ $fullName }}-db-service", + "name": {{ printf "%s-%s" .Values.db.name $fullName | quote }}, + "password": {{ .Values.db.password }}, + "port": {{ .Values.db.service.port }}, + "sslMode": {{ .Values.db.sslMode }}, + "username": {{ .Values.db.user }} + } + } + kruizeconfigjson: | + { + "clustertype": {{ .Values.kruize.config.clusterType }}, + "k8stype": {{ .Values.kruize.config.k8sType }}, + "authtype": {{ .Values.kruize.config.authType | quote }}, + "monitoringagent": {{ .Values.kruize.config.monitoringAgent }}, + "monitoringservice": {{ .Values.kruize.config.monitoringService }}, + "monitoringendpoint": {{ .Values.kruize.config.monitoringEndPoint }}, + "savetodb": {{ .Values.kruize.config.saveToDB }}, + "dbdriver": {{ .Values.kruize.config.dbDriver | quote }}, + "plots": {{ .Values.kruize.config.plots }}, + "isROSEnabled": {{ .Values.kruize.config.isROSEnabled }}, + "local": {{ .Values.kruize.config.local }}, + "logAllHttpReqAndResp": {{ .Values.kruize.config.logAllHttpReqAndResp }}, + "recommendationsURL" : {{ printf "http://%s.%s.svc.cluster.local:8080/generateRecommendations?experiment_name=%%s" $fullName .Release.Namespace | quote }}, + "experimentsURL" : {{ printf "http://%s.%s.svc.cluster.local:8080/createExperiment" $fullName .Release.Namespace | quote }}, + "experimentNameFormat" : {{ .Values.kruize.config.experimentNameFormat | quote }}, + "bulkapilimit" : {{ .Values.kruize.config.bulkapilimit }}, + "isKafkaEnabled" : {{ .Values.kruize.config.isKafkaEnabled }}, + "hibernate": { + "dialect": {{ .Values.kruize.config.hibernate.dialect | quote }}, + "driver": {{ .Values.kruize.config.hibernate.driver | quote }}, + "c3p0minsize": {{ .Values.kruize.config.hibernate.c3p0minsize }}, + "c3p0maxsize": {{ .Values.kruize.config.hibernate.c3p0maxsize }}, + "c3p0timeout": {{ .Values.kruize.config.hibernate.c3p0timeout }}, + "c3p0maxstatements": {{ .Values.kruize.config.hibernate.c3p0maxstatements }}, + "hbm2ddlauto": {{ .Values.kruize.config.hibernate.hbm2ddlauto | quote }}, + "showsql": {{ .Values.kruize.config.hibernate.showsql | quote}}, + "timezone": {{ .Values.kruize.config.hibernate.timezone | quote }} + }, + "logging" : { + "cloudwatch": { + "accessKeyId": {{ .Values.kruize.config.logging.cloudwatch.accessKeyId | quote }}, + "logGroup": {{ .Values.kruize.config.logging.cloudwatch.logGroup }}, + "logStream": {{ .Values.kruize.config.logging.cloudwatch.logStream }}, + "region": {{ .Values.kruize.config.logging.cloudwatch.region | quote }}, + "secretAccessKey": {{ .Values.kruize.config.logging.cloudwatch.secretAccessKey | quote }}, + "logLevel": {{ .Values.kruize.config.logging.cloudwatch.logLevel }} + } + }, + + "datasource": [ + {{- range $index, $element := .Values.kruize.config.datasource }} + {{- if $index }},{{ end }} + { + "name": {{ $element.name | quote }}, + "provider": {{ $element.provider | quote }}, + "serviceName": {{ $element.serviceName | quote }}, + "namespace": {{ $element.namespace | quote }}, + "url": {{ $element.url | quote }}, + "authentication": { + "type": {{ $element.authentication.type | quote }}, + "credentials": { + "tokenFilePath": {{ $element.authentication.credentials.tokenFilePath | quote }} + } + } + } + {{- end }} + ] + } diff --git a/charts/kruize/templates/configmap-nginx.yaml b/charts/kruize/templates/configmap-nginx.yaml new file mode 100644 index 0000000..1e00801 --- /dev/null +++ b/charts/kruize/templates/configmap-nginx.yaml @@ -0,0 +1,32 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ $fullName }}-nginx-config + namespace: {{ .Release.Namespace }} +data: + nginx.conf: | + events {} + http { + upstream kruize-api { + server {{ $fullName }}:8080; + } + + server { + listen 8080; + server_name localhost; + + root /usr/share/nginx/html; + + location ^~ /api/ { + rewrite ^/api(.*)$ $1 break; + proxy_pass http://kruize-api; + } + + location / { + index index.html; + error_page 404 =200 /index.html; + } + } + } diff --git a/charts/kruize/templates/cronjobs.yaml b/charts/kruize/templates/cronjobs.yaml new file mode 100644 index 0000000..54334ce --- /dev/null +++ b/charts/kruize/templates/cronjobs.yaml @@ -0,0 +1,95 @@ +{{- $fullName := include "kruize.fullname" . -}} +{{- $image := .Values.kruize.image -}} +{{- $namespace := .Release.Namespace -}} + +{{- $loggingLevel := "info" -}} +{{- $dbConfigFile := "" -}} +{{- $kruizeConfigFile := "" -}} + +{{- range .Values.kruize.env -}} + {{- if eq .name "LOGGING_LEVEL" -}} + {{- $loggingLevel = .value -}} + {{- end -}} + {{- if eq .name "DB_CONFIG_FILE" -}} + {{- $dbConfigFile = .value -}} + {{- end -}} + {{- if eq .name "KRUIZE_CONFIG_FILE" -}} + {{- $kruizeConfigFile = .value -}} + {{- end -}} +{{- end -}} +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ .Release.Name }}-create-partition + namespace: {{ $namespace }} +spec: + schedule: "0 0 25 * *" # Run on 25th of every month at midnight + jobTemplate: + spec: + template: + spec: + containers: + - name: kruize-cron-create + image: {{ $image }} + imagePullPolicy: IfNotPresent + volumeMounts: + - name: config-volume + mountPath: /etc/config + command: + - sh + - -c + - | + /home/autotune/app/target/bin/CreatePartition + env: + - name: START_AUTOTUNE + value: "false" + - name: LOGGING_LEVEL + value: {{ $loggingLevel | quote }} + - name: DB_CONFIG_FILE + value: {{ $dbConfigFile | quote }} + - name: KRUIZE_CONFIG_FILE + value: {{ $kruizeConfigFile | quote }} + volumes: + - name: config-volume + configMap: + name: {{ $fullName }}-config + restartPolicy: OnFailure +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ .Release.Name }}-delete-partition + namespace: {{ $namespace }} +spec: + schedule: "0 0 25 * *" + jobTemplate: + spec: + template: + spec: + containers: + - name: kruize-cron-delete + image: {{ $image }} + imagePullPolicy: IfNotPresent + volumeMounts: + - name: config-volume + mountPath: /etc/config + command: + - sh + - -c + - | + /home/autotune/app/target/bin/RetentionPartition + env: + - name: START_AUTOTUNE + value: "false" + - name: DB_CONFIG_FILE + value: {{ $dbConfigFile | quote }} + - name: KRUIZE_CONFIG_FILE + value: {{ $kruizeConfigFile | quote }} + - name: deletepartitionsthreshold + value: {{ .Values.cronJob.deletePartitionsThreshold | quote }} + volumes: + - name: config-volume + configMap: + name: ${{ $fullName }}-config + restartPolicy: OnFailure diff --git a/charts/kruize/templates/kruize-db-deployment.yaml b/charts/kruize/templates/kruize-db-deployment.yaml new file mode 100644 index 0000000..63ede6e --- /dev/null +++ b/charts/kruize/templates/kruize-db-deployment.yaml @@ -0,0 +1,49 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "kruize.deploymentName" . }}-db + namespace: {{ .Release.Namespace }} + labels: + app: {{ $fullName }}-db +spec: + replicas: 1 + selector: + matchLabels: + app: {{ $fullName }}-db + template: + metadata: + labels: + app: {{ $fullName }}-db + spec: + serviceAccountName: {{ include "kruize.serviceAccountName" . }} + containers: + - name: {{ .Chart.Name }}-db + image: "{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}" + imagePullPolicy: {{ .Values.db.image.pullPolicy }} + env: + - name: POSTGRES_PASSWORD + value: {{ .Values.db.password | quote }} + - name: POSTGRES_USER + value: {{ .Values.db.user | quote }} + - name: POSTGRES_DB + value: {{ printf "%s-%s" .Values.db.name $fullName | quote }} + - name: PGDATA + value: /var/lib/pg_data + resources: + requests: + memory: {{ .Values.db.resources.requests.memory | quote }} + cpu: {{ .Values.db.resources.requests.cpu | quote }} + limits: + memory: {{ .Values.db.resources.limits.memory | quote }} + cpu: {{ .Values.db.resources.limits.cpu | quote }} + ports: + - containerPort: {{ .Values.db.service.port }} + volumeMounts: + - name: kruize-db-storage + mountPath: /var/lib/pgsql/data + volumes: + - name: kruize-db-storage + persistentVolumeClaim: + claimName: {{ $fullName }}-db-pv-claim diff --git a/charts/kruize/templates/kruize-db-service.yaml b/charts/kruize/templates/kruize-db-service.yaml new file mode 100644 index 0000000..c951846 --- /dev/null +++ b/charts/kruize/templates/kruize-db-service.yaml @@ -0,0 +1,17 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ $fullName }}-db-service + namespace: {{ .Release.Namespace }} + labels: + app: {{ $fullName }}-db +spec: + type: {{ .Values.db.service.type }} + ports: + - name: kruize-db-port + port: {{ .Values.db.service.port }} + targetPort: {{ .Values.db.service.port }} + selector: + app: {{ $fullName }}-db diff --git a/charts/kruize/templates/kruize-deployment.yaml b/charts/kruize/templates/kruize-deployment.yaml new file mode 100644 index 0000000..63b060e --- /dev/null +++ b/charts/kruize/templates/kruize-deployment.yaml @@ -0,0 +1,61 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "kruize.deploymentName" . }} + namespace: {{ .Release.Namespace }} +spec: + replicas: {{ .Values.kruize.replicaCount | default 1 }} + selector: + matchLabels: + {{- include "kruize.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "kruize.selectorLabels" . | nindent 8 }} + spec: + serviceAccountName: {{ include "kruize.serviceAccountName" . }} + initContainers: + - name: wait-for-kruize-db + image: "{{ .Values.db.image.repository }}:{{ .Values.db.image.tag }}" + command: + - sh + - -c + - > + until pg_isready + -h "{{ $fullName }}-db-service" + -p {{ .Values.db.port | default 5432 }} + -U {{ .Values.db.user | quote }}; + do echo "Waiting for database..."; + sleep 2; + done + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.kruize.image.repository }}:{{ .Values.kruize.image.tag }}" + imagePullPolicy: {{ .Values.kruize.image.pullPolicy }} + volumeMounts: + - name: config-volume + mountPath: /etc/config + env: + {{- range .Values.kruize.env }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + resources: + requests: + cpu: {{ .Values.kruize.resources.requests.cpu }} + memory: {{ .Values.kruize.resources.requests.memory }} + limits: + cpu: {{ .Values.kruize.resources.requests.cpu }} + memory: {{ .Values.kruize.resources.requests.memory }} + ports: + - name: kruize-port + containerPort: {{ .Values.kruize.service.port }} + volumeMounts: + - name: config-volume + mountPath: /etc/config + volumes: + - name: config-volume + configMap: + name: {{ $fullName }}-config diff --git a/charts/kruize/templates/kruize-service.yaml b/charts/kruize/templates/kruize-service.yaml new file mode 100644 index 0000000..6ea0ab9 --- /dev/null +++ b/charts/kruize/templates/kruize-service.yaml @@ -0,0 +1,21 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + annotations: + prometheus.io/scrape: 'true' + prometheus.io/path: '/metrics' + labels: + {{- include "kruize.labels" . | nindent 4 }} +spec: + type: {{ .Values.kruize.service.type }} + selector: + {{- include "kruize.selectorLabels" . | nindent 4 }} + ports: + - name: kruize-port + port: {{ .Values.kruize.service.port }} + targetPort: {{ .Values.kruize.service.port }} + diff --git a/charts/kruize/templates/kruize-ui-nginx-pod.yaml b/charts/kruize/templates/kruize-ui-nginx-pod.yaml new file mode 100644 index 0000000..efa2799 --- /dev/null +++ b/charts/kruize/templates/kruize-ui-nginx-pod.yaml @@ -0,0 +1,25 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: v1 +kind: Pod +metadata: + name: {{ $fullName }}-ui-nginx-pod + namespace: {{ .Release.Namespace }} + labels: + app: kruize-ui-nginx +spec: + containers: + - name: kruize-ui-nginx-container + image: "{{ .Values.kruizeUI.image.repository }}:{{ .Values.kruizeUI.image.tag }}" + imagePullPolicy: {{ .Values.kruizeUI.image.pullPolicy }} + env: + - name: KRUIZE_UI_ENV + value: "production" + volumeMounts: + - name: nginx-config-volume + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + volumes: + - name: nginx-config-volume + configMap: + name: {{ $fullName }}-nginx-config diff --git a/charts/kruize/templates/kruize-ui-nginx-service.yaml b/charts/kruize/templates/kruize-ui-nginx-service.yaml new file mode 100644 index 0000000..499ccac --- /dev/null +++ b/charts/kruize/templates/kruize-ui-nginx-service.yaml @@ -0,0 +1,15 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ $fullName }}-ui-nginx-service + namespace: {{ .Release.Namespace }} +spec: + type: {{ .Values.kruizeUI.service.type }} + ports: + - name: http + port: {{ .Values.kruizeUI.service.port }} + targetPort: {{ .Values.kruizeUI.service.port }} + selector: + app: kruize-ui-nginx diff --git a/charts/kruize/templates/role.yaml b/charts/kruize/templates/role.yaml new file mode 100644 index 0000000..76a64aa --- /dev/null +++ b/charts/kruize/templates/role.yaml @@ -0,0 +1,64 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ $fullName }}-recommendation-updater +rules: + - apiGroups: + - "" + resources: + - pods + - customresourcedefinitions + verbs: + - '*' + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - '*' + - apiGroups: + - autoscaling.k8s.io + resources: + - verticalpodautoscalers + - verticalpodautoscalers/status + - verticalpodautoscalercheckpoints + verbs: + - '*' + - apiGroups: + - rbac.authorization.k8s.io + resources: + - clusterrolebindings + verbs: + - '*' + - apiGroups: + - apps + resources: + - deployments + verbs: + - "*" +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ $fullName }}-edit-ko +rules: + - apiGroups: [ "apps" ] + resources: [ "deployments", "statefulsets", "daemonsets" ] + verbs: [ "get", "list", "patch", "update" ] + - apiGroups: [ "batch" ] + resources: [ "jobs" ] + verbs: [ "get", "list", "create", "delete" ] + - apiGroups: [ "" ] + resources: [ "namespaces" ] + verbs: [ "get", "list" ] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ $fullName }}-instaslices-access +rules: + - apiGroups: [ "inference.redhat.com" ] + resources: [ "instaslices" ] + verbs: [ "get", "list", "watch" ] diff --git a/charts/kruize/templates/rolebinding.yaml b/charts/kruize/templates/rolebinding.yaml new file mode 100644 index 0000000..440c3c8 --- /dev/null +++ b/charts/kruize/templates/rolebinding.yaml @@ -0,0 +1,70 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ $fullName }}-recommendation-updater-crb +subjects: + - kind: ServiceAccount + name: {{ include "kruize.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ $fullName }}-recommendation-updater +--- +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ $fullName }}-monitoring-view +subjects: + - kind: ServiceAccount + name: {{ include "kruize.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: cluster-monitoring-view + apiGroup: rbac.authorization.k8s.io +{{- end }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ $fullName }}-instaslices-access-binding +subjects: + - kind: ServiceAccount + name: {{ include "kruize.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: {{ $fullName }}-instaslices-access + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ $fullName }}-edit-ko-binding +subjects: + - kind: ServiceAccount + name: {{ include "kruize.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: {{ $fullName }}-edit-ko + apiGroup: rbac.authorization.k8s.io +--- +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ $fullName }}-autotune-scc-crb +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:openshift:scc:anyuid +subjects: + - kind: ServiceAccount + name: {{ include "kruize.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/kruize/templates/service-account.yaml b/charts/kruize/templates/service-account.yaml new file mode 100644 index 0000000..a140581 --- /dev/null +++ b/charts/kruize/templates/service-account.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "kruize.serviceAccountName" . }} + labels: + {{- include "kruize.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/kruize/templates/service-monitor.yaml b/charts/kruize/templates/service-monitor.yaml new file mode 100644 index 0000000..ffbcbf6 --- /dev/null +++ b/charts/kruize/templates/service-monitor.yaml @@ -0,0 +1,22 @@ +{{- $fullName := include "kruize.fullname" . -}} +{{- if .Values.monitoring.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ $fullName }}-service-monitor + namespace: {{ .Release.Namespace }} + labels: + app: kruize +spec: + selector: + matchLabels: + app: kruize + endpoints: + - port: kruize-port + interval: {{ .Values.monitoring.interval }} + path: /metrics + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} + diff --git a/charts/kruize/templates/storage-pv.yaml b/charts/kruize/templates/storage-pv.yaml new file mode 100644 index 0000000..7b11739 --- /dev/null +++ b/charts/kruize/templates/storage-pv.yaml @@ -0,0 +1,19 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ $fullName }}-db-pv-volume + namespace: {{ .Release.Namespace }} + labels: + type: local + app: {{ $fullName }}-db + +spec: + storageClassName: {{ .Values.db.pvc.storageClass | quote }} + capacity: + storage: {{ .Values.db.pvc.storageSize | quote }} + accessModes: + - ReadWriteMany + hostPath: + path: {{ printf "%s/%s" .Values.db.pvc.hostPath $fullName | quote }} diff --git a/charts/kruize/templates/storage-pvc.yaml b/charts/kruize/templates/storage-pvc.yaml new file mode 100644 index 0000000..a3d3167 --- /dev/null +++ b/charts/kruize/templates/storage-pvc.yaml @@ -0,0 +1,16 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ $fullName }}-db-pv-claim + namespace: {{ .Release.Namespace }} + labels: + app: {{ $fullName }}-db +spec: + storageClassName: {{ .Values.db.pvc.storageClass | quote }} + accessModes: + - ReadWriteMany + resources: + requests: + storage: {{ .Values.db.pvc.storageSize | quote }} diff --git a/charts/kruize/templates/tests/test-connection.yaml b/charts/kruize/templates/tests/test-connection.yaml new file mode 100644 index 0000000..b6b8b0f --- /dev/null +++ b/charts/kruize/templates/tests/test-connection.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "kruize.fullname" . }}-test-connection" + labels: + {{- include "kruize.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "kruize.fullname" . }}:{{ .Values.kruize.service.port }}'] + restartPolicy: Never + diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml new file mode 100644 index 0000000..13e842a --- /dev/null +++ b/charts/kruize/values.yaml @@ -0,0 +1,190 @@ +## @section Kruize Container +## @extra Configuration for the Kruize application + +kruize: + image: + ## @param kruize.image.repository Repository for Kruize container image + repository: quay.io/kruize/autotune_operator + ## @param kruize.image.pullPolicy Image pull policy for the Kruize container image + pullPolicy: Always + ## @param kruize.image.tag Image tag for Kruize container + tag: "0.8.1" + ## @param kruize.replicaCount Replica count for the Kruize container + replicaCount: 1 + resources: + requests: + ## @param kruize.resources.requests.memory Memory resource request for the Kruize container + memory: "768Mi" + ## @param kruize.resources.requests.cpu CPU resource request for the Kruize container + cpu: "0.7" + limits: + ## @param kruize.resources.limits.memory Memory resource limit for the Kruize container + memory: "768Mi" + ## @param kruize.resources.limits.cpu CPU resource limit for the Kruize container + cpu: "0.7" + service: + ## @param kruize.service.type Kruize service type + type: NodePort + ## @param kruize.service.type Kruize service port + port: 8080 + env: + - name: LOGGING_LEVEL + value: "info" + - name: ROOT_LOGGING_LEVEL + value: "error" + - name: DB_CONFIG_FILE + value: "/etc/config/dbconfigjson" + - name: KRUIZE_CONFIG_FILE + value: "/etc/config/kruizeconfigjson" + - name: JAVA_TOOL_OPTIONS + value: "-XX:MaxRAMPercentage=80" + - name: KAFKA_BOOTSTRAP_SERVERS + value: "kruize-kafka-cluster-kafka-bootstrap.kafka.svc.cluster.local:9092" + - name: KAFKA_TOPICS + value: "recommendations-topic,error-topic,summary-topic" + - name: KAFKA_RESPONSE_FILTER_INCLUDE + value: "experiments|status|apis|recommendations|response|status_history" + - name: KAFKA_RESPONSE_FILTER_EXCLUDE + value: "" + + config: + clusterType: "kubernetes" + k8sType: "openshift" + authType: "" + monitoringAgent: "prometheus" + monitoringService: "prometheus-k8s" + monitoringEndPoint: "prometheus-k8s" + saveToDB: "true" + dbDriver: "jdbc:postgresql://" + plots: "true" + isROSEnabled: "false" + local: "true" + logAllHttpReqAndResp: "true" + experimentNameFormat: "%datasource%|%clustername%|%namespace%|%workloadname%(%workloadtype%)|%containername%" + bulkapilimit: 1000 + isKafkaEnabled: "false" + hibernate: + dialect: "org.hibernate.dialect.PostgreSQLDialect" + driver: "org.postgresql.Driver" + c3p0minsize: 5 + c3p0maxsize: 10 + c3p0timeout: 300 + c3p0maxstatements: 100 + hbm2ddlauto: "none" + showsql: "false" + timezone: "UTC" + + logging: + cloudwatch: + accessKeyId: "" + logGroup: "kruize-logs" + logStream: "kruize-stream" + region: "" + secretAccessKey: "" + logLevel: "INFO" + + datasource: + - name: "prometheus-1" + provider: "prometheus" + serviceName: "prometheus-k8s" + namespace: "openshift-monitoring" + url: "" + authentication: + type: "bearer" + credentials: + tokenFilePath: "/var/run/secrets/kubernetes.io/serviceaccount/token" + + - name: "thanos-1" + provider: "prometheus" + serviceName: "thanos-querier" + namespace: "openshift-monitoring" + url: "" + authentication: + type: "bearer" + credentials: + tokenFilePath: "/var/run/secrets/kubernetes.io/serviceaccount/token" + + +cronJob: + deletePartitionsThreshold: "15" + +# Kruize DB configuration +db: + image: + ## @param db.image.repository Repository for Kruize DB container image + repository: quay.io/kruizehub/postgres + ## @param db.image.pullPolicy Image pull policy for the Kruize DB container image + pullPolicy: IfNotPresent + ## @param db.image.tag Image tag for Kruize DB container + tag: "15.2" + service: + ## @param db.service.name Kruize DB service name + name: kruize-db-service + ## @param db.service.type Kruize DB service type + type: ClusterIP + ## @param db.service.port Kruize DB service port + port: 5432 + resources: + requests: + ## @param db.resources.requests.memory Memory resource request for the Kruize DB container + memory: "100Mi" + ## @param db.resources.requests.cpu CPU resource request for the Kruize DB container + cpu: "0.5" + limits: + ## @param db.resources.limits.memory Memory resource limit for the Kruize DB container + memory: "100Mi" + ## @param db.resources.limits.cpu CPU resource limit for the Kruize DB container + cpu: "0.5" + pvc: + storageClass: manual + storageSize: "500Mi" + hostPath: "/mnt/data" + ## @param db.user User for Kruize DB container + user: admin + ## @param db.password User for Kruize DB container + password: admin + ## @param db.adminUser Admin User for Kruize DB container + adminUser: admin + ## @param db.adminPassword Admin password for Kruize DB container + adminPassword: admin + ## @param db.name Name of the Kruize DB + name: kruizeDB + sslMode: require + +# Kruize UI Configuration + +kruizeUI: + image: + ## @param kruizeUI.image.repository Repository for Kruize UI container image + repository: quay.io/kruize/kruize-ui + ## @param kruizeUI.image.pullPolicy Image pull policy for the Kruize UI container image + pullPolicy: Always + ## @param kruizeUI.image.tag Image tag for Kruize UI container + tag: "0.0.8" + service: + ## @param kruizeUI.service.type Kruize UI service type + type: NodePort + ## @param kruizeUI.service.type Kruize UI service port + port: 8080 + + +## @section Other Parameters + +serviceAccount: + ## @param serviceAccount.create Specifies whether a service account should be created + create: true + ## @param serviceAccount.name The name of the service account to use + name: "" + +rbac: + ## @param rbac.create Specifies whether Openshift specific RBAC resources should be created + create: true + +## @param nameOverride Overrides the name of this Chart +nameOverride: "" +## @param fullnameOverride Overrides the fully qualified application name of `[release name]-[chart name]` +fullnameOverride: "" + +monitoring: + enabled: true + interval: 30s From 4b1942f656b2c5082d1c1df49505db5e921accf7 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 10 Feb 2026 18:07:41 +0530 Subject: [PATCH 02/29] Addressed sourcery comments and fixed a few issues Signed-off-by: Chandrakala Subramanyam --- charts/kruize/README.md | 166 +++++++++++++++++- ...gmap-kruize.yaml => configmap_kruize.yaml} | 50 +++--- ...figmap-nginx.yaml => configmap_nginx.yaml} | 0 charts/kruize/templates/cronjobs.yaml | 4 +- ...loyment.yaml => kruize_db_deployment.yaml} | 14 ++ ...db-service.yaml => kruize_db_service.yaml} | 0 ...deployment.yaml => kruize_deployment.yaml} | 23 ++- ...ruize-service.yaml => kruize_service.yaml} | 0 ...ginx-pod.yaml => kruize_ui_nginx_pod.yaml} | 0 ...vice.yaml => kruize_ui_nginx_service.yaml} | 0 ...vice-account.yaml => service_account.yaml} | 0 ...vice-monitor.yaml => service_monitor.yaml} | 4 +- .../{storage-pv.yaml => storage_pv.yaml} | 1 - .../{storage-pvc.yaml => storage_pvc.yaml} | 0 charts/kruize/values.yaml | 7 +- 15 files changed, 229 insertions(+), 40 deletions(-) rename charts/kruize/templates/{configmap-kruize.yaml => configmap_kruize.yaml} (75%) rename charts/kruize/templates/{configmap-nginx.yaml => configmap_nginx.yaml} (100%) rename charts/kruize/templates/{kruize-db-deployment.yaml => kruize_db_deployment.yaml} (69%) rename charts/kruize/templates/{kruize-db-service.yaml => kruize_db_service.yaml} (100%) rename charts/kruize/templates/{kruize-deployment.yaml => kruize_deployment.yaml} (64%) rename charts/kruize/templates/{kruize-service.yaml => kruize_service.yaml} (100%) rename charts/kruize/templates/{kruize-ui-nginx-pod.yaml => kruize_ui_nginx_pod.yaml} (100%) rename charts/kruize/templates/{kruize-ui-nginx-service.yaml => kruize_ui_nginx_service.yaml} (100%) rename charts/kruize/templates/{service-account.yaml => service_account.yaml} (100%) rename charts/kruize/templates/{service-monitor.yaml => service_monitor.yaml} (81%) rename charts/kruize/templates/{storage-pv.yaml => storage_pv.yaml} (92%) rename charts/kruize/templates/{storage-pvc.yaml => storage_pvc.yaml} (100%) diff --git a/charts/kruize/README.md b/charts/kruize/README.md index 4ca5090..151785b 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -1,3 +1,167 @@ # Kruize Helm Chart -A Helm chart for deploying Kruize on OpenShift +A Helm chart for deploying [Kruize]((https://github.com/kruize/autotune) on Kubernetes/OpenShift clusters. + +## Introduction + +Kruize is an intelligent resource optimization platform that helps you optimize your Kubernetes workloads by providing recommendations for CPU and memory resources based on actual usage patterns. + +## Prerequisites + +- Kubernetes 1.19+ or OpenShift 4.x+ +- Helm 3.0+ + +## Installing the Chart + +To install the chart with the release name `kruize`: + +```bash +helm install kruize ./charts/kruize +``` + +To install in a specific namespace: + +```bash +helm install kruize ./charts/kruize --namespace kruize --create-namespace +``` + +## Uninstalling the Chart + +To uninstall/delete the `kruize` deployment: + +```bash +helm uninstall kruize +``` + +## Configuration + +The following table lists the configurable parameters of the Kruize chart and their default values. + +### Kruize Container Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruize.image.repository` | Repository for Kruize container image | `quay.io/kruize/autotune_operator` | +| `kruize.image.pullPolicy` | Image pull policy for the Kruize container image | `Always` | +| `kruize.image.tag` | Image tag for Kruize container | `0.8.1` | +| `kruize.replicaCount` | Replica count for the Kruize container | `1` | +| `kruize.resources.requests.memory` | Memory resource request for the Kruize container | `768Mi` | +| `kruize.resources.requests.cpu` | CPU resource request for the Kruize container | `0.7` | +| `kruize.resources.limits.memory` | Memory resource limit for the Kruize container | `768Mi` | +| `kruize.resources.limits.cpu` | CPU resource limit for the Kruize container | `0.7` | +| `kruize.service.type` | Kruize service type | `NodePort` | +| `kruize.service.port` | Kruize service port | `8080` | + +### Kruize Configuration Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruize.config.clusterType` | Type of cluster (kubernetes/openshift) | `kubernetes` | +| `kruize.config.k8sType` | Kubernetes distribution type | `openshift` | +| `kruize.config.authType` | Authentication type | `""` | +| `kruize.config.monitoringAgent` | Monitoring agent to use | `prometheus` | +| `kruize.config.monitoringService` | Monitoring service name | `prometheus-k8s` | +| `kruize.config.monitoringEndPoint` | Monitoring endpoint | `prometheus-k8s` | +| `kruize.config.saveToDB` | Enable saving data to database | `true` | +| `kruize.config.dbDriver` | Database driver | `jdbc:postgresql://` | +| `kruize.config.plots` | Enable plots generation | `true` | +| `kruize.config.isROSEnabled` | Enable ROS (Resource Optimization Service) | `false` | +| `kruize.config.local` | Run in local mode | `true` | +| `kruize.config.logAllHttpReqAndResp` | Log all HTTP requests and responses | `true` | +| `kruize.config.experimentNameFormat` | Format for experiment names | `%datasource%\|%clustername%\|%namespace%\|%workloadname%(%workloadtype%)\|%containername%` | +| `kruize.config.bulkapilimit` | Bulk API limit | `1000` | +| `kruize.config.isKafkaEnabled` | Enable Kafka integration | `false` | + +### Kruize Hibernate Configuration + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruize.config.hibernate.dialect` | Hibernate dialect | `org.hibernate.dialect.PostgreSQLDialect` | +| `kruize.config.hibernate.driver` | Hibernate driver | `org.postgresql.Driver` | +| `kruize.config.hibernate.c3p0minsize` | C3P0 minimum pool size | `5` | +| `kruize.config.hibernate.c3p0maxsize` | C3P0 maximum pool size | `10` | +| `kruize.config.hibernate.c3p0timeout` | C3P0 timeout | `300` | +| `kruize.config.hibernate.c3p0maxstatements` | C3P0 max statements | `100` | +| `kruize.config.hibernate.hbm2ddlauto` | Hibernate hbm2ddl.auto setting | `none` | +| `kruize.config.hibernate.showsql` | Show SQL queries | `false` | +| `kruize.config.hibernate.timezone` | Database timezone | `UTC` | + +### Kruize Database Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `db.image.repository` | Repository for Kruize DB container image | `quay.io/kruizehub/postgres` | +| `db.image.pullPolicy` | Image pull policy for the Kruize DB container image | `IfNotPresent` | +| `db.image.tag` | Image tag for Kruize DB container | `15.2` | +| `db.service.name` | Kruize DB service name | `kruize-db-service` | +| `db.service.type` | Kruize DB service type | `ClusterIP` | +| `db.service.port` | Kruize DB service port | `5432` | +| `db.resources.requests.memory` | Memory resource request for the Kruize DB container | `100Mi` | +| `db.resources.requests.cpu` | CPU resource request for the Kruize DB container | `0.5` | +| `db.resources.limits.memory` | Memory resource limit for the Kruize DB container | `100Mi` | +| `db.resources.limits.cpu` | CPU resource limit for the Kruize DB container | `0.5` | +| `db.pvc.storageClass` | Storage class for database PVC | `manual` | +| `db.pvc.storageSize` | Storage size for database PVC | `500Mi` | +| `db.pvc.hostPath` | Host path for database storage | `/mnt/data` | +| `db.user` | User for Kruize DB container | `admin` | +| `db.password` | Password for Kruize DB container | `admin` | +| `db.adminUser` | Admin user for Kruize DB container | `admin` | +| `db.adminPassword` | Admin password for Kruize DB container | `admin` | +| `db.name` | Name of the Kruize DB | `kruizeDB` | +| `db.sslMode` | SSL mode for database connection | `require` | + +### Kruize UI Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruizeUI.image.repository` | Repository for Kruize UI container image | `quay.io/kruize/kruize-ui` | +| `kruizeUI.image.pullPolicy` | Image pull policy for the Kruize UI container image | `Always` | +| `kruizeUI.image.tag` | Image tag for Kruize UI container | `0.0.8` | +| `kruizeUI.service.type` | Kruize UI service type | `NodePort` | +| `kruizeUI.service.port` | Kruize UI service port | `8080` | + +### Monitoring Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `monitoring.enabled` | Enable ServiceMonitor for Prometheus Operator | `true` | +| `monitoring.interval` | Metrics scraping interval | `30s` | + +### CronJob Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `cronJob.deletePartitionsThreshold` | Threshold for deleting old partitions (days) | `15` | + +### Other Parameters + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `serviceAccount.create` | Specifies whether a service account should be created | `true` | +| `serviceAccount.name` | The name of the service account to use | `""` | +| `rbac.create` | Specifies whether OpenShift specific RBAC resources should be created | `true` | +| `nameOverride` | Overrides the name of this Chart | `""` | +| `fullnameOverride` | Overrides the fully qualified application name | `""` | + +## Example: Custom Values + +Create a `custom-values.yaml` file: + +```yaml +kruize: + replicaCount: 2 + resources: + requests: + memory: "1Gi" + cpu: "1" + limits: + memory: "1Gi" + cpu: "1" +``` + +Install with custom values: + +```bash +helm install kruize ./charts/kruize -f custom-values.yaml +``` + diff --git a/charts/kruize/templates/configmap-kruize.yaml b/charts/kruize/templates/configmap_kruize.yaml similarity index 75% rename from charts/kruize/templates/configmap-kruize.yaml rename to charts/kruize/templates/configmap_kruize.yaml index 6126333..e23c393 100644 --- a/charts/kruize/templates/configmap-kruize.yaml +++ b/charts/kruize/templates/configmap_kruize.yaml @@ -9,42 +9,42 @@ data: dbconfigjson: | { "database": { - "adminPassword": {{ .Values.db.adminPassword }}, - "adminUsername": {{ .Values.db.adminUser }}, + "adminPassword": {{ .Values.db.adminPassword | quote }}, + "adminUsername": {{ .Values.db.adminUser | quote }}, "hostname": "{{ $fullName }}-db-service", "name": {{ printf "%s-%s" .Values.db.name $fullName | quote }}, - "password": {{ .Values.db.password }}, - "port": {{ .Values.db.service.port }}, - "sslMode": {{ .Values.db.sslMode }}, - "username": {{ .Values.db.user }} + "password": {{ .Values.db.password | quote }}, + "port": {{ .Values.db.service.port | quote }}, + "sslMode": {{ .Values.db.sslMode | quote }}, + "username": {{ .Values.db.user | quote }} } } kruizeconfigjson: | { - "clustertype": {{ .Values.kruize.config.clusterType }}, - "k8stype": {{ .Values.kruize.config.k8sType }}, + "clustertype": {{ .Values.kruize.config.clusterType | quote }}, + "k8stype": {{ .Values.kruize.config.k8sType | quote }}, "authtype": {{ .Values.kruize.config.authType | quote }}, - "monitoringagent": {{ .Values.kruize.config.monitoringAgent }}, - "monitoringservice": {{ .Values.kruize.config.monitoringService }}, - "monitoringendpoint": {{ .Values.kruize.config.monitoringEndPoint }}, - "savetodb": {{ .Values.kruize.config.saveToDB }}, + "monitoringagent": {{ .Values.kruize.config.monitoringAgent | quote }}, + "monitoringservice": {{ .Values.kruize.config.monitoringService | quote }}, + "monitoringendpoint": {{ .Values.kruize.config.monitoringEndPoint | quote }}, + "savetodb": {{ .Values.kruize.config.saveToDB | quote }}, "dbdriver": {{ .Values.kruize.config.dbDriver | quote }}, - "plots": {{ .Values.kruize.config.plots }}, - "isROSEnabled": {{ .Values.kruize.config.isROSEnabled }}, - "local": {{ .Values.kruize.config.local }}, - "logAllHttpReqAndResp": {{ .Values.kruize.config.logAllHttpReqAndResp }}, + "plots": {{ .Values.kruize.config.plots | quote }}, + "isROSEnabled": {{ .Values.kruize.config.isROSEnabled | quote }}, + "local": {{ .Values.kruize.config.local | quote }}, + "logAllHttpReqAndResp": {{ .Values.kruize.config.logAllHttpReqAndResp | quote }}, "recommendationsURL" : {{ printf "http://%s.%s.svc.cluster.local:8080/generateRecommendations?experiment_name=%%s" $fullName .Release.Namespace | quote }}, "experimentsURL" : {{ printf "http://%s.%s.svc.cluster.local:8080/createExperiment" $fullName .Release.Namespace | quote }}, "experimentNameFormat" : {{ .Values.kruize.config.experimentNameFormat | quote }}, - "bulkapilimit" : {{ .Values.kruize.config.bulkapilimit }}, - "isKafkaEnabled" : {{ .Values.kruize.config.isKafkaEnabled }}, + "bulkapilimit" : {{ .Values.kruize.config.bulkapilimit | quote }}, + "isKafkaEnabled" : {{ .Values.kruize.config.isKafkaEnabled | quote }}, "hibernate": { "dialect": {{ .Values.kruize.config.hibernate.dialect | quote }}, "driver": {{ .Values.kruize.config.hibernate.driver | quote }}, - "c3p0minsize": {{ .Values.kruize.config.hibernate.c3p0minsize }}, - "c3p0maxsize": {{ .Values.kruize.config.hibernate.c3p0maxsize }}, - "c3p0timeout": {{ .Values.kruize.config.hibernate.c3p0timeout }}, - "c3p0maxstatements": {{ .Values.kruize.config.hibernate.c3p0maxstatements }}, + "c3p0minsize": {{ .Values.kruize.config.hibernate.c3p0minsize | quote }}, + "c3p0maxsize": {{ .Values.kruize.config.hibernate.c3p0maxsize | quote }}, + "c3p0timeout": {{ .Values.kruize.config.hibernate.c3p0timeout | quote }}, + "c3p0maxstatements": {{ .Values.kruize.config.hibernate.c3p0maxstatements | quote }}, "hbm2ddlauto": {{ .Values.kruize.config.hibernate.hbm2ddlauto | quote }}, "showsql": {{ .Values.kruize.config.hibernate.showsql | quote}}, "timezone": {{ .Values.kruize.config.hibernate.timezone | quote }} @@ -52,11 +52,11 @@ data: "logging" : { "cloudwatch": { "accessKeyId": {{ .Values.kruize.config.logging.cloudwatch.accessKeyId | quote }}, - "logGroup": {{ .Values.kruize.config.logging.cloudwatch.logGroup }}, - "logStream": {{ .Values.kruize.config.logging.cloudwatch.logStream }}, + "logGroup": {{ .Values.kruize.config.logging.cloudwatch.logGroup | quote }}, + "logStream": {{ .Values.kruize.config.logging.cloudwatch.logStream | quote }}, "region": {{ .Values.kruize.config.logging.cloudwatch.region | quote }}, "secretAccessKey": {{ .Values.kruize.config.logging.cloudwatch.secretAccessKey | quote }}, - "logLevel": {{ .Values.kruize.config.logging.cloudwatch.logLevel }} + "logLevel": {{ .Values.kruize.config.logging.cloudwatch.logLevel | quote }} } }, diff --git a/charts/kruize/templates/configmap-nginx.yaml b/charts/kruize/templates/configmap_nginx.yaml similarity index 100% rename from charts/kruize/templates/configmap-nginx.yaml rename to charts/kruize/templates/configmap_nginx.yaml diff --git a/charts/kruize/templates/cronjobs.yaml b/charts/kruize/templates/cronjobs.yaml index 54334ce..fa057af 100644 --- a/charts/kruize/templates/cronjobs.yaml +++ b/charts/kruize/templates/cronjobs.yaml @@ -1,5 +1,5 @@ {{- $fullName := include "kruize.fullname" . -}} -{{- $image := .Values.kruize.image -}} +{{- $image := printf "%s:%s" .Values.kruize.image.repository .Values.kruize.image.tag -}} {{- $namespace := .Release.Namespace -}} {{- $loggingLevel := "info" -}} @@ -91,5 +91,5 @@ spec: volumes: - name: config-volume configMap: - name: ${{ $fullName }}-config + name: {{ $fullName }}-config restartPolicy: OnFailure diff --git a/charts/kruize/templates/kruize-db-deployment.yaml b/charts/kruize/templates/kruize_db_deployment.yaml similarity index 69% rename from charts/kruize/templates/kruize-db-deployment.yaml rename to charts/kruize/templates/kruize_db_deployment.yaml index 63ede6e..0141a7f 100644 --- a/charts/kruize/templates/kruize-db-deployment.yaml +++ b/charts/kruize/templates/kruize_db_deployment.yaml @@ -31,13 +31,27 @@ spec: value: {{ printf "%s-%s" .Values.db.name $fullName | quote }} - name: PGDATA value: /var/lib/pg_data + {{- if or .Values.db.resources.requests.memory .Values.db.resources.requests.cpu .Values.db.resources.limits.memory .Values.db.resources.limits.cpu }} resources: + {{- if or .Values.db.resources.requests.memory .Values.db.resources.requests.cpu }} requests: + {{- if .Values.db.resources.requests.memory }} memory: {{ .Values.db.resources.requests.memory | quote }} + {{- end }} + {{- if .Values.db.resources.requests.cpu }} cpu: {{ .Values.db.resources.requests.cpu | quote }} + {{- end }} + {{- end }} + {{- if or .Values.db.resources.limits.memory .Values.db.resources.limits.cpu }} limits: + {{- if .Values.db.resources.limits.memory }} memory: {{ .Values.db.resources.limits.memory | quote }} + {{- end }} + {{- if .Values.db.resources.limits.cpu }} cpu: {{ .Values.db.resources.limits.cpu | quote }} + {{- end }} + {{- end }} + {{- end }} ports: - containerPort: {{ .Values.db.service.port }} volumeMounts: diff --git a/charts/kruize/templates/kruize-db-service.yaml b/charts/kruize/templates/kruize_db_service.yaml similarity index 100% rename from charts/kruize/templates/kruize-db-service.yaml rename to charts/kruize/templates/kruize_db_service.yaml diff --git a/charts/kruize/templates/kruize-deployment.yaml b/charts/kruize/templates/kruize_deployment.yaml similarity index 64% rename from charts/kruize/templates/kruize-deployment.yaml rename to charts/kruize/templates/kruize_deployment.yaml index 63b060e..470adb3 100644 --- a/charts/kruize/templates/kruize-deployment.yaml +++ b/charts/kruize/templates/kruize_deployment.yaml @@ -25,7 +25,7 @@ spec: - > until pg_isready -h "{{ $fullName }}-db-service" - -p {{ .Values.db.port | default 5432 }} + -p {{ .Values.db.service.port | default 5432 }} -U {{ .Values.db.user | quote }}; do echo "Waiting for database..."; sleep 2; @@ -42,19 +42,30 @@ spec: - name: {{ .name }} value: {{ .value | quote }} {{- end }} + {{- if or .Values.kruize.resources.requests.memory .Values.kruize.resources.requests.cpu .Values.kruize.resources.limits.memory .Values.kruize.resources.limits.cpu }} resources: + {{- if or .Values.kruize.resources.requests.memory .Values.kruize.resources.requests.cpu }} requests: + {{- if .Values.kruize.resources.requests.cpu }} cpu: {{ .Values.kruize.resources.requests.cpu }} + {{- end }} + {{- if .Values.kruize.resources.requests.memory }} memory: {{ .Values.kruize.resources.requests.memory }} + {{- end }} + {{- end }} + {{- if or .Values.kruize.resources.limits.memory .Values.kruize.resources.limits.cpu }} limits: - cpu: {{ .Values.kruize.resources.requests.cpu }} - memory: {{ .Values.kruize.resources.requests.memory }} + {{- if .Values.kruize.resources.limits.cpu }} + cpu: {{ .Values.kruize.resources.limits.cpu }} + {{- end }} + {{- if .Values.kruize.resources.limits.memory }} + memory: {{ .Values.kruize.resources.limits.memory }} + {{- end }} + {{- end }} + {{- end }} ports: - name: kruize-port containerPort: {{ .Values.kruize.service.port }} - volumeMounts: - - name: config-volume - mountPath: /etc/config volumes: - name: config-volume configMap: diff --git a/charts/kruize/templates/kruize-service.yaml b/charts/kruize/templates/kruize_service.yaml similarity index 100% rename from charts/kruize/templates/kruize-service.yaml rename to charts/kruize/templates/kruize_service.yaml diff --git a/charts/kruize/templates/kruize-ui-nginx-pod.yaml b/charts/kruize/templates/kruize_ui_nginx_pod.yaml similarity index 100% rename from charts/kruize/templates/kruize-ui-nginx-pod.yaml rename to charts/kruize/templates/kruize_ui_nginx_pod.yaml diff --git a/charts/kruize/templates/kruize-ui-nginx-service.yaml b/charts/kruize/templates/kruize_ui_nginx_service.yaml similarity index 100% rename from charts/kruize/templates/kruize-ui-nginx-service.yaml rename to charts/kruize/templates/kruize_ui_nginx_service.yaml diff --git a/charts/kruize/templates/service-account.yaml b/charts/kruize/templates/service_account.yaml similarity index 100% rename from charts/kruize/templates/service-account.yaml rename to charts/kruize/templates/service_account.yaml diff --git a/charts/kruize/templates/service-monitor.yaml b/charts/kruize/templates/service_monitor.yaml similarity index 81% rename from charts/kruize/templates/service-monitor.yaml rename to charts/kruize/templates/service_monitor.yaml index ffbcbf6..56f6087 100644 --- a/charts/kruize/templates/service-monitor.yaml +++ b/charts/kruize/templates/service_monitor.yaml @@ -6,11 +6,11 @@ metadata: name: {{ $fullName }}-service-monitor namespace: {{ .Release.Namespace }} labels: - app: kruize + {{- include "kruize.labels" . | nindent 4 }} spec: selector: matchLabels: - app: kruize + {{- include "kruize.selectorLabels" . | nindent 6 }} endpoints: - port: kruize-port interval: {{ .Values.monitoring.interval }} diff --git a/charts/kruize/templates/storage-pv.yaml b/charts/kruize/templates/storage_pv.yaml similarity index 92% rename from charts/kruize/templates/storage-pv.yaml rename to charts/kruize/templates/storage_pv.yaml index 7b11739..18ee82d 100644 --- a/charts/kruize/templates/storage-pv.yaml +++ b/charts/kruize/templates/storage_pv.yaml @@ -4,7 +4,6 @@ kind: PersistentVolume apiVersion: v1 metadata: name: {{ $fullName }}-db-pv-volume - namespace: {{ .Release.Namespace }} labels: type: local app: {{ $fullName }}-db diff --git a/charts/kruize/templates/storage-pvc.yaml b/charts/kruize/templates/storage_pvc.yaml similarity index 100% rename from charts/kruize/templates/storage-pvc.yaml rename to charts/kruize/templates/storage_pvc.yaml diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml index 13e842a..1d2d205 100644 --- a/charts/kruize/values.yaml +++ b/charts/kruize/values.yaml @@ -25,8 +25,9 @@ kruize: service: ## @param kruize.service.type Kruize service type type: NodePort - ## @param kruize.service.type Kruize service port + ## @param kruize.service.port Kruize service port port: 8080 + env: - name: LOGGING_LEVEL value: "info" @@ -164,9 +165,9 @@ kruizeUI: service: ## @param kruizeUI.service.type Kruize UI service type type: NodePort - ## @param kruizeUI.service.type Kruize UI service port + ## @param kruizeUI.service.port Kruize UI service port port: 8080 - + ## @section Other Parameters From 74ecc63568053d074262db0646a077f415eedccd Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 10 Feb 2026 19:40:42 +0530 Subject: [PATCH 03/29] Removed hardcoding of cronjob schedule & fixed sourcery comments Signed-off-by: Chandrakala Subramanyam --- charts/kruize/README.md | 5 +++-- charts/kruize/templates/cronjobs.yaml | 4 ++-- charts/kruize/values.yaml | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/charts/kruize/README.md b/charts/kruize/README.md index 151785b..46b27a2 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -1,6 +1,6 @@ # Kruize Helm Chart -A Helm chart for deploying [Kruize]((https://github.com/kruize/autotune) on Kubernetes/OpenShift clusters. +A Helm chart for deploying [Kruize](https://github.com/kruize/autotune) on Kubernetes/OpenShift clusters. ## Introduction @@ -132,6 +132,7 @@ The following table lists the configurable parameters of the Kruize chart and th | Parameter | Description | Default | |-----------|-------------|---------| | `cronJob.deletePartitionsThreshold` | Threshold for deleting old partitions (days) | `15` | +| `cronJob.createSchedule` | Schedule for running the cron job | `0 0 25 * *` | ### Other Parameters @@ -139,7 +140,7 @@ The following table lists the configurable parameters of the Kruize chart and th |-----------|-------------|---------| | `serviceAccount.create` | Specifies whether a service account should be created | `true` | | `serviceAccount.name` | The name of the service account to use | `""` | -| `rbac.create` | Specifies whether OpenShift specific RBAC resources should be created | `true` | +| `rbac.create` | Specifies whether OpenShift-specific RBAC resources should be created | `true` | | `nameOverride` | Overrides the name of this Chart | `""` | | `fullnameOverride` | Overrides the fully qualified application name | `""` | diff --git a/charts/kruize/templates/cronjobs.yaml b/charts/kruize/templates/cronjobs.yaml index fa057af..0c36e4c 100644 --- a/charts/kruize/templates/cronjobs.yaml +++ b/charts/kruize/templates/cronjobs.yaml @@ -24,7 +24,7 @@ metadata: name: {{ .Release.Name }}-create-partition namespace: {{ $namespace }} spec: - schedule: "0 0 25 * *" # Run on 25th of every month at midnight + schedule: {{ default "0 0 25 * *" .Values.cronJob.createSchedule | quote }} # Run on 25th of every month at midnight jobTemplate: spec: template: @@ -62,7 +62,7 @@ metadata: name: {{ .Release.Name }}-delete-partition namespace: {{ $namespace }} spec: - schedule: "0 0 25 * *" + schedule: {{ default "0 0 25 * *" .Values.cronJob.createSchedule | quote }} jobTemplate: spec: template: diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml index 1d2d205..0ff84f9 100644 --- a/charts/kruize/values.yaml +++ b/charts/kruize/values.yaml @@ -108,6 +108,7 @@ kruize: cronJob: deletePartitionsThreshold: "15" + createSchedule: "0 0 25 * *" # Kruize DB configuration db: @@ -178,7 +179,7 @@ serviceAccount: name: "" rbac: - ## @param rbac.create Specifies whether Openshift specific RBAC resources should be created + ## @param rbac.create Specifies whether Openshift-specific RBAC resources should be created create: true ## @param nameOverride Overrides the name of this Chart From c0ccc307c75617e9d53ef5449575eca3402c965f Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 23 Feb 2026 11:14:23 +0530 Subject: [PATCH 04/29] Updated README and LICENSE files to point to ones inside charts Signed-off-by: Chandrakala Subramanyam --- LICENSE | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 LICENSE mode change 100644 => 120000 README.md diff --git a/LICENSE b/LICENSE new file mode 120000 index 0000000..ab1e227 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +charts/kruize/LICENSE \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index fe71663..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# kruize-helm diff --git a/README.md b/README.md new file mode 120000 index 0000000..691c5b2 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +charts/kruize/README.md \ No newline at end of file From 17a066eb3b4ab62251209c81f4d6392a4996d90c Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 26 Feb 2026 22:20:08 +0530 Subject: [PATCH 05/29] Missed checking in manual storage class Signed-off-by: Chandrakala Subramanyam --- charts/kruize/templates/storage_manual.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 charts/kruize/templates/storage_manual.yaml diff --git a/charts/kruize/templates/storage_manual.yaml b/charts/kruize/templates/storage_manual.yaml new file mode 100644 index 0000000..72e8764 --- /dev/null +++ b/charts/kruize/templates/storage_manual.yaml @@ -0,0 +1,10 @@ +{{- if not (lookup "storage.k8s.io/v1" "StorageClass" "" "manual") }} +--- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: manual +provisioner: kubernetes.io/no-provisioner +reclaimPolicy: Retain +volumeBindingMode: Immediate +{{- end }} From 4c5b2da51c8622aa7eb5e5cbe256e916ae2aa0d1 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Wed, 18 Feb 2026 21:37:20 +0530 Subject: [PATCH 06/29] Initial helm charts for minikube Signed-off-by: Chandrakala Subramanyam --- charts/kruize/README.md | 50 ++++++++- charts/kruize/templates/cronjobs.yaml | 4 +- .../templates/kruize_db_deployment.yaml | 6 +- charts/kruize/templates/network_policy.yaml | 25 +++++ charts/kruize/templates/storage_pv.yaml | 6 +- charts/kruize/templates/storage_pvc.yaml | 2 +- charts/kruize/values-minikube.yaml | 100 ++++++++++++++++++ charts/kruize/values.yaml | 10 ++ 8 files changed, 196 insertions(+), 7 deletions(-) create mode 100644 charts/kruize/templates/network_policy.yaml create mode 100644 charts/kruize/values-minikube.yaml diff --git a/charts/kruize/README.md b/charts/kruize/README.md index 46b27a2..5138324 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -52,11 +52,25 @@ The following table lists the configurable parameters of the Kruize chart and th | `kruize.service.type` | Kruize service type | `NodePort` | | `kruize.service.port` | Kruize service port | `8080` | +### Kruize Environment Variables + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruize.env[].LOGGING_LEVEL` | Logging level for Kruize | `info` | +| `kruize.env[].ROOT_LOGGING_LEVEL` | Root logging level | `error` | +| `kruize.env[].DB_CONFIG_FILE` | Path to database configuration file | `/etc/config/dbconfigjson` | +| `kruize.env[].KRUIZE_CONFIG_FILE` | Path to Kruize configuration file | `/etc/config/kruizeconfigjson` | +| `kruize.env[].JAVA_TOOL_OPTIONS` | Java tool options | `-XX:MaxRAMPercentage=80` | +| `kruize.env[].KAFKA_BOOTSTRAP_SERVERS` | Kafka bootstrap servers | `kruize-kafka-cluster-kafka-bootstrap.kafka.svc.cluster.local:9092` | +| `kruize.env[].KAFKA_TOPICS` | Kafka topics | `recommendations-topic,error-topic,summary-topic` | +| `kruize.env[].KAFKA_RESPONSE_FILTER_INCLUDE` | Kafka response filter include patterns | `experiments\|status\|apis\|recommendations\|response\|status_history` | +| `kruize.env[].KAFKA_RESPONSE_FILTER_EXCLUDE` | Kafka response filter exclude patterns | `""` | + ### Kruize Configuration Parameters | Parameter | Description | Default | |-----------|-------------|---------| -| `kruize.config.clusterType` | Type of cluster (kubernetes/openshift) | `kubernetes` | +| `kruize.config.clusterType` | Type of cluster | `kubernetes` | | `kruize.config.k8sType` | Kubernetes distribution type | `openshift` | | `kruize.config.authType` | Authentication type | `""` | | `kruize.config.monitoringAgent` | Monitoring agent to use | `prometheus` | @@ -86,6 +100,36 @@ The following table lists the configurable parameters of the Kruize chart and th | `kruize.config.hibernate.showsql` | Show SQL queries | `false` | | `kruize.config.hibernate.timezone` | Database timezone | `UTC` | +### Kruize Logging Configuration + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruize.config.logging.cloudwatch.accessKeyId` | AWS CloudWatch access key ID | `""` | +| `kruize.config.logging.cloudwatch.logGroup` | CloudWatch log group | `kruize-logs` | +| `kruize.config.logging.cloudwatch.logStream` | CloudWatch log stream | `kruize-stream` | +| `kruize.config.logging.cloudwatch.region` | AWS region for CloudWatch | `""` | +| `kruize.config.logging.cloudwatch.secretAccessKey` | AWS CloudWatch secret access key | `""` | +| `kruize.config.logging.cloudwatch.logLevel` | CloudWatch log level | `INFO` | + +### Kruize Datasource Configuration + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `kruize.config.datasource[0].name` | Name of the first datasource | `prometheus-1` | +| `kruize.config.datasource[0].provider` | Provider type | `prometheus` | +| `kruize.config.datasource[0].serviceName` | Service name | `prometheus-k8s` | +| `kruize.config.datasource[0].namespace` | Namespace | `openshift-monitoring` | +| `kruize.config.datasource[0].url` | Datasource URL | `""` | +| `kruize.config.datasource[0].authentication.type` | Authentication type | `bearer` | +| `kruize.config.datasource[0].authentication.credentials.tokenFilePath` | Token file path | `/var/run/secrets/kubernetes.io/serviceaccount/token` | +| `kruize.config.datasource[1].name` | Name of the second datasource | `thanos-1` | +| `kruize.config.datasource[1].provider` | Provider type | `prometheus` | +| `kruize.config.datasource[1].serviceName` | Service name | `thanos-querier` | +| `kruize.config.datasource[1].namespace` | Namespace | `openshift-monitoring` | +| `kruize.config.datasource[1].url` | Datasource URL | `""` | +| `kruize.config.datasource[1].authentication.type` | Authentication type | `bearer` | +| `kruize.config.datasource[1].authentication.credentials.tokenFilePath` | Token file path | `/var/run/secrets/kubernetes.io/serviceaccount/token` | + ### Kruize Database Parameters | Parameter | Description | Default | @@ -103,6 +147,9 @@ The following table lists the configurable parameters of the Kruize chart and th | `db.pvc.storageClass` | Storage class for database PVC | `manual` | | `db.pvc.storageSize` | Storage size for database PVC | `500Mi` | | `db.pvc.hostPath` | Host path for database storage | `/mnt/data` | +| `db.pvc.accessModes` | Access modes for PVC | `[ReadWriteMany]` | +| `db.volumeMountPath` | Volume mount path for database data | `/var/lib/pgsql/data` | +| `db.pgData` | PGDATA environment variable value | `/var/lib/pg_data` | | `db.user` | User for Kruize DB container | `admin` | | `db.password` | Password for Kruize DB container | `admin` | | `db.adminUser` | Admin user for Kruize DB container | `admin` | @@ -143,6 +190,7 @@ The following table lists the configurable parameters of the Kruize chart and th | `rbac.create` | Specifies whether OpenShift-specific RBAC resources should be created | `true` | | `nameOverride` | Overrides the name of this Chart | `""` | | `fullnameOverride` | Overrides the fully qualified application name | `""` | +| `networkPolicy.enabled` | Enable NetworkPolicy resources | `false` | ## Example: Custom Values diff --git a/charts/kruize/templates/cronjobs.yaml b/charts/kruize/templates/cronjobs.yaml index 0c36e4c..a4deb20 100644 --- a/charts/kruize/templates/cronjobs.yaml +++ b/charts/kruize/templates/cronjobs.yaml @@ -32,7 +32,7 @@ spec: containers: - name: kruize-cron-create image: {{ $image }} - imagePullPolicy: IfNotPresent + imagePullPolicy: {{ .Values.kruize.image.pullPolicy }} volumeMounts: - name: config-volume mountPath: /etc/config @@ -70,7 +70,7 @@ spec: containers: - name: kruize-cron-delete image: {{ $image }} - imagePullPolicy: IfNotPresent + imagePullPolicy: {{ .Values.kruize.image.pullPolicy }} volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/charts/kruize/templates/kruize_db_deployment.yaml b/charts/kruize/templates/kruize_db_deployment.yaml index 0141a7f..8166938 100644 --- a/charts/kruize/templates/kruize_db_deployment.yaml +++ b/charts/kruize/templates/kruize_db_deployment.yaml @@ -29,8 +29,10 @@ spec: value: {{ .Values.db.user | quote }} - name: POSTGRES_DB value: {{ printf "%s-%s" .Values.db.name $fullName | quote }} + {{- if .Values.db.pgData }} - name: PGDATA - value: /var/lib/pg_data + value: {{ .Values.db.pgData }} + {{- end }} {{- if or .Values.db.resources.requests.memory .Values.db.resources.requests.cpu .Values.db.resources.limits.memory .Values.db.resources.limits.cpu }} resources: {{- if or .Values.db.resources.requests.memory .Values.db.resources.requests.cpu }} @@ -56,7 +58,7 @@ spec: - containerPort: {{ .Values.db.service.port }} volumeMounts: - name: kruize-db-storage - mountPath: /var/lib/pgsql/data + mountPath: {{ .Values.db.volumeMountPath }} volumes: - name: kruize-db-storage persistentVolumeClaim: diff --git a/charts/kruize/templates/network_policy.yaml b/charts/kruize/templates/network_policy.yaml new file mode 100644 index 0000000..4cda73d --- /dev/null +++ b/charts/kruize/templates/network_policy.yaml @@ -0,0 +1,25 @@ +{{- if .Values.networkPolicy.enabled -}} +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: {{ $fullName }}-to-prometheus + namespace: {{ .Release.Namespace }} + labels: + {{- include "kruize.labels" . | nindent 4 }} +spec: + podSelector: + matchLabels: + app.kubernetes.io/name: prometheus + policyTypes: + - Ingress + ingress: + - from: + - podSelector: + matchLabels: + {{- include "kruize.selectorLabels" . | nindent 14 }} + ports: + - protocol: TCP + port: 9090 +{{- end }} diff --git a/charts/kruize/templates/storage_pv.yaml b/charts/kruize/templates/storage_pv.yaml index 18ee82d..574c516 100644 --- a/charts/kruize/templates/storage_pv.yaml +++ b/charts/kruize/templates/storage_pv.yaml @@ -7,12 +7,16 @@ metadata: labels: type: local app: {{ $fullName }}-db + {{- include "kruize.labels" . | nindent 4 }} spec: storageClassName: {{ .Values.db.pvc.storageClass | quote }} capacity: storage: {{ .Values.db.pvc.storageSize | quote }} accessModes: - - ReadWriteMany + {{- toYaml .Values.db.pvc.accessModes | nindent 4 }} + {{- if .Values.db.pvc.reclaimPolicy }} + persistentVolumeReclaimPolicy: {{ .Values.db.pvc.reclaimPolicy }} + {{- end }} hostPath: path: {{ printf "%s/%s" .Values.db.pvc.hostPath $fullName | quote }} diff --git a/charts/kruize/templates/storage_pvc.yaml b/charts/kruize/templates/storage_pvc.yaml index a3d3167..311565e 100644 --- a/charts/kruize/templates/storage_pvc.yaml +++ b/charts/kruize/templates/storage_pvc.yaml @@ -10,7 +10,7 @@ metadata: spec: storageClassName: {{ .Values.db.pvc.storageClass | quote }} accessModes: - - ReadWriteMany + {{- toYaml .Values.db.pvc.accessModes | nindent 4 }} resources: requests: storage: {{ .Values.db.pvc.storageSize | quote }} diff --git a/charts/kruize/values-minikube.yaml b/charts/kruize/values-minikube.yaml new file mode 100644 index 0000000..d9aa40c --- /dev/null +++ b/charts/kruize/values-minikube.yaml @@ -0,0 +1,100 @@ +# Minikube-specific values for Kruize Helm Chart +# This file overrides the default values.yaml for minikube deployments + +# Kruize Configuration +kruize: + # Disable resource requests/limits for minikube + resources: + requests: + memory: "" + cpu: "" + limits: + memory: "" + cpu: "" + + config: + k8sType: "minikube" + + # Hibernate configuration - override only changed values + hibernate: + c3p0minsize: 2 + c3p0maxsize: 5 + c3p0maxstatements: 50 + + # Datasource configuration for minikube (single prometheus instance) + datasource: + - name: "prometheus-1" + provider: "prometheus" + serviceName: "prometheus-k8s" + namespace: "monitoring" + url: "" + authentication: + type: "" + credentials: + tokenFilePath: "" + + env: + - name: LOGGING_LEVEL + value: "info" + - name: ROOT_LOGGING_LEVEL + value: "error" + - name: DB_CONFIG_FILE + value: "/etc/config/dbconfigjson" + - name: KRUIZE_CONFIG_FILE + value: "/etc/config/kruizeconfigjson" + - name: JAVA_TOOL_OPTIONS + value: "-XX:MaxRAMPercentage=80" + - name: KAFKA_BOOTSTRAP_SERVERS + value: "kruize-kafka-cluster-kafka-bootstrap.kafka.svc.cluster.local:9092" + - name: KAFKA_TOPICS + value: "recommendations-topic,error-topic,summary-topic" + - name: KAFKA_RESPONSE_FILTER_INCLUDE + value: "summary" + - name: KAFKA_RESPONSE_FILTER_EXCLUDE + value: "" + +# Database Configuration +db: + # Volume mount path for minikube + volumeMountPath: "/var/lib/postgresql/data" + # Disable PGDATA for minikube + pgData: "" + + # Disable resource requests/limits for minikube + resources: + requests: + memory: "" + cpu: "" + limits: + memory: "" + cpu: "" + + pvc: + storageSize: "1Gi" + hostPath: "/data/postgres" + storageClass: "manual" + accessModes: + - ReadWriteOnce + reclaimPolicy: "Retain" + +# RBAC Configuration +rbac: + # Disable OpenShift-specific RBAC resources for minikube + create: false + +# Service Account Configuration +serviceAccount: + # Use default service account in minikube + create: false + name: "default" + +# Network Policy Configuration +networkPolicy: + # Enable network policy for minikube + enabled: true + +# Monitoring Configuration +monitoring: + enabled: true + interval: 30s + diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml index 0ff84f9..26d9bd9 100644 --- a/charts/kruize/values.yaml +++ b/charts/kruize/values.yaml @@ -141,6 +141,8 @@ db: storageClass: manual storageSize: "500Mi" hostPath: "/mnt/data" + accessModes: + - ReadWriteMany ## @param db.user User for Kruize DB container user: admin ## @param db.password User for Kruize DB container @@ -151,6 +153,10 @@ db: adminPassword: admin ## @param db.name Name of the Kruize DB name: kruizeDB + ## @param db.volumeMountPath Volume mount path for database data + volumeMountPath: "/var/lib/pgsql/data" + ## @param db.pgData PGDATA environment variable value + pgData: "/var/lib/pg_data" sslMode: require # Kruize UI Configuration @@ -190,3 +196,7 @@ fullnameOverride: "" monitoring: enabled: true interval: 30s + +networkPolicy: + ## @param networkPolicy.enabled Enable NetworkPolicy resources + enabled: false From c8ebf3778b1dd50691cfca90f70079de541836fc Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 3 Mar 2026 18:56:13 +0530 Subject: [PATCH 07/29] Updated labels Signed-off-by: Chandrakala Subramanyam --- charts/kruize/templates/kruize_db_deployment.yaml | 3 +++ charts/kruize/templates/kruize_db_service.yaml | 2 ++ charts/kruize/templates/kruize_deployment.yaml | 3 +++ charts/kruize/templates/kruize_service.yaml | 2 ++ charts/kruize/templates/kruize_ui_nginx_pod.yaml | 2 +- charts/kruize/templates/kruize_ui_nginx_service.yaml | 4 +++- charts/kruize/templates/network_policy.yaml | 1 + charts/kruize/templates/service_monitor.yaml | 2 ++ 8 files changed, 17 insertions(+), 2 deletions(-) diff --git a/charts/kruize/templates/kruize_db_deployment.yaml b/charts/kruize/templates/kruize_db_deployment.yaml index 8166938..4a3162a 100644 --- a/charts/kruize/templates/kruize_db_deployment.yaml +++ b/charts/kruize/templates/kruize_db_deployment.yaml @@ -6,15 +6,18 @@ metadata: name: {{ include "kruize.deploymentName" . }}-db namespace: {{ .Release.Namespace }} labels: + {{- include "kruize.labels" . | nindent 4 }} app: {{ $fullName }}-db spec: replicas: 1 selector: matchLabels: + {{- include "kruize.selectorLabels" . | nindent 6 }} app: {{ $fullName }}-db template: metadata: labels: + {{- include "kruize.selectorLabels" . | nindent 8 }} app: {{ $fullName }}-db spec: serviceAccountName: {{ include "kruize.serviceAccountName" . }} diff --git a/charts/kruize/templates/kruize_db_service.yaml b/charts/kruize/templates/kruize_db_service.yaml index c951846..5195dff 100644 --- a/charts/kruize/templates/kruize_db_service.yaml +++ b/charts/kruize/templates/kruize_db_service.yaml @@ -6,6 +6,7 @@ metadata: name: {{ $fullName }}-db-service namespace: {{ .Release.Namespace }} labels: + {{- include "kruize.labels" . | nindent 4 }} app: {{ $fullName }}-db spec: type: {{ .Values.db.service.type }} @@ -14,4 +15,5 @@ spec: port: {{ .Values.db.service.port }} targetPort: {{ .Values.db.service.port }} selector: + {{- include "kruize.labels" . | nindent 4 }} app: {{ $fullName }}-db diff --git a/charts/kruize/templates/kruize_deployment.yaml b/charts/kruize/templates/kruize_deployment.yaml index 470adb3..f769628 100644 --- a/charts/kruize/templates/kruize_deployment.yaml +++ b/charts/kruize/templates/kruize_deployment.yaml @@ -5,6 +5,8 @@ kind: Deployment metadata: name: {{ include "kruize.deploymentName" . }} namespace: {{ .Release.Namespace }} + labels: + app: {{ $fullName }} spec: replicas: {{ .Values.kruize.replicaCount | default 1 }} selector: @@ -14,6 +16,7 @@ spec: metadata: labels: {{- include "kruize.selectorLabels" . | nindent 8 }} + app: {{ $fullName }} spec: serviceAccountName: {{ include "kruize.serviceAccountName" . }} initContainers: diff --git a/charts/kruize/templates/kruize_service.yaml b/charts/kruize/templates/kruize_service.yaml index 6ea0ab9..9a6bc5b 100644 --- a/charts/kruize/templates/kruize_service.yaml +++ b/charts/kruize/templates/kruize_service.yaml @@ -10,10 +10,12 @@ metadata: prometheus.io/path: '/metrics' labels: {{- include "kruize.labels" . | nindent 4 }} + app: {{ $fullName }} spec: type: {{ .Values.kruize.service.type }} selector: {{- include "kruize.selectorLabels" . | nindent 4 }} + app: {{ $fullName }} ports: - name: kruize-port port: {{ .Values.kruize.service.port }} diff --git a/charts/kruize/templates/kruize_ui_nginx_pod.yaml b/charts/kruize/templates/kruize_ui_nginx_pod.yaml index efa2799..1546756 100644 --- a/charts/kruize/templates/kruize_ui_nginx_pod.yaml +++ b/charts/kruize/templates/kruize_ui_nginx_pod.yaml @@ -6,7 +6,7 @@ metadata: name: {{ $fullName }}-ui-nginx-pod namespace: {{ .Release.Namespace }} labels: - app: kruize-ui-nginx + app: {{ $fullName }}-ui-nginx spec: containers: - name: kruize-ui-nginx-container diff --git a/charts/kruize/templates/kruize_ui_nginx_service.yaml b/charts/kruize/templates/kruize_ui_nginx_service.yaml index 499ccac..bf4e54a 100644 --- a/charts/kruize/templates/kruize_ui_nginx_service.yaml +++ b/charts/kruize/templates/kruize_ui_nginx_service.yaml @@ -5,6 +5,8 @@ kind: Service metadata: name: {{ $fullName }}-ui-nginx-service namespace: {{ .Release.Namespace }} + labels: + app: {{ $fullName }}-ui-nginx spec: type: {{ .Values.kruizeUI.service.type }} ports: @@ -12,4 +14,4 @@ spec: port: {{ .Values.kruizeUI.service.port }} targetPort: {{ .Values.kruizeUI.service.port }} selector: - app: kruize-ui-nginx + app: {{ $fullName }}-ui-nginx diff --git a/charts/kruize/templates/network_policy.yaml b/charts/kruize/templates/network_policy.yaml index 4cda73d..5f3be99 100644 --- a/charts/kruize/templates/network_policy.yaml +++ b/charts/kruize/templates/network_policy.yaml @@ -19,6 +19,7 @@ spec: - podSelector: matchLabels: {{- include "kruize.selectorLabels" . | nindent 14 }} + app: {{ $fullName }} ports: - protocol: TCP port: 9090 diff --git a/charts/kruize/templates/service_monitor.yaml b/charts/kruize/templates/service_monitor.yaml index 56f6087..92274bb 100644 --- a/charts/kruize/templates/service_monitor.yaml +++ b/charts/kruize/templates/service_monitor.yaml @@ -7,10 +7,12 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "kruize.labels" . | nindent 4 }} + app: {{ $fullName }} spec: selector: matchLabels: {{- include "kruize.selectorLabels" . | nindent 6 }} + app: {{ $fullName }} endpoints: - port: kruize-port interval: {{ .Values.monitoring.interval }} From 545e26522ccd0aa8e7f4eb0dca315bfe6c795d94 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 3 Mar 2026 19:40:33 +0530 Subject: [PATCH 08/29] Fixed the selector label Signed-off-by: Chandrakala Subramanyam --- charts/kruize/templates/kruize_db_service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kruize/templates/kruize_db_service.yaml b/charts/kruize/templates/kruize_db_service.yaml index 5195dff..a5cb095 100644 --- a/charts/kruize/templates/kruize_db_service.yaml +++ b/charts/kruize/templates/kruize_db_service.yaml @@ -15,5 +15,5 @@ spec: port: {{ .Values.db.service.port }} targetPort: {{ .Values.db.service.port }} selector: - {{- include "kruize.labels" . | nindent 4 }} + {{- include "kruize.selectorLabels" . | nindent 4 }} app: {{ $fullName }}-db From 242777c59a758a22e05ed5a93f4e25aed49b78a9 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Wed, 4 Mar 2026 12:57:40 +0530 Subject: [PATCH 09/29] Fixed issues with rbac, included options to append rel name to db Signed-off-by: Chandrakala Subramanyam --- charts/kruize/.helmignore | 23 +++++++++++++++++++ charts/kruize/README.md | 1 + charts/kruize/templates/configmap_kruize.yaml | 2 +- .../templates/kruize_db_deployment.yaml | 2 +- charts/kruize/templates/rolebinding.yaml | 6 +++-- charts/kruize/values.yaml | 2 ++ 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 charts/kruize/.helmignore diff --git a/charts/kruize/.helmignore b/charts/kruize/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/kruize/.helmignore @@ -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/ diff --git a/charts/kruize/README.md b/charts/kruize/README.md index 5138324..54cc288 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -155,6 +155,7 @@ The following table lists the configurable parameters of the Kruize chart and th | `db.adminUser` | Admin user for Kruize DB container | `admin` | | `db.adminPassword` | Admin password for Kruize DB container | `admin` | | `db.name` | Name of the Kruize DB | `kruizeDB` | +| `db.includeReleaseNameInDbName` | Include release name in database name for multi-instance support | `false` | | `db.sslMode` | SSL mode for database connection | `require` | ### Kruize UI Parameters diff --git a/charts/kruize/templates/configmap_kruize.yaml b/charts/kruize/templates/configmap_kruize.yaml index e23c393..a956909 100644 --- a/charts/kruize/templates/configmap_kruize.yaml +++ b/charts/kruize/templates/configmap_kruize.yaml @@ -12,7 +12,7 @@ data: "adminPassword": {{ .Values.db.adminPassword | quote }}, "adminUsername": {{ .Values.db.adminUser | quote }}, "hostname": "{{ $fullName }}-db-service", - "name": {{ printf "%s-%s" .Values.db.name $fullName | quote }}, + "name": {{ if .Values.db.includeReleaseNameInDbName }}{{ printf "%s-%s" .Values.db.name $fullName | quote }}{{ else }}{{ .Values.db.name | quote }}{{ end }}, "password": {{ .Values.db.password | quote }}, "port": {{ .Values.db.service.port | quote }}, "sslMode": {{ .Values.db.sslMode | quote }}, diff --git a/charts/kruize/templates/kruize_db_deployment.yaml b/charts/kruize/templates/kruize_db_deployment.yaml index 4a3162a..8175751 100644 --- a/charts/kruize/templates/kruize_db_deployment.yaml +++ b/charts/kruize/templates/kruize_db_deployment.yaml @@ -31,7 +31,7 @@ spec: - name: POSTGRES_USER value: {{ .Values.db.user | quote }} - name: POSTGRES_DB - value: {{ printf "%s-%s" .Values.db.name $fullName | quote }} + value: {{ if .Values.db.includeReleaseNameInDbName }}{{ printf "%s-%s" .Values.db.name $fullName | quote }}{{ else }}{{ .Values.db.name | quote }}{{ end }} {{- if .Values.db.pgData }} - name: PGDATA value: {{ .Values.db.pgData }} diff --git a/charts/kruize/templates/rolebinding.yaml b/charts/kruize/templates/rolebinding.yaml index 440c3c8..f57d02d 100644 --- a/charts/kruize/templates/rolebinding.yaml +++ b/charts/kruize/templates/rolebinding.yaml @@ -13,7 +13,8 @@ roleRef: kind: ClusterRole name: {{ $fullName }}-recommendation-updater --- -{{- if .Values.rbac.create -}} +{{- if .Values.rbac.create }} +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -54,7 +55,8 @@ roleRef: name: {{ $fullName }}-edit-ko apiGroup: rbac.authorization.k8s.io --- -{{- if .Values.rbac.create -}} +{{- if .Values.rbac.create }} +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml index 26d9bd9..c4f6df7 100644 --- a/charts/kruize/values.yaml +++ b/charts/kruize/values.yaml @@ -153,6 +153,8 @@ db: adminPassword: admin ## @param db.name Name of the Kruize DB name: kruizeDB + ## @param db.includeReleaseNameInDbName Include release name in database name for multi-instance support + includeReleaseNameInDbName: false ## @param db.volumeMountPath Volume mount path for database data volumeMountPath: "/var/lib/pgsql/data" ## @param db.pgData PGDATA environment variable value From bc5bd51edec17f558613134c40db03e27e2d907d Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Fri, 6 Mar 2026 01:22:36 +0530 Subject: [PATCH 10/29] Updated deployment name Signed-off-by: Chandrakala Subramanyam --- charts/kruize/templates/_helpers.tpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/kruize/templates/_helpers.tpl b/charts/kruize/templates/_helpers.tpl index d3ed9e2..6dd828c 100644 --- a/charts/kruize/templates/_helpers.tpl +++ b/charts/kruize/templates/_helpers.tpl @@ -62,10 +62,9 @@ Create the name of the service account to use. {{- end }} {{/* -Get the name for managed deployments. +Create the name of the deployment. */}} {{- define "kruize.deploymentName" -}} -{{- $version := semver .Chart.AppVersion -}} -{{- printf "%s-v%d" (include "kruize.fullname" .) $version.Major -}} +{{- include "kruize.fullname" . -}} {{- end -}} From cb3374e29fc79c59010b1451e8c1340f613522df Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 19 Mar 2026 18:28:52 +0530 Subject: [PATCH 11/29] Updated prometheus as a pre-requisite for minikube & kind cluster Signed-off-by: Chandrakala Subramanyam --- charts/kruize/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/kruize/README.md b/charts/kruize/README.md index 54cc288..c3fb7b8 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -8,8 +8,9 @@ Kruize is an intelligent resource optimization platform that helps you optimize ## Prerequisites -- Kubernetes 1.19+ or OpenShift 4.x+ +- Kubernetes 1.23.0+ or OpenShift 4.10+ - Helm 3.0+ +- [Prometheus](https://github.com/prometheus/prometheus) (for Minikube, Kind clusters) ## Installing the Chart From e24321d7680df79e751f5228b792b8c4c503fe73 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 30 Mar 2026 15:55:16 +0530 Subject: [PATCH 12/29] Addressed review comments Signed-off-by: Chandrakala Subramanyam --- charts/kruize/templates/kruize_db_deployment.yaml | 2 +- charts/kruize/templates/rolebinding.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/kruize/templates/kruize_db_deployment.yaml b/charts/kruize/templates/kruize_db_deployment.yaml index 8175751..ad05547 100644 --- a/charts/kruize/templates/kruize_db_deployment.yaml +++ b/charts/kruize/templates/kruize_db_deployment.yaml @@ -17,7 +17,7 @@ spec: template: metadata: labels: - {{- include "kruize.selectorLabels" . | nindent 8 }} + {{- include "kruize.selectorLabels" . | nindent 8 }} app: {{ $fullName }}-db spec: serviceAccountName: {{ include "kruize.serviceAccountName" . }} diff --git a/charts/kruize/templates/rolebinding.yaml b/charts/kruize/templates/rolebinding.yaml index f57d02d..6132942 100644 --- a/charts/kruize/templates/rolebinding.yaml +++ b/charts/kruize/templates/rolebinding.yaml @@ -14,7 +14,6 @@ roleRef: name: {{ $fullName }}-recommendation-updater --- {{- if .Values.rbac.create }} ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -56,7 +55,6 @@ roleRef: apiGroup: rbac.authorization.k8s.io --- {{- if .Values.rbac.create }} ---- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: From cdde1ce7ed6df9ff7622dfbc84e697e2fef70b3d Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 30 Mar 2026 18:00:33 +0530 Subject: [PATCH 13/29] Fixed document separators Signed-off-by: Chandrakala Subramanyam --- charts/kruize/templates/rolebinding.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/kruize/templates/rolebinding.yaml b/charts/kruize/templates/rolebinding.yaml index 6132942..11ed5fa 100644 --- a/charts/kruize/templates/rolebinding.yaml +++ b/charts/kruize/templates/rolebinding.yaml @@ -26,8 +26,8 @@ roleRef: kind: ClusterRole name: cluster-monitoring-view apiGroup: rbac.authorization.k8s.io -{{- end }} --- +{{- end }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -67,4 +67,5 @@ subjects: - kind: ServiceAccount name: {{ include "kruize.serviceAccountName" . }} namespace: {{ .Release.Namespace }} +--- {{- end }} From 5794b6201a6a63069a4cbf70944b2fb3d145ab04 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 3 Mar 2026 13:45:21 +0530 Subject: [PATCH 14/29] Included helm chart unit tests Signed-off-by: Chandrakala Subramanyam --- .../templates/tests/test-connection.yaml | 16 -- charts/kruize/tests/README.md | 193 ++++++++++++++++ charts/kruize/tests/configmap_test.yaml | 61 +++++ charts/kruize/tests/cronjobs_test.yaml | 106 +++++++++ .../tests/kruize_db_deployment_test.yaml | 119 ++++++++++ .../kruize/tests/kruize_db_service_test.yaml | 63 ++++++ .../kruize/tests/kruize_deployment_test.yaml | 148 ++++++++++++ charts/kruize/tests/kruize_service_test.yaml | 78 +++++++ charts/kruize/tests/kruize_ui_test.yaml | 132 +++++++++++ .../minikube/configmap_minikube_test.yaml | 64 ++++++ .../minikube/cronjobs_minikube_test.yaml | 108 +++++++++ .../kruize_db_deployment_minikube_test.yaml | 43 ++++ .../kruize_db_service_minikube_test.yaml | 66 ++++++ .../kruize_deployment_minikube_test.yaml | 123 ++++++++++ .../kruize_service_minikube_test.yaml | 78 +++++++ .../minikube/kruize_ui_minikube_test.yaml | 133 +++++++++++ .../network_policy_minikube_test.yaml | 64 ++++++ .../tests/minikube/rbac_minikube_test.yaml | 159 +++++++++++++ .../service_monitor_minikube_test.yaml | 71 ++++++ .../tests/minikube/storage_minikube_test.yaml | 112 ++++++++++ charts/kruize/tests/network_policy_test.yaml | 66 ++++++ charts/kruize/tests/rbac_test.yaml | 211 ++++++++++++++++++ charts/kruize/tests/service_monitor_test.yaml | 76 +++++++ charts/kruize/tests/storage_test.yaml | 107 +++++++++ 24 files changed, 2381 insertions(+), 16 deletions(-) delete mode 100644 charts/kruize/templates/tests/test-connection.yaml create mode 100644 charts/kruize/tests/README.md create mode 100644 charts/kruize/tests/configmap_test.yaml create mode 100644 charts/kruize/tests/cronjobs_test.yaml create mode 100644 charts/kruize/tests/kruize_db_deployment_test.yaml create mode 100644 charts/kruize/tests/kruize_db_service_test.yaml create mode 100644 charts/kruize/tests/kruize_deployment_test.yaml create mode 100644 charts/kruize/tests/kruize_service_test.yaml create mode 100644 charts/kruize/tests/kruize_ui_test.yaml create mode 100644 charts/kruize/tests/minikube/configmap_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/cronjobs_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/kruize_service_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/network_policy_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/rbac_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/service_monitor_minikube_test.yaml create mode 100644 charts/kruize/tests/minikube/storage_minikube_test.yaml create mode 100644 charts/kruize/tests/network_policy_test.yaml create mode 100644 charts/kruize/tests/rbac_test.yaml create mode 100644 charts/kruize/tests/service_monitor_test.yaml create mode 100644 charts/kruize/tests/storage_test.yaml diff --git a/charts/kruize/templates/tests/test-connection.yaml b/charts/kruize/templates/tests/test-connection.yaml deleted file mode 100644 index b6b8b0f..0000000 --- a/charts/kruize/templates/tests/test-connection.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "kruize.fullname" . }}-test-connection" - labels: - {{- include "kruize.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "kruize.fullname" . }}:{{ .Values.kruize.service.port }}'] - restartPolicy: Never - diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md new file mode 100644 index 0000000..1f24f6e --- /dev/null +++ b/charts/kruize/tests/README.md @@ -0,0 +1,193 @@ +# Kruize Helm Chart Tests + +This directory contains unit tests for the Kruize Helm chart using the [helm-unittest](https://github.com/helm-unittest/helm-unittest) plugin. + +## Prerequisites + +Install the helm-unittest plugin: + +```bash +helm plugin install https://github.com/helm-unittest/helm-unittest +``` + +## Running Tests + +### Run All Tests (OpenShift/default values) + +```bash +helm unittest -f 'tests/*.yaml' charts/kruize +``` + +### Run Minikube-specific Tests + +```bash +helm unittest -f 'tests/minikube/*.yaml' charts/kruize +``` + +### Run All Tests (default + minikube) + +```bash +helm unittest charts/kruize +``` + +### Run a Specific Test File + +```bash +helm unittest -f 'tests/kruize_deployment_test.yaml' charts/kruize +``` + +### Run Tests with Verbose Output + +```bash +helm unittest -v charts/kruize +``` + +### Generate JUnit Test Report + +```bash +helm unittest --output-type JUnit --output-file test-results.xml charts/kruize +``` + +## Test Structure + +``` +tests/ +├── configmap_test.yaml # Tests for configmap_kruize.yaml and configmap_nginx.yaml +├── cronjobs_test.yaml # Tests for cronjobs.yaml +├── kruize_db_deployment_test.yaml # Tests for kruize_db_deployment.yaml +├── kruize_db_service_test.yaml # Tests for kruize_db_service.yaml +├── kruize_deployment_test.yaml # Tests for kruize_deployment.yaml +├── kruize_service_test.yaml # Tests for kruize_service.yaml +├── kruize_ui_test.yaml # Tests for kruize_ui_nginx_pod.yaml and kruize_ui_nginx_service.yaml +├── network_policy_test.yaml # Tests for network_policy.yaml +├── rbac_test.yaml # Tests for service_account.yaml, role.yaml, rolebinding.yaml +├── service_monitor_test.yaml # Tests for service_monitor.yaml +├── storage_test.yaml # Tests for storage_pv.yaml and storage_pvc.yaml +└── minikube/ + ├── kruize_db_deployment_minikube_test.yaml # DB deployment tests with values-minikube.yaml + ├── kruize_deployment_minikube_test.yaml # Kruize deployment tests with values-minikube.yaml + ├── network_policy_minikube_test.yaml # Network policy tests with values-minikube.yaml + ├── rbac_minikube_test.yaml # RBAC tests with values-minikube.yaml + └── storage_minikube_test.yaml # Storage tests with values-minikube.yaml +``` + +## Environment-specific Tests + +Tests in `tests/` use the default `values.yaml` (OpenShift deployment). + +Tests in `tests/minikube/` use `values-minikube.yaml` on top of `values.yaml` via the `values:` field in each test suite. These tests validate minikube-specific behaviour such as: + +- `serviceAccount.create: false` — uses the `default` service account +- `rbac.create: false` — skips OpenShift-specific ClusterRoleBindings +- `db.pgData: ""` — PGDATA env var is not set +- `db.volumeMountPath: /var/lib/postgresql/data` — minikube postgres path +- `db.pvc.accessModes: [ReadWriteOnce]` — minikube storage access mode +- `networkPolicy.enabled: true` — network policy is enabled on minikube +- Empty resource requests/limits — no resource constraints on minikube + +## Test File Structure + +Each test file follows the cryostat-helm style: + +```yaml +suite: test +templates: + - + +tests: + - it: should create a with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: + - equal: + path: metadata.name + value: RELEASE-NAME- + # ... all default assertions grouped together + + - it: should create a with the correct settings overrides + set: + some.value: override + asserts: + - equal: + path: spec.someField + value: override + + - it: should create a in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace +``` + +## Common Assertions + +- `equal` - Checks if a value equals the expected value +- `notEqual` - Checks if a value does not equal the expected value +- `exists` - Checks if a path exists +- `notExists` - Checks if a path does not exist +- `contains` - Checks if an array contains a specific element +- `hasDocuments` - Checks the number of documents in the output +- `matchRegex` - Checks if a value matches a regex pattern + +## Continuous Integration + +```yaml +# Example GitHub Actions workflow +- name: Install Helm + uses: azure/setup-helm@v3 + +- name: Install helm-unittest plugin + run: helm plugin install https://github.com/helm-unittest/helm-unittest + +- name: Run Helm tests (OpenShift) + run: helm unittest -f 'tests/*.yaml' charts/kruize + +- name: Run Helm tests (Minikube) + run: helm unittest -f 'tests/minikube/*.yaml' charts/kruize +``` + +## Adding New Tests + +When adding new templates or modifying existing ones: + +1. Create or update the corresponding test file in `charts/kruize/tests/` +2. Follow the naming convention: `_test.yaml` +3. For minikube-specific behaviour, add a corresponding file in `charts/kruize/tests/minikube/` with `values: - ../../values-minikube.yaml` +4. Include tests for: + - Default values (from `values.yaml`) + - Settings overrides (using `set:`) + - Conditional resource creation (enabled/disabled flags) + - Namespace propagation (using `release.namespace`) + - Label and selector validation + +## Troubleshooting + +### Plugin Not Found + +```bash +helm plugin list +helm plugin install https://github.com/helm-unittest/helm-unittest +``` + +### Test Failures + +Run with verbose output to see detailed failure information: +```bash +helm unittest -v charts/kruize +``` + +### Debugging Specific Tests + +```bash +helm unittest -f 'tests/kruize_deployment_test.yaml' -v charts/kruize +``` + +## Resources + +- [Helm Unittest Documentation](https://github.com/helm-unittest/helm-unittest/blob/main/DOCUMENT.md) +- [Helm Chart Testing Guide](https://helm.sh/docs/topics/chart_tests/) \ No newline at end of file diff --git a/charts/kruize/tests/configmap_test.yaml b/charts/kruize/tests/configmap_test.yaml new file mode 100644 index 0000000..4b2f4a8 --- /dev/null +++ b/charts/kruize/tests/configmap_test.yaml @@ -0,0 +1,61 @@ +suite: test configmap templates +templates: + - configmap_kruize.yaml + - configmap_nginx.yaml + +tests: + - it: should create a kruize ConfigMap with the correct default settings + template: configmap_kruize.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ConfigMap + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-config + - exists: + path: data.dbconfigjson + - exists: + path: data.kruizeconfigjson + + - it: should create a kruize ConfigMap in the release namespace + template: configmap_kruize.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + - it: should create a nginx ConfigMap with the correct default settings + template: configmap_nginx.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ConfigMap + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-nginx-config + - exists: + path: data["nginx.conf"] + + - it: should create a nginx ConfigMap in the release namespace + template: configmap_nginx.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + +# Made by Bob diff --git a/charts/kruize/tests/cronjobs_test.yaml b/charts/kruize/tests/cronjobs_test.yaml new file mode 100644 index 0000000..fed6799 --- /dev/null +++ b/charts/kruize/tests/cronjobs_test.yaml @@ -0,0 +1,106 @@ +suite: test cronjobs.yaml +templates: + - cronjobs.yaml + +tests: + - it: should create two CronJob documents + asserts: + - hasDocuments: + count: 2 + + - it: should create a create-partition CronJob with the correct default settings + documentIndex: 0 + asserts: + - equal: + path: kind + value: CronJob + - equal: + path: apiVersion + value: batch/v1 + - equal: + path: metadata.name + value: RELEASE-NAME-create-partition + - equal: + path: spec.schedule + value: "0 0 25 * *" + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].name + value: kruize-cron-create + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].image + value: "quay.io/kruize/autotune_operator:0.8.1" + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].imagePullPolicy + value: Always + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts[0].name + value: config-volume + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts[0].mountPath + value: /etc/config + - equal: + path: spec.jobTemplate.spec.template.spec.restartPolicy + value: OnFailure + - equal: + path: spec.jobTemplate.spec.template.spec.volumes[0].configMap.name + value: RELEASE-NAME-kruize-config + + - it: should create a delete-partition CronJob with the correct default settings + documentIndex: 1 + asserts: + - equal: + path: kind + value: CronJob + - equal: + path: metadata.name + value: RELEASE-NAME-delete-partition + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].name + value: kruize-cron-delete + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].image + value: "quay.io/kruize/autotune_operator:0.8.1" + - contains: + path: spec.jobTemplate.spec.template.spec.containers[0].env + content: + name: deletepartitionsthreshold + value: "15" + - equal: + path: spec.jobTemplate.spec.template.spec.restartPolicy + value: OnFailure + + - it: should create CronJobs with the correct settings overrides + documentIndex: 0 + set: + cronJob.createSchedule: "0 0 1 * *" + kruize.image.tag: "0.9.0" + asserts: + - equal: + path: spec.schedule + value: "0 0 1 * *" + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].image + value: "quay.io/kruize/autotune_operator:0.9.0" + + - it: should use custom deletePartitionsThreshold when specified + documentIndex: 1 + set: + cronJob.deletePartitionsThreshold: "30" + asserts: + - contains: + path: spec.jobTemplate.spec.template.spec.containers[0].env + content: + name: deletepartitionsthreshold + value: "30" + + - it: should create CronJobs in the release namespace + documentIndex: 0 + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/kruize_db_deployment_test.yaml b/charts/kruize/tests/kruize_db_deployment_test.yaml new file mode 100644 index 0000000..bdc6044 --- /dev/null +++ b/charts/kruize/tests/kruize_db_deployment_test.yaml @@ -0,0 +1,119 @@ +suite: test kruize_db_deployment.yaml +templates: + - kruize_db_deployment.yaml + +tests: + - it: should create a Deployment with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db + - equal: + path: spec.replicas + value: 1 + - equal: + path: spec.selector.matchLabels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.template.metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.template.spec.serviceAccountName + value: RELEASE-NAME-kruize + + - it: should validate kruize-db container settings + asserts: + - exists: + path: spec.template.spec.containers[?(@.name=='kruize-db')] + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].image + value: "quay.io/kruizehub/postgres:15.2" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].imagePullPolicy + value: "IfNotPresent" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].env[?(@.name=='POSTGRES_PASSWORD')] + value: + name: POSTGRES_PASSWORD + value: "admin" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].env[?(@.name=='POSTGRES_USER')] + value: + name: POSTGRES_USER + value: "admin" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].env[?(@.name=='POSTGRES_DB')] + value: + name: POSTGRES_DB + value: "kruizeDB" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].env[?(@.name=='PGDATA')] + value: + name: PGDATA + value: "/var/lib/pg_data" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].ports[0].containerPort + value: 5432 + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].volumeMounts[0].mountPath + value: "/var/lib/pgsql/data" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].volumeMounts[0].name + value: "kruize-db-storage" + + - it: should validate resource settings + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.requests.memory + value: "100Mi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.requests.cpu + value: "0.5" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.limits.memory + value: "100Mi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.limits.cpu + value: "0.5" + + - it: should validate volume configuration + asserts: + - equal: + path: spec.template.spec.volumes[0].name + value: "kruize-db-storage" + - equal: + path: spec.template.spec.volumes[0].persistentVolumeClaim.claimName + value: "RELEASE-NAME-kruize-db-pv-claim" + + - it: should create a Deployment with the correct settings overrides + set: + db.image.tag: "16.0" + db.resources.requests.memory: "256Mi" + db.resources.requests.cpu: "1" + db.resources.limits.memory: "512Mi" + db.resources.limits.cpu: "2" + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].image + value: "quay.io/kruizehub/postgres:16.0" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.requests.memory + value: "256Mi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.requests.cpu + value: "1" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.limits.memory + value: "512Mi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources.limits.cpu + value: "2" + + +# Made by Bob +# Made by Bob diff --git a/charts/kruize/tests/kruize_db_service_test.yaml b/charts/kruize/tests/kruize_db_service_test.yaml new file mode 100644 index 0000000..e062232 --- /dev/null +++ b/charts/kruize/tests/kruize_db_service_test.yaml @@ -0,0 +1,63 @@ +suite: test kruize_db_service.yaml +templates: + - kruize_db_service.yaml + +tests: + - it: should create a Service with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Service + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db-service + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.type + value: ClusterIP + - equal: + path: spec.ports[0].name + value: kruize-db-port + - equal: + path: spec.ports[0].port + value: 5432 + - equal: + path: spec.ports[0].targetPort + value: 5432 + - equal: + path: spec.selector.app + value: RELEASE-NAME-kruize-db + + - it: should create a Service with the correct settings overrides + set: + db.service.type: NodePort + db.service.port: 5433 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.type + value: NodePort + - equal: + path: spec.ports[0].port + value: 5433 + - equal: + path: spec.ports[0].targetPort + value: 5433 + + - it: should create a Service in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + +# Made by Bob diff --git a/charts/kruize/tests/kruize_deployment_test.yaml b/charts/kruize/tests/kruize_deployment_test.yaml new file mode 100644 index 0000000..b5a12a5 --- /dev/null +++ b/charts/kruize/tests/kruize_deployment_test.yaml @@ -0,0 +1,148 @@ +suite: test kruize_deployment.yaml +templates: + - kruize_deployment.yaml + +tests: + - it: should create a Deployment with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-kruize + - equal: + path: spec.replicas + value: 1 + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.template.metadata.labels + value: + app: RELEASE-NAME-kruize + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.template.spec.serviceAccountName + value: RELEASE-NAME-kruize + + - it: should validate init container for database wait + asserts: + - exists: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')] + - equal: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')].image + value: "quay.io/kruizehub/postgres:15.2" + - contains: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')].command + content: "sh" + - contains: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')].command + content: "-c" + + - it: should validate kruize container settings + asserts: + - exists: + path: spec.template.spec.containers[?(@.name=='kruize')] + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].image + value: "quay.io/kruize/autotune_operator:0.8.1" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].imagePullPolicy + value: "Always" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].ports[0].name + value: "kruize-port" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].ports[0].containerPort + value: 8080 + + - it: should validate environment variables + asserts: + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: LOGGING_LEVEL + value: "info" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: ROOT_LOGGING_LEVEL + value: "error" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: DB_CONFIG_FILE + value: "/etc/config/dbconfigjson" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: KRUIZE_CONFIG_FILE + value: "/etc/config/kruizeconfigjson" + + - it: should validate resource settings + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.requests.memory + value: "768Mi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.requests.cpu + value: 0.7 + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.limits.memory + value: "768Mi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.limits.cpu + value: 0.7 + + - it: should validate volume mounts and config volume + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].volumeMounts[0].name + value: "config-volume" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].volumeMounts[0].mountPath + value: "/etc/config" + - equal: + path: spec.template.spec.volumes[0].name + value: "config-volume" + - equal: + path: spec.template.spec.volumes[0].configMap.name + value: "RELEASE-NAME-kruize-config" + + - it: should create a Deployment with the correct settings overrides + set: + kruize.replicaCount: 3 + kruize.image.tag: "0.9.0" + kruize.resources.requests.memory: "1Gi" + kruize.resources.requests.cpu: "1" + kruize.resources.limits.memory: "2Gi" + kruize.resources.limits.cpu: "2" + asserts: + - equal: + path: spec.replicas + value: 3 + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].image + value: "quay.io/kruize/autotune_operator:0.9.0" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.requests.memory + value: "1Gi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.requests.cpu + value: 1 + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.limits.memory + value: "2Gi" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].resources.limits.cpu + value: 2 + + +# Made by Bob +# Made by Bob diff --git a/charts/kruize/tests/kruize_service_test.yaml b/charts/kruize/tests/kruize_service_test.yaml new file mode 100644 index 0000000..d7c3ba0 --- /dev/null +++ b/charts/kruize/tests/kruize_service_test.yaml @@ -0,0 +1,78 @@ +suite: test kruize_service.yaml +templates: + - kruize_service.yaml + +tests: + - it: should create a Service with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Service + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize + - equal: + path: metadata.labels + value: + app: RELEASE-NAME-kruize + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + - equal: + path: metadata.annotations + value: + prometheus.io/scrape: 'true' + prometheus.io/path: '/metrics' + - equal: + path: spec.type + value: NodePort + - equal: + path: spec.selector + value: + app: RELEASE-NAME-kruize + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.ports[0].name + value: kruize-port + - equal: + path: spec.ports[0].port + value: 8080 + - equal: + path: spec.ports[0].targetPort + value: 8080 + + - it: should create a Service with the correct settings overrides + set: + kruize.service.type: ClusterIP + kruize.service.port: 9090 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.type + value: ClusterIP + - equal: + path: spec.ports[0].port + value: 9090 + - equal: + path: spec.ports[0].targetPort + value: 9090 + + - it: should create a Service in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/kruize_ui_test.yaml b/charts/kruize/tests/kruize_ui_test.yaml new file mode 100644 index 0000000..6a61cdc --- /dev/null +++ b/charts/kruize/tests/kruize_ui_test.yaml @@ -0,0 +1,132 @@ +suite: test kruize UI templates +templates: + - kruize_ui_nginx_pod.yaml + - kruize_ui_nginx_service.yaml + +tests: + - it: should create a UI nginx Pod with the correct default settings + template: kruize_ui_nginx_pod.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Pod + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-ui-nginx-pod + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-ui-nginx + - equal: + path: spec.containers[0].name + value: kruize-ui-nginx-container + - equal: + path: spec.containers[0].image + value: "quay.io/kruize/kruize-ui:0.0.8" + - equal: + path: spec.containers[0].imagePullPolicy + value: Always + - contains: + path: spec.containers[0].env + content: + name: KRUIZE_UI_ENV + value: "production" + - equal: + path: spec.containers[0].volumeMounts[0].name + value: nginx-config-volume + - equal: + path: spec.containers[0].volumeMounts[0].mountPath + value: /etc/nginx/nginx.conf + - equal: + path: spec.containers[0].volumeMounts[0].subPath + value: nginx.conf + - equal: + path: spec.volumes[0].name + value: nginx-config-volume + - equal: + path: spec.volumes[0].configMap.name + value: RELEASE-NAME-kruize-nginx-config + + - it: should create a UI nginx Pod with the correct settings overrides + template: kruize_ui_nginx_pod.yaml + set: + kruizeUI.image.tag: "0.1.0" + kruizeUI.image.pullPolicy: IfNotPresent + asserts: + - equal: + path: spec.containers[0].image + value: "quay.io/kruize/kruize-ui:0.1.0" + - equal: + path: spec.containers[0].imagePullPolicy + value: IfNotPresent + + - it: should create a UI nginx Pod in the release namespace + template: kruize_ui_nginx_pod.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + - it: should create a UI nginx Service with the correct default settings + template: kruize_ui_nginx_service.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Service + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-ui-nginx-service + - equal: + path: spec.type + value: NodePort + - equal: + path: spec.ports[0].name + value: http + - equal: + path: spec.ports[0].port + value: 8080 + - equal: + path: spec.ports[0].targetPort + value: 8080 + - equal: + path: spec.selector.app + value: RELEASE-NAME-kruize-ui-nginx + + - it: should create a UI nginx Service with the correct settings overrides + template: kruize_ui_nginx_service.yaml + set: + kruizeUI.service.type: ClusterIP + kruizeUI.service.port: 9090 + asserts: + - equal: + path: spec.type + value: ClusterIP + - equal: + path: spec.ports[0].port + value: 9090 + - equal: + path: spec.ports[0].targetPort + value: 9090 + + - it: should create a UI nginx Service in the release namespace + template: kruize_ui_nginx_service.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/configmap_minikube_test.yaml b/charts/kruize/tests/minikube/configmap_minikube_test.yaml new file mode 100644 index 0000000..6f40df8 --- /dev/null +++ b/charts/kruize/tests/minikube/configmap_minikube_test.yaml @@ -0,0 +1,64 @@ +suite: test configmap templates (minikube) +templates: + - configmap_kruize.yaml + - configmap_nginx.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a kruize ConfigMap with the correct default settings + template: configmap_kruize.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ConfigMap + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-config + - exists: + path: data.dbconfigjson + - exists: + path: data.kruizeconfigjson + + - it: should create a kruize ConfigMap in the release namespace + template: configmap_kruize.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + - it: should create a nginx ConfigMap with the correct default settings + template: configmap_nginx.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ConfigMap + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-nginx-config + - exists: + path: data["nginx.conf"] + + - it: should create a nginx ConfigMap in the release namespace + template: configmap_nginx.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/cronjobs_minikube_test.yaml b/charts/kruize/tests/minikube/cronjobs_minikube_test.yaml new file mode 100644 index 0000000..f71889a --- /dev/null +++ b/charts/kruize/tests/minikube/cronjobs_minikube_test.yaml @@ -0,0 +1,108 @@ +suite: test cronjobs.yaml (minikube) +templates: + - cronjobs.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create two CronJob documents + asserts: + - hasDocuments: + count: 2 + + - it: should create a create-partition CronJob with the correct default settings + documentIndex: 0 + asserts: + - equal: + path: kind + value: CronJob + - equal: + path: apiVersion + value: batch/v1 + - equal: + path: metadata.name + value: RELEASE-NAME-create-partition + - equal: + path: spec.schedule + value: "0 0 25 * *" + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].name + value: kruize-cron-create + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].image + value: "quay.io/kruize/autotune_operator:0.8.1" + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].imagePullPolicy + value: Always + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts[0].name + value: config-volume + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts[0].mountPath + value: /etc/config + - equal: + path: spec.jobTemplate.spec.template.spec.restartPolicy + value: OnFailure + - equal: + path: spec.jobTemplate.spec.template.spec.volumes[0].configMap.name + value: RELEASE-NAME-kruize-config + + - it: should create a delete-partition CronJob with the correct default settings + documentIndex: 1 + asserts: + - equal: + path: kind + value: CronJob + - equal: + path: metadata.name + value: RELEASE-NAME-delete-partition + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].name + value: kruize-cron-delete + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].image + value: "quay.io/kruize/autotune_operator:0.8.1" + - contains: + path: spec.jobTemplate.spec.template.spec.containers[0].env + content: + name: deletepartitionsthreshold + value: "15" + - equal: + path: spec.jobTemplate.spec.template.spec.restartPolicy + value: OnFailure + + - it: should create CronJobs with the correct settings overrides + documentIndex: 0 + set: + cronJob.createSchedule: "0 0 1 * *" + kruize.image.tag: "0.9.0" + asserts: + - equal: + path: spec.schedule + value: "0 0 1 * *" + - equal: + path: spec.jobTemplate.spec.template.spec.containers[0].image + value: "quay.io/kruize/autotune_operator:0.9.0" + + - it: should use custom deletePartitionsThreshold when specified + documentIndex: 1 + set: + cronJob.deletePartitionsThreshold: "30" + asserts: + - contains: + path: spec.jobTemplate.spec.template.spec.containers[0].env + content: + name: deletepartitionsthreshold + value: "30" + + - it: should create CronJobs in the release namespace + documentIndex: 0 + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml new file mode 100644 index 0000000..15c1131 --- /dev/null +++ b/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml @@ -0,0 +1,43 @@ +suite: test kruize_db_deployment.yaml (minikube) +templates: + - kruize_db_deployment.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a Deployment with minikube-specific settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db + + - it: should use default service account when serviceAccount.create is false + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: default + + - it: should not set PGDATA env var when pgData is empty + asserts: + - notExists: + path: spec.template.spec.containers[?(@.name=='kruize-db')].env[?(@.name=='PGDATA')] + + - it: should use minikube volumeMountPath + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=='kruize-db')].volumeMounts[0].mountPath + value: "/var/lib/postgresql/data" + + - it: should not set resource requests and limits when empty + asserts: + - notExists: + path: spec.template.spec.containers[?(@.name=='kruize-db')].resources + + +# Made by Bob +# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml new file mode 100644 index 0000000..4889589 --- /dev/null +++ b/charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml @@ -0,0 +1,66 @@ +suite: test kruize_db_service.yaml (minikube) +templates: + - kruize_db_service.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a Service with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Service + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db-service + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.type + value: ClusterIP + - equal: + path: spec.ports[0].name + value: kruize-db-port + - equal: + path: spec.ports[0].port + value: 5432 + - equal: + path: spec.ports[0].targetPort + value: 5432 + - equal: + path: spec.selector.app + value: RELEASE-NAME-kruize-db + + - it: should create a Service with the correct settings overrides + set: + db.service.type: NodePort + db.service.port: 5433 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.type + value: NodePort + - equal: + path: spec.ports[0].port + value: 5433 + - equal: + path: spec.ports[0].targetPort + value: 5433 + + - it: should create a Service in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml new file mode 100644 index 0000000..4e71d8d --- /dev/null +++ b/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml @@ -0,0 +1,123 @@ +suite: test kruize_deployment.yaml (minikube) +templates: + - kruize_deployment.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a Deployment with correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Deployment + - equal: + path: metadata.name + value: RELEASE-NAME-kruize + - equal: + path: metadata.namespace + value: NAMESPACE + - equal: + path: spec.replicas + value: 1 + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.template.metadata.labels + value: + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + + - it: should use default service account when serviceAccount.create is false + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: default + + - it: should validate init container for database wait + asserts: + - exists: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')] + - equal: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')].image + value: "quay.io/kruizehub/postgres:15.2" + - contains: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')].command + content: "sh" + - contains: + path: spec.template.spec.initContainers[?(@.name=='wait-for-kruize-db')].command + content: "-c" + + - it: should validate kruize container settings + asserts: + - exists: + path: spec.template.spec.containers[?(@.name=='kruize')] + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].image + value: "quay.io/kruize/autotune_operator:0.8.1" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].imagePullPolicy + value: "Always" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].ports[0].name + value: "kruize-port" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].ports[0].containerPort + value: 8080 + + - it: should validate environment variables + asserts: + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: LOGGING_LEVEL + value: "info" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: ROOT_LOGGING_LEVEL + value: "error" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: DB_CONFIG_FILE + value: "/etc/config/dbconfigjson" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: KRUIZE_CONFIG_FILE + value: "/etc/config/kruizeconfigjson" + - contains: + path: spec.template.spec.containers[?(@.name=='kruize')].env + content: + name: KAFKA_RESPONSE_FILTER_INCLUDE + value: "summary" + + - it: should not set resource requests and limits when empty + asserts: + - notExists: + path: spec.template.spec.containers[?(@.name=='kruize')].resources + + - it: should validate volume mounts and config volume + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].volumeMounts[0].name + value: "config-volume" + - equal: + path: spec.template.spec.containers[?(@.name=='kruize')].volumeMounts[0].mountPath + value: "/etc/config" + - equal: + path: spec.template.spec.volumes[0].name + value: "config-volume" + - equal: + path: spec.template.spec.volumes[0].configMap.name + value: "RELEASE-NAME-kruize-config" + + + +# Made by Bob +# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_service_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_service_minikube_test.yaml new file mode 100644 index 0000000..17b826f --- /dev/null +++ b/charts/kruize/tests/minikube/kruize_service_minikube_test.yaml @@ -0,0 +1,78 @@ +suite: test kruize_service.yaml (minikube) +templates: + - kruize_service.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a Service with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Service + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize + - equal: + path: metadata.labels + value: + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + - equal: + path: metadata.annotations + value: + prometheus.io/scrape: 'true' + prometheus.io/path: '/metrics' + - equal: + path: spec.type + value: NodePort + - equal: + path: spec.selector + value: + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.ports[0].name + value: kruize-port + - equal: + path: spec.ports[0].port + value: 8080 + - equal: + path: spec.ports[0].targetPort + value: 8080 + + - it: should create a Service with the correct settings overrides + set: + kruize.service.type: ClusterIP + kruize.service.port: 9090 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.type + value: ClusterIP + - equal: + path: spec.ports[0].port + value: 9090 + - equal: + path: spec.ports[0].targetPort + value: 9090 + + - it: should create a Service in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml new file mode 100644 index 0000000..a05de84 --- /dev/null +++ b/charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml @@ -0,0 +1,133 @@ +suite: test kruize UI templates (minikube) +templates: + - kruize_ui_nginx_pod.yaml + - kruize_ui_nginx_service.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a UI nginx Pod with the correct default settings + template: kruize_ui_nginx_pod.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Pod + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-ui-nginx-pod + - equal: + path: metadata.labels.app + value: kruize-ui-nginx + - equal: + path: spec.containers[0].name + value: kruize-ui-nginx-container + - equal: + path: spec.containers[0].image + value: "quay.io/kruize/kruize-ui:0.0.8" + - equal: + path: spec.containers[0].imagePullPolicy + value: Always + - contains: + path: spec.containers[0].env + content: + name: KRUIZE_UI_ENV + value: "production" + - equal: + path: spec.containers[0].volumeMounts[0].name + value: nginx-config-volume + - equal: + path: spec.containers[0].volumeMounts[0].mountPath + value: /etc/nginx/nginx.conf + - equal: + path: spec.containers[0].volumeMounts[0].subPath + value: nginx.conf + - equal: + path: spec.volumes[0].name + value: nginx-config-volume + - equal: + path: spec.volumes[0].configMap.name + value: RELEASE-NAME-kruize-nginx-config + + - it: should create a UI nginx Pod with the correct settings overrides + template: kruize_ui_nginx_pod.yaml + set: + kruizeUI.image.tag: "0.1.0" + kruizeUI.image.pullPolicy: IfNotPresent + asserts: + - equal: + path: spec.containers[0].image + value: "quay.io/kruize/kruize-ui:0.1.0" + - equal: + path: spec.containers[0].imagePullPolicy + value: IfNotPresent + + - it: should create a UI nginx Pod in the release namespace + template: kruize_ui_nginx_pod.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + - it: should create a UI nginx Service with the correct default settings + template: kruize_ui_nginx_service.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: Service + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-ui-nginx-service + - equal: + path: spec.type + value: NodePort + - equal: + path: spec.ports[0].name + value: http + - equal: + path: spec.ports[0].port + value: 8080 + - equal: + path: spec.ports[0].targetPort + value: 8080 + - equal: + path: spec.selector.app + value: kruize-ui-nginx + + - it: should create a UI nginx Service with the correct settings overrides + template: kruize_ui_nginx_service.yaml + set: + kruizeUI.service.type: ClusterIP + kruizeUI.service.port: 9090 + asserts: + - equal: + path: spec.type + value: ClusterIP + - equal: + path: spec.ports[0].port + value: 9090 + - equal: + path: spec.ports[0].targetPort + value: 9090 + + - it: should create a UI nginx Service in the release namespace + template: kruize_ui_nginx_service.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + +# Made by Bob diff --git a/charts/kruize/tests/minikube/network_policy_minikube_test.yaml b/charts/kruize/tests/minikube/network_policy_minikube_test.yaml new file mode 100644 index 0000000..1f5e8ac --- /dev/null +++ b/charts/kruize/tests/minikube/network_policy_minikube_test.yaml @@ -0,0 +1,64 @@ +suite: test network_policy.yaml (minikube) +templates: + - network_policy.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create NetworkPolicy when enabled in minikube + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: NetworkPolicy + - equal: + path: apiVersion + value: networking.k8s.io/v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-to-prometheus + - equal: + path: metadata.labels + value: + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + - equal: + path: spec.podSelector.matchLabels + value: + app.kubernetes.io/name: prometheus + - equal: + path: spec.policyTypes[0] + value: Ingress + - equal: + path: spec.ingress[0].from[0].podSelector.matchLabels + value: + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.ingress[0].ports[0].protocol + value: TCP + - equal: + path: spec.ingress[0].ports[0].port + value: 9090 + + - it: should not create NetworkPolicy when disabled + set: + networkPolicy.enabled: false + asserts: + - hasDocuments: + count: 0 + + - it: should create a NetworkPolicy in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/rbac_minikube_test.yaml b/charts/kruize/tests/minikube/rbac_minikube_test.yaml new file mode 100644 index 0000000..c93c78f --- /dev/null +++ b/charts/kruize/tests/minikube/rbac_minikube_test.yaml @@ -0,0 +1,159 @@ +suite: test RBAC resources (minikube) +templates: + - service_account.yaml + - role.yaml + - rolebinding.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should not create ServiceAccount when serviceAccount.create is false + template: service_account.yaml + asserts: + - hasDocuments: + count: 0 + + - it: should create recommendation-updater ClusterRole with correct rules + template: role.yaml + documentIndex: 0 + asserts: + - equal: + path: kind + value: ClusterRole + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-recommendation-updater + - contains: + path: rules + content: + apiGroups: [""] + resources: ["pods", "customresourcedefinitions"] + verbs: ["*"] + - contains: + path: rules + content: + apiGroups: ["apps"] + resources: ["deployments"] + verbs: ["*"] + + - it: should create edit-ko ClusterRole with correct rules + template: role.yaml + documentIndex: 1 + asserts: + - equal: + path: kind + value: ClusterRole + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-edit-ko + - contains: + path: rules + content: + apiGroups: ["apps"] + resources: ["deployments", "statefulsets", "daemonsets"] + verbs: ["get", "list", "patch", "update"] + - contains: + path: rules + content: + apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["get", "list", "create", "delete"] + + - it: should create instaslices-access ClusterRole with correct rules + template: role.yaml + documentIndex: 2 + asserts: + - equal: + path: kind + value: ClusterRole + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-instaslices-access + - contains: + path: rules + content: + apiGroups: ["inference.redhat.com"] + resources: ["instaslices"] + verbs: ["get", "list", "watch"] + + - it: should not create monitoring-view and SCC ClusterRoleBindings when rbac.create is false + template: rolebinding.yaml + asserts: + - hasDocuments: + count: 3 + + - it: should not create monitoring-view ClusterRoleBinding in minikube + template: rolebinding.yaml + documentIndex: 0 + asserts: + - notEqual: + path: metadata.name + value: RELEASE-NAME-kruize-monitoring-view + + - it: should not create OpenShift SCC ClusterRoleBinding in minikube + template: rolebinding.yaml + documentIndex: 0 + asserts: + - notEqual: + path: metadata.name + value: RELEASE-NAME-kruize-autotune-scc-crb + + - it: should create recommendation-updater ClusterRoleBinding with correct settings + template: rolebinding.yaml + documentIndex: 0 + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-recommendation-updater-crb + - equal: + path: subjects[0].kind + value: ServiceAccount + - equal: + path: subjects[0].name + value: default + - equal: + path: roleRef.kind + value: ClusterRole + - equal: + path: roleRef.name + value: RELEASE-NAME-kruize-recommendation-updater + + - it: should create instaslices-access ClusterRoleBinding with correct settings + template: rolebinding.yaml + documentIndex: 1 + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-instaslices-access-binding + - equal: + path: subjects[0].name + value: default + - equal: + path: roleRef.name + value: RELEASE-NAME-kruize-instaslices-access + + - it: should create edit-ko ClusterRoleBinding with correct settings + template: rolebinding.yaml + documentIndex: 2 + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-edit-ko-binding + - equal: + path: subjects[0].name + value: default + - equal: + path: roleRef.name + value: RELEASE-NAME-kruize-edit-ko + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml b/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml new file mode 100644 index 0000000..614a015 --- /dev/null +++ b/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml @@ -0,0 +1,71 @@ +suite: test service_monitor.yaml (minikube) +templates: + - service_monitor.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a ServiceMonitor with the correct default settings + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ServiceMonitor + - equal: + path: apiVersion + value: monitoring.coreos.com/v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-service-monitor + - equal: + path: metadata.labels + value: + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.endpoints[0].port + value: kruize-port + - equal: + path: spec.endpoints[0].interval + value: 30s + - equal: + path: spec.endpoints[0].path + value: /metrics + + - it: should create a ServiceMonitor with the correct settings overrides + set: + monitoring.interval: 60s + asserts: + - equal: + path: spec.endpoints[0].interval + value: 60s + + - it: should not create ServiceMonitor when monitoring is disabled + set: + monitoring.enabled: false + asserts: + - hasDocuments: + count: 0 + + - it: should create a ServiceMonitor in the release namespace + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + - equal: + path: spec.namespaceSelector.matchNames[0] + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/minikube/storage_minikube_test.yaml b/charts/kruize/tests/minikube/storage_minikube_test.yaml new file mode 100644 index 0000000..cd89a04 --- /dev/null +++ b/charts/kruize/tests/minikube/storage_minikube_test.yaml @@ -0,0 +1,112 @@ +suite: test storage templates (minikube) +templates: + - storage_pv.yaml + - storage_pvc.yaml +values: + - ../../values-minikube.yaml + +tests: + - it: should create a PersistentVolume with minikube-specific settings + template: storage_pv.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: PersistentVolume + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db-pv-volume + - equal: + path: metadata.labels.type + value: local + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.storageClassName + value: manual + - equal: + path: spec.capacity.storage + value: 1Gi + - equal: + path: spec.accessModes[0] + value: ReadWriteOnce + - equal: + path: spec.persistentVolumeReclaimPolicy + value: Retain + - equal: + path: spec.hostPath.path + value: "/data/postgres/RELEASE-NAME-kruize" + + - it: should create a PersistentVolume with the correct settings overrides + template: storage_pv.yaml + set: + db.pvc.storageSize: "2Gi" + db.pvc.storageClass: "standard" + db.pvc.hostPath: "/custom/data" + asserts: + - equal: + path: spec.capacity.storage + value: 2Gi + - equal: + path: spec.storageClassName + value: standard + - equal: + path: spec.hostPath.path + value: "/custom/data/RELEASE-NAME-kruize" + + - it: should create a PersistentVolumeClaim with minikube-specific settings + template: storage_pvc.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: PersistentVolumeClaim + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db-pv-claim + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.storageClassName + value: manual + - equal: + path: spec.accessModes[0] + value: ReadWriteOnce + - equal: + path: spec.resources.requests.storage + value: 1Gi + + - it: should create a PersistentVolumeClaim with the correct settings overrides + template: storage_pvc.yaml + set: + db.pvc.storageSize: "2Gi" + db.pvc.storageClass: "standard" + asserts: + - equal: + path: spec.resources.requests.storage + value: 2Gi + - equal: + path: spec.storageClassName + value: standard + + - it: should create a PersistentVolumeClaim in the release namespace + template: storage_pvc.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/network_policy_test.yaml b/charts/kruize/tests/network_policy_test.yaml new file mode 100644 index 0000000..d53139c --- /dev/null +++ b/charts/kruize/tests/network_policy_test.yaml @@ -0,0 +1,66 @@ +suite: test network_policy.yaml +templates: + - network_policy.yaml + +tests: + - it: should not create NetworkPolicy when disabled + set: + networkPolicy.enabled: false + asserts: + - hasDocuments: + count: 0 + + - it: should create a NetworkPolicy with the correct default settings + set: + networkPolicy.enabled: true + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: NetworkPolicy + - equal: + path: apiVersion + value: networking.k8s.io/v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-to-prometheus + - equal: + path: metadata.labels + value: + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + - equal: + path: spec.podSelector.matchLabels + value: + app.kubernetes.io/name: prometheus + - equal: + path: spec.policyTypes[0] + value: Ingress + - equal: + path: spec.ingress[0].from[0].podSelector.matchLabels + value: + app: RELEASE-NAME-kruize + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.ingress[0].ports[0].protocol + value: TCP + - equal: + path: spec.ingress[0].ports[0].port + value: 9090 + + - it: should create a NetworkPolicy in the release namespace + set: + networkPolicy.enabled: true + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + +# Made by Bob diff --git a/charts/kruize/tests/rbac_test.yaml b/charts/kruize/tests/rbac_test.yaml new file mode 100644 index 0000000..1e808de --- /dev/null +++ b/charts/kruize/tests/rbac_test.yaml @@ -0,0 +1,211 @@ +suite: test RBAC resources +templates: + - service_account.yaml + - role.yaml + - rolebinding.yaml + +tests: + - it: should not create ServiceAccount when disabled + template: service_account.yaml + set: + serviceAccount.create: false + asserts: + - hasDocuments: + count: 0 + + - it: should create a ServiceAccount with the correct default settings + template: service_account.yaml + set: + serviceAccount.create: true + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ServiceAccount + - equal: + path: metadata.name + value: RELEASE-NAME-kruize + - equal: + path: metadata.labels + value: + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + + - it: should use custom ServiceAccount name when specified + template: service_account.yaml + set: + serviceAccount.create: true + serviceAccount.name: custom-sa + asserts: + - equal: + path: metadata.name + value: custom-sa + + - it: should create recommendation-updater ClusterRole with correct rules + template: role.yaml + documentIndex: 0 + asserts: + - equal: + path: kind + value: ClusterRole + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-recommendation-updater + - contains: + path: rules + content: + apiGroups: [""] + resources: ["pods", "customresourcedefinitions"] + verbs: ["*"] + - contains: + path: rules + content: + apiGroups: ["apps"] + resources: ["deployments"] + verbs: ["*"] + + - it: should create edit-ko ClusterRole with correct rules + template: role.yaml + documentIndex: 1 + asserts: + - equal: + path: kind + value: ClusterRole + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-edit-ko + - contains: + path: rules + content: + apiGroups: ["apps"] + resources: ["deployments", "statefulsets", "daemonsets"] + verbs: ["get", "list", "patch", "update"] + - contains: + path: rules + content: + apiGroups: ["batch"] + resources: ["jobs"] + verbs: ["get", "list", "create", "delete"] + + - it: should create instaslices-access ClusterRole with correct rules + template: role.yaml + documentIndex: 2 + asserts: + - equal: + path: kind + value: ClusterRole + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-instaslices-access + - contains: + path: rules + content: + apiGroups: ["inference.redhat.com"] + resources: ["instaslices"] + verbs: ["get", "list", "watch"] + + - it: should create recommendation-updater ClusterRoleBinding with correct settings + template: rolebinding.yaml + documentIndex: 0 + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-recommendation-updater-crb + - equal: + path: subjects[0].kind + value: ServiceAccount + - equal: + path: subjects[0].name + value: RELEASE-NAME-kruize + - equal: + path: roleRef.kind + value: ClusterRole + - equal: + path: roleRef.name + value: RELEASE-NAME-kruize-recommendation-updater + + - it: should create monitoring-view ClusterRoleBinding when rbac.create is true + template: rolebinding.yaml + documentIndex: 1 + set: + rbac.create: true + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-monitoring-view + - equal: + path: roleRef.name + value: cluster-monitoring-view + + - it: should not create monitoring-view ClusterRoleBinding when rbac.create is false + template: rolebinding.yaml + set: + rbac.create: false + asserts: + - hasDocuments: + count: 3 + + - it: should create instaslices-access ClusterRoleBinding with correct settings + template: rolebinding.yaml + documentIndex: 2 + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-instaslices-access-binding + - equal: + path: roleRef.name + value: RELEASE-NAME-kruize-instaslices-access + + - it: should create edit-ko ClusterRoleBinding with correct settings + template: rolebinding.yaml + documentIndex: 3 + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-edit-ko-binding + - equal: + path: roleRef.name + value: RELEASE-NAME-kruize-edit-ko + + - it: should create OpenShift SCC ClusterRoleBinding when rbac.create is true + template: rolebinding.yaml + documentIndex: 4 + set: + rbac.create: true + asserts: + - equal: + path: kind + value: ClusterRoleBinding + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-autotune-scc-crb + - equal: + path: roleRef.name + value: system:openshift:scc:anyuid + + - it: should not create OpenShift SCC ClusterRoleBinding when rbac.create is false + template: rolebinding.yaml + set: + rbac.create: false + asserts: + - hasDocuments: + count: 3 + + +# Made by Bob diff --git a/charts/kruize/tests/service_monitor_test.yaml b/charts/kruize/tests/service_monitor_test.yaml new file mode 100644 index 0000000..fd6f515 --- /dev/null +++ b/charts/kruize/tests/service_monitor_test.yaml @@ -0,0 +1,76 @@ +suite: test service_monitor.yaml +templates: + - service_monitor.yaml + +tests: + - it: should not create ServiceMonitor when monitoring is disabled + set: + monitoring.enabled: false + asserts: + - hasDocuments: + count: 0 + + - it: should create a ServiceMonitor with the correct default settings + set: + monitoring.enabled: true + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: ServiceMonitor + - equal: + path: apiVersion + value: monitoring.coreos.com/v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-service-monitor + - equal: + path: metadata.labels + value: + app: RELEASE-NAME-kruize + helm.sh/chart: kruize-0.1.0 + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/managed-by: Helm + - equal: + path: spec.selector.matchLabels + value: + app: RELEASE-NAME-kruize + app.kubernetes.io/name: kruize + app.kubernetes.io/instance: RELEASE-NAME + - equal: + path: spec.endpoints[0].port + value: kruize-port + - equal: + path: spec.endpoints[0].interval + value: 30s + - equal: + path: spec.endpoints[0].path + value: /metrics + + - it: should create a ServiceMonitor with the correct settings overrides + set: + monitoring.enabled: true + monitoring.interval: 60s + asserts: + - equal: + path: spec.endpoints[0].interval + value: 60s + + - it: should create a ServiceMonitor in the release namespace + set: + monitoring.enabled: true + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + - equal: + path: spec.namespaceSelector.matchNames[0] + value: custom-namespace + + +# Made by Bob diff --git a/charts/kruize/tests/storage_test.yaml b/charts/kruize/tests/storage_test.yaml new file mode 100644 index 0000000..6762451 --- /dev/null +++ b/charts/kruize/tests/storage_test.yaml @@ -0,0 +1,107 @@ +suite: test storage templates +templates: + - storage_pv.yaml + - storage_pvc.yaml + +tests: + - it: should create a PersistentVolume with the correct default settings + template: storage_pv.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: PersistentVolume + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db-pv-volume + - equal: + path: metadata.labels.type + value: local + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.storageClassName + value: manual + - equal: + path: spec.capacity.storage + value: 500Mi + - equal: + path: spec.accessModes[0] + value: ReadWriteMany + - equal: + path: spec.hostPath.path + value: "/mnt/data/RELEASE-NAME-kruize" + + - it: should create a PersistentVolume with the correct settings overrides + template: storage_pv.yaml + set: + db.pvc.storageSize: "1Gi" + db.pvc.storageClass: "standard" + db.pvc.hostPath: "/data" + asserts: + - equal: + path: spec.capacity.storage + value: 1Gi + - equal: + path: spec.storageClassName + value: standard + - equal: + path: spec.hostPath.path + value: "/data/RELEASE-NAME-kruize" + + - it: should create a PersistentVolumeClaim with the correct default settings + template: storage_pvc.yaml + asserts: + - hasDocuments: + count: 1 + - equal: + path: kind + value: PersistentVolumeClaim + - equal: + path: apiVersion + value: v1 + - equal: + path: metadata.name + value: RELEASE-NAME-kruize-db-pv-claim + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize-db + - equal: + path: spec.storageClassName + value: manual + - equal: + path: spec.accessModes[0] + value: ReadWriteMany + - equal: + path: spec.resources.requests.storage + value: 500Mi + + - it: should create a PersistentVolumeClaim with the correct settings overrides + template: storage_pvc.yaml + set: + db.pvc.storageSize: "2Gi" + db.pvc.storageClass: "standard" + asserts: + - equal: + path: spec.resources.requests.storage + value: 2Gi + - equal: + path: spec.storageClassName + value: standard + + - it: should create a PersistentVolumeClaim in the release namespace + template: storage_pvc.yaml + release: + namespace: custom-namespace + asserts: + - equal: + path: metadata.namespace + value: custom-namespace + + +# Made by Bob From 84d27e4c50b0318124f44833d4e870f9d42c9c43 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 9 Mar 2026 23:55:36 +0530 Subject: [PATCH 15/29] Included values schema Signed-off-by: Chandrakala Subramanyam --- charts/kruize/values.schema.json | 519 +++++++++++++++++++++++++++++++ 1 file changed, 519 insertions(+) create mode 100644 charts/kruize/values.schema.json diff --git a/charts/kruize/values.schema.json b/charts/kruize/values.schema.json new file mode 100644 index 0000000..71a593e --- /dev/null +++ b/charts/kruize/values.schema.json @@ -0,0 +1,519 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Kruize Helm Chart Values", + "description": "Schema for Kruize Helm chart values", + "type": "object", + "properties": { + "kruize": { + "type": "object", + "description": "Configuration for the Kruize application", + "properties": { + "image": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository for Kruize container image" + }, + "pullPolicy": { + "type": "string", + "enum": ["Always", "IfNotPresent", "Never"], + "description": "Image pull policy for the Kruize container image" + }, + "tag": { + "type": "string", + "description": "Image tag for Kruize container" + } + }, + "required": ["repository", "pullPolicy", "tag"] + }, + "replicaCount": { + "type": "integer", + "minimum": 1, + "description": "Replica count for the Kruize container" + }, + "resources": { + "type": "object", + "properties": { + "requests": { + "type": "object", + "properties": { + "memory": { + "type": "string", + "description": "Memory resource request for the Kruize container" + }, + "cpu": { + "type": "string", + "description": "CPU resource request for the Kruize container" + } + } + }, + "limits": { + "type": "object", + "properties": { + "memory": { + "type": "string", + "description": "Memory resource limit for the Kruize container" + }, + "cpu": { + "type": "string", + "description": "CPU resource limit for the Kruize container" + } + } + } + } + }, + "service": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ClusterIP", "NodePort", "LoadBalancer"], + "description": "Kruize service type" + }, + "port": { + "type": "integer", + "minimum": 1, + "maximum": 65535, + "description": "Kruize service port" + } + }, + "required": ["type", "port"] + }, + "env": { + "type": "array", + "description": "Environment variables for Kruize container", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["name", "value"] + } + }, + "config": { + "type": "object", + "properties": { + "clusterType": { + "type": "string", + "enum": ["kubernetes", "openshift"] + }, + "k8sType": { + "type": "string", + "enum": ["openshift", "minikube", "kubernetes"] + }, + "authType": { + "type": "string" + }, + "monitoringAgent": { + "type": "string" + }, + "monitoringService": { + "type": "string" + }, + "monitoringEndPoint": { + "type": "string" + }, + "saveToDB": { + "type": "string", + "enum": ["true", "false"] + }, + "dbDriver": { + "type": "string" + }, + "plots": { + "type": "string", + "enum": ["true", "false"] + }, + "isROSEnabled": { + "type": "string", + "enum": ["true", "false"] + }, + "local": { + "type": "string", + "enum": ["true", "false"] + }, + "logAllHttpReqAndResp": { + "type": "string", + "enum": ["true", "false"] + }, + "experimentNameFormat": { + "type": "string" + }, + "bulkapilimit": { + "type": "integer", + "minimum": 1 + }, + "isKafkaEnabled": { + "type": "string", + "enum": ["true", "false"] + }, + "hibernate": { + "type": "object", + "properties": { + "dialect": { + "type": "string" + }, + "driver": { + "type": "string" + }, + "c3p0minsize": { + "type": "integer", + "minimum": 1 + }, + "c3p0maxsize": { + "type": "integer", + "minimum": 1 + }, + "c3p0timeout": { + "type": "integer", + "minimum": 1 + }, + "c3p0maxstatements": { + "type": "integer", + "minimum": 1 + }, + "hbm2ddlauto": { + "type": "string" + }, + "showsql": { + "type": "string", + "enum": ["true", "false"] + }, + "timezone": { + "type": "string" + } + } + }, + "logging": { + "type": "object", + "properties": { + "cloudwatch": { + "type": "object", + "properties": { + "accessKeyId": { + "type": "string" + }, + "logGroup": { + "type": "string" + }, + "logStream": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretAccessKey": { + "type": "string" + }, + "logLevel": { + "type": "string", + "enum": ["DEBUG", "INFO", "WARN", "ERROR"] + } + } + } + } + }, + "datasource": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "url": { + "type": "string" + }, + "authentication": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "credentials": { + "type": "object", + "properties": { + "tokenFilePath": { + "type": "string" + } + } + } + } + } + }, + "required": ["name", "provider"] + } + } + } + } + }, + "required": ["image", "service"] + }, + "cronJob": { + "type": "object", + "properties": { + "deletePartitionsThreshold": { + "type": "string" + }, + "createSchedule": { + "type": "string", + "description": "Cron schedule expression" + } + } + }, + "db": { + "type": "object", + "description": "Kruize DB configuration", + "properties": { + "image": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository for Kruize DB container image" + }, + "pullPolicy": { + "type": "string", + "enum": ["Always", "IfNotPresent", "Never"], + "description": "Image pull policy for the Kruize DB container image" + }, + "tag": { + "type": "string", + "description": "Image tag for Kruize DB container" + } + }, + "required": ["repository", "pullPolicy", "tag"] + }, + "service": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Kruize DB service name" + }, + "type": { + "type": "string", + "enum": ["ClusterIP", "NodePort", "LoadBalancer"], + "description": "Kruize DB service type" + }, + "port": { + "type": "integer", + "minimum": 1, + "maximum": 65535, + "description": "Kruize DB service port" + } + }, + "required": ["name", "type", "port"] + }, + "resources": { + "type": "object", + "properties": { + "requests": { + "type": "object", + "properties": { + "memory": { + "type": "string", + "description": "Memory resource request for the Kruize DB container" + }, + "cpu": { + "type": "string", + "description": "CPU resource request for the Kruize DB container" + } + } + }, + "limits": { + "type": "object", + "properties": { + "memory": { + "type": "string", + "description": "Memory resource limit for the Kruize DB container" + }, + "cpu": { + "type": "string", + "description": "CPU resource limit for the Kruize DB container" + } + } + } + } + }, + "pvc": { + "type": "object", + "properties": { + "storageClass": { + "type": "string" + }, + "storageSize": { + "type": "string" + }, + "hostPath": { + "type": "string" + }, + "accessModes": { + "type": "array", + "items": { + "type": "string", + "enum": ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"] + } + }, + "reclaimPolicy": { + "type": "string", + "enum": ["Retain", "Delete", "Recycle"] + } + } + }, + "user": { + "type": "string", + "description": "User for Kruize DB container" + }, + "password": { + "type": "string", + "description": "Password for Kruize DB container" + }, + "adminUser": { + "type": "string", + "description": "Admin User for Kruize DB container" + }, + "adminPassword": { + "type": "string", + "description": "Admin password for Kruize DB container" + }, + "name": { + "type": "string", + "description": "Name of the Kruize DB" + }, + "includeReleaseNameInDbName": { + "type": "boolean", + "description": "Include release name in database name for multi-instance support" + }, + "volumeMountPath": { + "type": "string", + "description": "Volume mount path for database data" + }, + "pgData": { + "type": "string", + "description": "PGDATA environment variable value" + }, + "sslMode": { + "type": "string", + "enum": ["disable", "allow", "prefer", "require", "verify-ca", "verify-full"] + } + }, + "required": ["image", "service", "user", "password", "name"] + }, + "kruizeUI": { + "type": "object", + "description": "Kruize UI Configuration", + "properties": { + "image": { + "type": "object", + "properties": { + "repository": { + "type": "string", + "description": "Repository for Kruize UI container image" + }, + "pullPolicy": { + "type": "string", + "enum": ["Always", "IfNotPresent", "Never"], + "description": "Image pull policy for the Kruize UI container image" + }, + "tag": { + "type": "string", + "description": "Image tag for Kruize UI container" + } + }, + "required": ["repository", "pullPolicy", "tag"] + }, + "service": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ClusterIP", "NodePort", "LoadBalancer"], + "description": "Kruize UI service type" + }, + "port": { + "type": "integer", + "minimum": 1, + "maximum": 65535, + "description": "Kruize UI service port" + } + }, + "required": ["type", "port"] + } + }, + "required": ["image", "service"] + }, + "serviceAccount": { + "type": "object", + "properties": { + "create": { + "type": "boolean", + "description": "Specifies whether a service account should be created" + }, + "name": { + "type": "string", + "description": "The name of the service account to use" + } + }, + "required": ["create"] + }, + "rbac": { + "type": "object", + "properties": { + "create": { + "type": "boolean", + "description": "Specifies whether Openshift-specific RBAC resources should be created" + } + }, + "required": ["create"] + }, + "nameOverride": { + "type": "string", + "description": "Overrides the name of this Chart" + }, + "fullnameOverride": { + "type": "string", + "description": "Overrides the fully qualified application name of [release name]-[chart name]" + }, + "monitoring": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable monitoring with ServiceMonitor" + }, + "interval": { + "type": "string", + "description": "Scrape interval for Prometheus" + } + }, + "required": ["enabled"] + }, + "networkPolicy": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable NetworkPolicy resources" + } + }, + "required": ["enabled"] + } + }, + "required": ["kruize", "db", "kruizeUI", "serviceAccount", "rbac"] +} \ No newline at end of file From 109856e0c83f5e6f8839a78c85aae64bf787d9b9 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 10 Mar 2026 01:10:59 +0530 Subject: [PATCH 16/29] Created values specific to openshift and refactored the other files Signed-off-by: Chandrakala Subramanyam --- charts/kruize/README.md | 52 ++++--- .../kruize/templates/kruize_deployment.yaml | 1 + charts/kruize/tests/README.md | 140 ++++++++++-------- .../{ => common-tests}/configmap_test.yaml | 1 - .../{ => common-tests}/cronjobs_test.yaml | 2 - .../kruize_db_deployment_test.yaml | 2 - .../kruize_db_service_test.yaml | 1 - .../kruize_service_test.yaml | 2 - .../{ => common-tests}/kruize_ui_test.yaml | 2 - .../network_policy_test.yaml | 1 - .../service_monitor_test.yaml | 2 - .../{ => common-tests}/storage_test.yaml | 2 - .../minikube/configmap_minikube_test.yaml | 64 -------- .../minikube/cronjobs_minikube_test.yaml | 108 -------------- .../kruize_db_deployment_minikube_test.yaml | 3 - .../kruize_db_service_minikube_test.yaml | 66 --------- .../kruize_deployment_minikube_test.yaml | 22 ++- .../kruize_service_minikube_test.yaml | 78 ---------- .../minikube/kruize_ui_minikube_test.yaml | 133 ----------------- .../network_policy_minikube_test.yaml | 2 +- .../tests/minikube/rbac_minikube_test.yaml | 2 - .../service_monitor_minikube_test.yaml | 4 +- .../tests/minikube/storage_minikube_test.yaml | 1 - .../kruize_deployment_test.yaml | 25 +++- .../tests/{ => openshift}/rbac_test.yaml | 6 +- charts/kruize/values-openshift.yaml | 52 +++++++ charts/kruize/values.yaml | 25 +--- 27 files changed, 218 insertions(+), 581 deletions(-) rename charts/kruize/tests/{ => common-tests}/configmap_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/cronjobs_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/kruize_db_deployment_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/kruize_db_service_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/kruize_service_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/kruize_ui_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/network_policy_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/service_monitor_test.yaml (99%) rename charts/kruize/tests/{ => common-tests}/storage_test.yaml (99%) delete mode 100644 charts/kruize/tests/minikube/configmap_minikube_test.yaml delete mode 100644 charts/kruize/tests/minikube/cronjobs_minikube_test.yaml delete mode 100644 charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml delete mode 100644 charts/kruize/tests/minikube/kruize_service_minikube_test.yaml delete mode 100644 charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml rename charts/kruize/tests/{ => openshift}/kruize_deployment_test.yaml (88%) rename charts/kruize/tests/{ => openshift}/rbac_test.yaml (98%) create mode 100644 charts/kruize/values-openshift.yaml diff --git a/charts/kruize/README.md b/charts/kruize/README.md index c3fb7b8..3339080 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -14,16 +14,40 @@ Kruize is an intelligent resource optimization platform that helps you optimize ## Installing the Chart -To install the chart with the release name `kruize`: +### OpenShift Installation + +To install the chart with OpenShift-specific configuration: ```bash -helm install kruize ./charts/kruize +helm install kruize ./charts/kruize -f ./charts/kruize/values-openshift.yaml ``` To install in a specific namespace: ```bash -helm install kruize ./charts/kruize --namespace kruize --create-namespace +helm install kruize ./charts/kruize -f ./charts/kruize/values-openshift.yaml --namespace openshift-tuning --create-namespace +``` + +### Minikube Installation + +To install the chart with Minikube-specific configuration: + +```bash +helm install kruize ./charts/kruize -f ./charts/kruize/values-minikube.yaml +``` + +To install in a specific namespace: + +```bash +helm install kruize ./charts/kruize -f ./charts/kruize/values-minikube.yaml --namespace monitoring --create-namespace +``` + +### Generic Kubernetes Installation + +To install with default values (generic Kubernetes): + +```bash +helm install kruize ./charts/kruize ``` ## Uninstalling the Chart @@ -72,7 +96,7 @@ The following table lists the configurable parameters of the Kruize chart and th | Parameter | Description | Default | |-----------|-------------|---------| | `kruize.config.clusterType` | Type of cluster | `kubernetes` | -| `kruize.config.k8sType` | Kubernetes distribution type | `openshift` | +| `kruize.config.k8sType` | Kubernetes distribution type (openshift/minikube/kubernetes) | `kubernetes` | | `kruize.config.authType` | Authentication type | `""` | | `kruize.config.monitoringAgent` | Monitoring agent to use | `prometheus` | | `kruize.config.monitoringService` | Monitoring service name | `prometheus-k8s` | @@ -116,20 +140,12 @@ The following table lists the configurable parameters of the Kruize chart and th | Parameter | Description | Default | |-----------|-------------|---------| -| `kruize.config.datasource[0].name` | Name of the first datasource | `prometheus-1` | -| `kruize.config.datasource[0].provider` | Provider type | `prometheus` | -| `kruize.config.datasource[0].serviceName` | Service name | `prometheus-k8s` | -| `kruize.config.datasource[0].namespace` | Namespace | `openshift-monitoring` | -| `kruize.config.datasource[0].url` | Datasource URL | `""` | -| `kruize.config.datasource[0].authentication.type` | Authentication type | `bearer` | -| `kruize.config.datasource[0].authentication.credentials.tokenFilePath` | Token file path | `/var/run/secrets/kubernetes.io/serviceaccount/token` | -| `kruize.config.datasource[1].name` | Name of the second datasource | `thanos-1` | -| `kruize.config.datasource[1].provider` | Provider type | `prometheus` | -| `kruize.config.datasource[1].serviceName` | Service name | `thanos-querier` | -| `kruize.config.datasource[1].namespace` | Namespace | `openshift-monitoring` | -| `kruize.config.datasource[1].url` | Datasource URL | `""` | -| `kruize.config.datasource[1].authentication.type` | Authentication type | `bearer` | -| `kruize.config.datasource[1].authentication.credentials.tokenFilePath` | Token file path | `/var/run/secrets/kubernetes.io/serviceaccount/token` | +| `kruize.config.datasource` | Array of datasource configurations | `[]` (empty, platform-specific) | + +**Note:** Datasource configuration is platform-specific: +- **OpenShift**: Configured in `values-openshift.yaml` with prometheus-k8s and thanos-querier in openshift-monitoring namespace +- **Minikube**: Configured in `values-minikube.yaml` with prometheus-k8s in monitoring namespace +- **Generic Kubernetes**: Empty by default, configure based on your monitoring setup ### Kruize Database Parameters diff --git a/charts/kruize/templates/kruize_deployment.yaml b/charts/kruize/templates/kruize_deployment.yaml index f769628..d9c3785 100644 --- a/charts/kruize/templates/kruize_deployment.yaml +++ b/charts/kruize/templates/kruize_deployment.yaml @@ -6,6 +6,7 @@ metadata: name: {{ include "kruize.deploymentName" . }} namespace: {{ .Release.Namespace }} labels: + {{- include "kruize.labels" . | nindent 4 }} app: {{ $fullName }} spec: replicas: {{ .Values.kruize.replicaCount | default 1 }} diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md index 1f24f6e..9d9795a 100644 --- a/charts/kruize/tests/README.md +++ b/charts/kruize/tests/README.md @@ -12,82 +12,108 @@ helm plugin install https://github.com/helm-unittest/helm-unittest ## Running Tests -### Run All Tests (OpenShift/default values) +> **Note:** The default `helm unittest charts/kruize` command will not find tests in subdirectories. You must explicitly specify test file patterns using the `-f` flag. +### Run all tests ```bash -helm unittest -f 'tests/*.yaml' charts/kruize +helm unittest -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' charts/kruize ``` -### Run Minikube-specific Tests - +Or from within the chart directory: ```bash -helm unittest -f 'tests/minikube/*.yaml' charts/kruize +cd charts/kruize +helm unittest -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . ``` -### Run All Tests (default + minikube) - +### Run common tests only ```bash -helm unittest charts/kruize +cd charts/kruize +helm unittest -f 'tests/common-tests/*.yaml' . ``` -### Run a Specific Test File - +### Run OpenShift-specific tests ```bash -helm unittest -f 'tests/kruize_deployment_test.yaml' charts/kruize +cd charts/kruize +helm unittest -f 'tests/openshift/*.yaml' . ``` -### Run Tests with Verbose Output +### Run Minikube-specific tests +```bash +cd charts/kruize +helm unittest -f 'tests/minikube/*.yaml' . +``` +### Run tests with verbose output ```bash -helm unittest -v charts/kruize +cd charts/kruize +helm unittest -v -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . ``` ### Generate JUnit Test Report - ```bash -helm unittest --output-type JUnit --output-file test-results.xml charts/kruize +cd charts/kruize +helm unittest --output-type JUnit --output-file test-results.xml -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . ``` -## Test Structure +## Directory Structure ``` tests/ -├── configmap_test.yaml # Tests for configmap_kruize.yaml and configmap_nginx.yaml -├── cronjobs_test.yaml # Tests for cronjobs.yaml -├── kruize_db_deployment_test.yaml # Tests for kruize_db_deployment.yaml -├── kruize_db_service_test.yaml # Tests for kruize_db_service.yaml -├── kruize_deployment_test.yaml # Tests for kruize_deployment.yaml -├── kruize_service_test.yaml # Tests for kruize_service.yaml -├── kruize_ui_test.yaml # Tests for kruize_ui_nginx_pod.yaml and kruize_ui_nginx_service.yaml -├── network_policy_test.yaml # Tests for network_policy.yaml -├── rbac_test.yaml # Tests for service_account.yaml, role.yaml, rolebinding.yaml -├── service_monitor_test.yaml # Tests for service_monitor.yaml -├── storage_test.yaml # Tests for storage_pv.yaml and storage_pvc.yaml -└── minikube/ - ├── kruize_db_deployment_minikube_test.yaml # DB deployment tests with values-minikube.yaml - ├── kruize_deployment_minikube_test.yaml # Kruize deployment tests with values-minikube.yaml - ├── network_policy_minikube_test.yaml # Network policy tests with values-minikube.yaml - ├── rbac_minikube_test.yaml # RBAC tests with values-minikube.yaml - └── storage_minikube_test.yaml # Storage tests with values-minikube.yaml +├── common-tests/ # Tests that work across all platforms (39 tests) +│ ├── configmap_test.yaml +│ ├── cronjobs_test.yaml +│ ├── kruize_db_deployment_test.yaml +│ ├── kruize_db_service_test.yaml +│ ├── kruize_service_test.yaml +│ ├── kruize_ui_test.yaml +│ ├── network_policy_test.yaml +│ ├── service_monitor_test.yaml +│ └── storage_test.yaml +│ +├── openshift/ # OpenShift-specific tests (20 tests) +│ ├── kruize_deployment_test.yaml +│ └── rbac_test.yaml +│ +└── minikube/ # Minikube-specific tests (34 tests) + ├── kruize_db_deployment_minikube_test.yaml + ├── kruize_deployment_minikube_test.yaml + ├── network_policy_minikube_test.yaml + ├── rbac_minikube_test.yaml + ├── service_monitor_minikube_test.yaml + └── storage_minikube_test.yaml ``` + ## Environment-specific Tests -Tests in `tests/` use the default `values.yaml` (OpenShift deployment). +### Common Tests (`tests/common-tests/`) +Tests that work across all platforms using default `values.yaml`. These validate core functionality that is consistent regardless of deployment platform. -Tests in `tests/minikube/` use `values-minikube.yaml` on top of `values.yaml` via the `values:` field in each test suite. These tests validate minikube-specific behaviour such as: +### OpenShift Tests (`tests/openshift/`) +Tests that use `values-openshift.yaml` to validate OpenShift-specific configurations: +- `serviceAccount.create: true` — creates a dedicated service account +- `rbac.create: true` — includes OpenShift-specific ClusterRoleBindings (cluster-monitoring-view, SCC anyuid) +- Resource requests/limits are set +- Full KAFKA_RESPONSE_FILTER_INCLUDE configuration +### Minikube Tests (`tests/minikube/`) +Tests that use `values-minikube.yaml` to validate minikube-specific configurations: - `serviceAccount.create: false` — uses the `default` service account - `rbac.create: false` — skips OpenShift-specific ClusterRoleBindings - `db.pgData: ""` — PGDATA env var is not set - `db.volumeMountPath: /var/lib/postgresql/data` — minikube postgres path +- `db.pvc.storageSize: 1Gi` — smaller storage for minikube - `db.pvc.accessModes: [ReadWriteOnce]` — minikube storage access mode +- `db.pvc.hostPath: /data/postgres` — minikube host path +- `db.pvc.reclaimPolicy: Retain` — retain policy for minikube - `networkPolicy.enabled: true` — network policy is enabled on minikube +- `monitoring.enabled: true` — monitoring is enabled on minikube - Empty resource requests/limits — no resource constraints on minikube +- `KAFKA_RESPONSE_FILTER_INCLUDE: summary` — simplified kafka filter for minikube ## Test File Structure -Each test file follows the cryostat-helm style: +Each test file follows the below style: ```yaml suite: test @@ -134,32 +160,28 @@ tests: - `hasDocuments` - Checks the number of documents in the output - `matchRegex` - Checks if a value matches a regex pattern -## Continuous Integration -```yaml -# Example GitHub Actions workflow -- name: Install Helm - uses: azure/setup-helm@v3 +## Adding New Tests -- name: Install helm-unittest plugin - run: helm plugin install https://github.com/helm-unittest/helm-unittest +When adding new templates or modifying existing ones: -- name: Run Helm tests (OpenShift) - run: helm unittest -f 'tests/*.yaml' charts/kruize +1. **For common functionality** (works across all platforms): + - Create or update test file in `charts/kruize/tests/common-tests/` + - Follow naming convention: `_test.yaml` + - Use default `values.yaml` -- name: Run Helm tests (Minikube) - run: helm unittest -f 'tests/minikube/*.yaml' charts/kruize -``` +2. **For OpenShift-specific behavior**: + - Create or update test file in `charts/kruize/tests/openshift/` + - Add `values: - ../../values-openshift.yaml` to the test suite + - Test OpenShift-specific features (RBAC, SCC, monitoring, etc.) -## Adding New Tests - -When adding new templates or modifying existing ones: +3. **For Minikube-specific behavior**: + - Create or update test file in `charts/kruize/tests/minikube/` + - Add `values: - ../../values-minikube.yaml` to the test suite + - Test minikube-specific overrides (empty resources, default SA, etc.) -1. Create or update the corresponding test file in `charts/kruize/tests/` -2. Follow the naming convention: `_test.yaml` -3. For minikube-specific behaviour, add a corresponding file in `charts/kruize/tests/minikube/` with `values: - ../../values-minikube.yaml` 4. Include tests for: - - Default values (from `values.yaml`) + - Default values - Settings overrides (using `set:`) - Conditional resource creation (enabled/disabled flags) - Namespace propagation (using `release.namespace`) @@ -178,16 +200,18 @@ helm plugin install https://github.com/helm-unittest/helm-unittest Run with verbose output to see detailed failure information: ```bash -helm unittest -v charts/kruize +helm unittest -v -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' charts/kruize ``` ### Debugging Specific Tests ```bash -helm unittest -f 'tests/kruize_deployment_test.yaml' -v charts/kruize +helm unittest -f 'tests/common-tests/kruize_db_deployment_test.yaml' -v charts/kruize +helm unittest -f 'tests/openshift/kruize_deployment_test.yaml' -v charts/kruize +helm unittest -f 'tests/minikube/kruize_deployment_minikube_test.yaml' -v charts/kruize ``` ## Resources - [Helm Unittest Documentation](https://github.com/helm-unittest/helm-unittest/blob/main/DOCUMENT.md) -- [Helm Chart Testing Guide](https://helm.sh/docs/topics/chart_tests/) \ No newline at end of file +- [Helm Chart Testing Guide](https://helm.sh/docs/topics/chart_tests/) diff --git a/charts/kruize/tests/configmap_test.yaml b/charts/kruize/tests/common-tests/configmap_test.yaml similarity index 99% rename from charts/kruize/tests/configmap_test.yaml rename to charts/kruize/tests/common-tests/configmap_test.yaml index 4b2f4a8..23aa8d8 100644 --- a/charts/kruize/tests/configmap_test.yaml +++ b/charts/kruize/tests/common-tests/configmap_test.yaml @@ -58,4 +58,3 @@ tests: path: metadata.namespace value: custom-namespace -# Made by Bob diff --git a/charts/kruize/tests/cronjobs_test.yaml b/charts/kruize/tests/common-tests/cronjobs_test.yaml similarity index 99% rename from charts/kruize/tests/cronjobs_test.yaml rename to charts/kruize/tests/common-tests/cronjobs_test.yaml index fed6799..ce3a3b6 100644 --- a/charts/kruize/tests/cronjobs_test.yaml +++ b/charts/kruize/tests/common-tests/cronjobs_test.yaml @@ -102,5 +102,3 @@ tests: path: metadata.namespace value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/kruize_db_deployment_test.yaml b/charts/kruize/tests/common-tests/kruize_db_deployment_test.yaml similarity index 99% rename from charts/kruize/tests/kruize_db_deployment_test.yaml rename to charts/kruize/tests/common-tests/kruize_db_deployment_test.yaml index bdc6044..b7fd65a 100644 --- a/charts/kruize/tests/kruize_db_deployment_test.yaml +++ b/charts/kruize/tests/common-tests/kruize_db_deployment_test.yaml @@ -115,5 +115,3 @@ tests: value: "2" -# Made by Bob -# Made by Bob diff --git a/charts/kruize/tests/kruize_db_service_test.yaml b/charts/kruize/tests/common-tests/kruize_db_service_test.yaml similarity index 99% rename from charts/kruize/tests/kruize_db_service_test.yaml rename to charts/kruize/tests/common-tests/kruize_db_service_test.yaml index e062232..47e8f06 100644 --- a/charts/kruize/tests/kruize_db_service_test.yaml +++ b/charts/kruize/tests/common-tests/kruize_db_service_test.yaml @@ -60,4 +60,3 @@ tests: path: metadata.namespace value: custom-namespace -# Made by Bob diff --git a/charts/kruize/tests/kruize_service_test.yaml b/charts/kruize/tests/common-tests/kruize_service_test.yaml similarity index 99% rename from charts/kruize/tests/kruize_service_test.yaml rename to charts/kruize/tests/common-tests/kruize_service_test.yaml index d7c3ba0..aebe3a7 100644 --- a/charts/kruize/tests/kruize_service_test.yaml +++ b/charts/kruize/tests/common-tests/kruize_service_test.yaml @@ -74,5 +74,3 @@ tests: path: metadata.namespace value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/kruize_ui_test.yaml b/charts/kruize/tests/common-tests/kruize_ui_test.yaml similarity index 99% rename from charts/kruize/tests/kruize_ui_test.yaml rename to charts/kruize/tests/common-tests/kruize_ui_test.yaml index 6a61cdc..782d317 100644 --- a/charts/kruize/tests/kruize_ui_test.yaml +++ b/charts/kruize/tests/common-tests/kruize_ui_test.yaml @@ -128,5 +128,3 @@ tests: path: metadata.namespace value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/network_policy_test.yaml b/charts/kruize/tests/common-tests/network_policy_test.yaml similarity index 99% rename from charts/kruize/tests/network_policy_test.yaml rename to charts/kruize/tests/common-tests/network_policy_test.yaml index d53139c..813b79b 100644 --- a/charts/kruize/tests/network_policy_test.yaml +++ b/charts/kruize/tests/common-tests/network_policy_test.yaml @@ -63,4 +63,3 @@ tests: path: metadata.namespace value: custom-namespace -# Made by Bob diff --git a/charts/kruize/tests/service_monitor_test.yaml b/charts/kruize/tests/common-tests/service_monitor_test.yaml similarity index 99% rename from charts/kruize/tests/service_monitor_test.yaml rename to charts/kruize/tests/common-tests/service_monitor_test.yaml index fd6f515..bf3eab9 100644 --- a/charts/kruize/tests/service_monitor_test.yaml +++ b/charts/kruize/tests/common-tests/service_monitor_test.yaml @@ -72,5 +72,3 @@ tests: path: spec.namespaceSelector.matchNames[0] value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/storage_test.yaml b/charts/kruize/tests/common-tests/storage_test.yaml similarity index 99% rename from charts/kruize/tests/storage_test.yaml rename to charts/kruize/tests/common-tests/storage_test.yaml index 6762451..2587fcc 100644 --- a/charts/kruize/tests/storage_test.yaml +++ b/charts/kruize/tests/common-tests/storage_test.yaml @@ -103,5 +103,3 @@ tests: path: metadata.namespace value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/minikube/configmap_minikube_test.yaml b/charts/kruize/tests/minikube/configmap_minikube_test.yaml deleted file mode 100644 index 6f40df8..0000000 --- a/charts/kruize/tests/minikube/configmap_minikube_test.yaml +++ /dev/null @@ -1,64 +0,0 @@ -suite: test configmap templates (minikube) -templates: - - configmap_kruize.yaml - - configmap_nginx.yaml -values: - - ../../values-minikube.yaml - -tests: - - it: should create a kruize ConfigMap with the correct default settings - template: configmap_kruize.yaml - asserts: - - hasDocuments: - count: 1 - - equal: - path: kind - value: ConfigMap - - equal: - path: apiVersion - value: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-kruize-config - - exists: - path: data.dbconfigjson - - exists: - path: data.kruizeconfigjson - - - it: should create a kruize ConfigMap in the release namespace - template: configmap_kruize.yaml - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - - - it: should create a nginx ConfigMap with the correct default settings - template: configmap_nginx.yaml - asserts: - - hasDocuments: - count: 1 - - equal: - path: kind - value: ConfigMap - - equal: - path: apiVersion - value: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-kruize-nginx-config - - exists: - path: data["nginx.conf"] - - - it: should create a nginx ConfigMap in the release namespace - template: configmap_nginx.yaml - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - - -# Made by Bob diff --git a/charts/kruize/tests/minikube/cronjobs_minikube_test.yaml b/charts/kruize/tests/minikube/cronjobs_minikube_test.yaml deleted file mode 100644 index f71889a..0000000 --- a/charts/kruize/tests/minikube/cronjobs_minikube_test.yaml +++ /dev/null @@ -1,108 +0,0 @@ -suite: test cronjobs.yaml (minikube) -templates: - - cronjobs.yaml -values: - - ../../values-minikube.yaml - -tests: - - it: should create two CronJob documents - asserts: - - hasDocuments: - count: 2 - - - it: should create a create-partition CronJob with the correct default settings - documentIndex: 0 - asserts: - - equal: - path: kind - value: CronJob - - equal: - path: apiVersion - value: batch/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-create-partition - - equal: - path: spec.schedule - value: "0 0 25 * *" - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].name - value: kruize-cron-create - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].image - value: "quay.io/kruize/autotune_operator:0.8.1" - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].imagePullPolicy - value: Always - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts[0].name - value: config-volume - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts[0].mountPath - value: /etc/config - - equal: - path: spec.jobTemplate.spec.template.spec.restartPolicy - value: OnFailure - - equal: - path: spec.jobTemplate.spec.template.spec.volumes[0].configMap.name - value: RELEASE-NAME-kruize-config - - - it: should create a delete-partition CronJob with the correct default settings - documentIndex: 1 - asserts: - - equal: - path: kind - value: CronJob - - equal: - path: metadata.name - value: RELEASE-NAME-delete-partition - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].name - value: kruize-cron-delete - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].image - value: "quay.io/kruize/autotune_operator:0.8.1" - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].env - content: - name: deletepartitionsthreshold - value: "15" - - equal: - path: spec.jobTemplate.spec.template.spec.restartPolicy - value: OnFailure - - - it: should create CronJobs with the correct settings overrides - documentIndex: 0 - set: - cronJob.createSchedule: "0 0 1 * *" - kruize.image.tag: "0.9.0" - asserts: - - equal: - path: spec.schedule - value: "0 0 1 * *" - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].image - value: "quay.io/kruize/autotune_operator:0.9.0" - - - it: should use custom deletePartitionsThreshold when specified - documentIndex: 1 - set: - cronJob.deletePartitionsThreshold: "30" - asserts: - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].env - content: - name: deletepartitionsthreshold - value: "30" - - - it: should create CronJobs in the release namespace - documentIndex: 0 - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - - -# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml index 15c1131..4f25104 100644 --- a/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml +++ b/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml @@ -38,6 +38,3 @@ tests: - notExists: path: spec.template.spec.containers[?(@.name=='kruize-db')].resources - -# Made by Bob -# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml deleted file mode 100644 index 4889589..0000000 --- a/charts/kruize/tests/minikube/kruize_db_service_minikube_test.yaml +++ /dev/null @@ -1,66 +0,0 @@ -suite: test kruize_db_service.yaml (minikube) -templates: - - kruize_db_service.yaml -values: - - ../../values-minikube.yaml - -tests: - - it: should create a Service with the correct default settings - asserts: - - hasDocuments: - count: 1 - - equal: - path: kind - value: Service - - equal: - path: apiVersion - value: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-kruize-db-service - - equal: - path: metadata.labels.app - value: RELEASE-NAME-kruize-db - - equal: - path: spec.type - value: ClusterIP - - equal: - path: spec.ports[0].name - value: kruize-db-port - - equal: - path: spec.ports[0].port - value: 5432 - - equal: - path: spec.ports[0].targetPort - value: 5432 - - equal: - path: spec.selector.app - value: RELEASE-NAME-kruize-db - - - it: should create a Service with the correct settings overrides - set: - db.service.type: NodePort - db.service.port: 5433 - asserts: - - hasDocuments: - count: 1 - - equal: - path: spec.type - value: NodePort - - equal: - path: spec.ports[0].port - value: 5433 - - equal: - path: spec.ports[0].targetPort - value: 5433 - - - it: should create a Service in the release namespace - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - - -# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml index 4e71d8d..4f211eb 100644 --- a/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml +++ b/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml @@ -18,6 +18,24 @@ tests: - equal: path: metadata.namespace value: NAMESPACE + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize + - equal: + path: metadata.labels["app.kubernetes.io/name"] + value: kruize + - equal: + path: metadata.labels["app.kubernetes.io/instance"] + value: RELEASE-NAME + - equal: + path: metadata.labels["app.kubernetes.io/version"] + value: "0.8.1" + - equal: + path: metadata.labels["app.kubernetes.io/managed-by"] + value: Helm + - equal: + path: metadata.labels["helm.sh/chart"] + value: kruize-0.1.0 - equal: path: spec.replicas value: 1 @@ -29,6 +47,7 @@ tests: - equal: path: spec.template.metadata.labels value: + app: RELEASE-NAME-kruize app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME @@ -118,6 +137,3 @@ tests: value: "RELEASE-NAME-kruize-config" - -# Made by Bob -# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_service_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_service_minikube_test.yaml deleted file mode 100644 index 17b826f..0000000 --- a/charts/kruize/tests/minikube/kruize_service_minikube_test.yaml +++ /dev/null @@ -1,78 +0,0 @@ -suite: test kruize_service.yaml (minikube) -templates: - - kruize_service.yaml -values: - - ../../values-minikube.yaml - -tests: - - it: should create a Service with the correct default settings - asserts: - - hasDocuments: - count: 1 - - equal: - path: kind - value: Service - - equal: - path: apiVersion - value: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-kruize - - equal: - path: metadata.labels - value: - helm.sh/chart: kruize-0.1.0 - app.kubernetes.io/name: kruize - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" - app.kubernetes.io/managed-by: Helm - - equal: - path: metadata.annotations - value: - prometheus.io/scrape: 'true' - prometheus.io/path: '/metrics' - - equal: - path: spec.type - value: NodePort - - equal: - path: spec.selector - value: - app.kubernetes.io/name: kruize - app.kubernetes.io/instance: RELEASE-NAME - - equal: - path: spec.ports[0].name - value: kruize-port - - equal: - path: spec.ports[0].port - value: 8080 - - equal: - path: spec.ports[0].targetPort - value: 8080 - - - it: should create a Service with the correct settings overrides - set: - kruize.service.type: ClusterIP - kruize.service.port: 9090 - asserts: - - hasDocuments: - count: 1 - - equal: - path: spec.type - value: ClusterIP - - equal: - path: spec.ports[0].port - value: 9090 - - equal: - path: spec.ports[0].targetPort - value: 9090 - - - it: should create a Service in the release namespace - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - - -# Made by Bob diff --git a/charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml b/charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml deleted file mode 100644 index a05de84..0000000 --- a/charts/kruize/tests/minikube/kruize_ui_minikube_test.yaml +++ /dev/null @@ -1,133 +0,0 @@ -suite: test kruize UI templates (minikube) -templates: - - kruize_ui_nginx_pod.yaml - - kruize_ui_nginx_service.yaml -values: - - ../../values-minikube.yaml - -tests: - - it: should create a UI nginx Pod with the correct default settings - template: kruize_ui_nginx_pod.yaml - asserts: - - hasDocuments: - count: 1 - - equal: - path: kind - value: Pod - - equal: - path: apiVersion - value: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-kruize-ui-nginx-pod - - equal: - path: metadata.labels.app - value: kruize-ui-nginx - - equal: - path: spec.containers[0].name - value: kruize-ui-nginx-container - - equal: - path: spec.containers[0].image - value: "quay.io/kruize/kruize-ui:0.0.8" - - equal: - path: spec.containers[0].imagePullPolicy - value: Always - - contains: - path: spec.containers[0].env - content: - name: KRUIZE_UI_ENV - value: "production" - - equal: - path: spec.containers[0].volumeMounts[0].name - value: nginx-config-volume - - equal: - path: spec.containers[0].volumeMounts[0].mountPath - value: /etc/nginx/nginx.conf - - equal: - path: spec.containers[0].volumeMounts[0].subPath - value: nginx.conf - - equal: - path: spec.volumes[0].name - value: nginx-config-volume - - equal: - path: spec.volumes[0].configMap.name - value: RELEASE-NAME-kruize-nginx-config - - - it: should create a UI nginx Pod with the correct settings overrides - template: kruize_ui_nginx_pod.yaml - set: - kruizeUI.image.tag: "0.1.0" - kruizeUI.image.pullPolicy: IfNotPresent - asserts: - - equal: - path: spec.containers[0].image - value: "quay.io/kruize/kruize-ui:0.1.0" - - equal: - path: spec.containers[0].imagePullPolicy - value: IfNotPresent - - - it: should create a UI nginx Pod in the release namespace - template: kruize_ui_nginx_pod.yaml - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - - - it: should create a UI nginx Service with the correct default settings - template: kruize_ui_nginx_service.yaml - asserts: - - hasDocuments: - count: 1 - - equal: - path: kind - value: Service - - equal: - path: apiVersion - value: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-kruize-ui-nginx-service - - equal: - path: spec.type - value: NodePort - - equal: - path: spec.ports[0].name - value: http - - equal: - path: spec.ports[0].port - value: 8080 - - equal: - path: spec.ports[0].targetPort - value: 8080 - - equal: - path: spec.selector.app - value: kruize-ui-nginx - - - it: should create a UI nginx Service with the correct settings overrides - template: kruize_ui_nginx_service.yaml - set: - kruizeUI.service.type: ClusterIP - kruizeUI.service.port: 9090 - asserts: - - equal: - path: spec.type - value: ClusterIP - - equal: - path: spec.ports[0].port - value: 9090 - - equal: - path: spec.ports[0].targetPort - value: 9090 - - - it: should create a UI nginx Service in the release namespace - template: kruize_ui_nginx_service.yaml - release: - namespace: custom-namespace - asserts: - - equal: - path: metadata.namespace - value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/minikube/network_policy_minikube_test.yaml b/charts/kruize/tests/minikube/network_policy_minikube_test.yaml index 1f5e8ac..9933c3f 100644 --- a/charts/kruize/tests/minikube/network_policy_minikube_test.yaml +++ b/charts/kruize/tests/minikube/network_policy_minikube_test.yaml @@ -36,6 +36,7 @@ tests: - equal: path: spec.ingress[0].from[0].podSelector.matchLabels value: + app: RELEASE-NAME-kruize app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - equal: @@ -61,4 +62,3 @@ tests: value: custom-namespace -# Made by Bob diff --git a/charts/kruize/tests/minikube/rbac_minikube_test.yaml b/charts/kruize/tests/minikube/rbac_minikube_test.yaml index c93c78f..4fcda73 100644 --- a/charts/kruize/tests/minikube/rbac_minikube_test.yaml +++ b/charts/kruize/tests/minikube/rbac_minikube_test.yaml @@ -155,5 +155,3 @@ tests: path: roleRef.name value: RELEASE-NAME-kruize-edit-ko - -# Made by Bob diff --git a/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml b/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml index 614a015..c9df138 100644 --- a/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml +++ b/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml @@ -21,6 +21,7 @@ tests: - equal: path: metadata.labels value: + app: RELEASE-NAME-kruize helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME @@ -29,6 +30,7 @@ tests: - equal: path: spec.selector.matchLabels value: + app: RELEASE-NAME-kruize app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - equal: @@ -67,5 +69,3 @@ tests: path: spec.namespaceSelector.matchNames[0] value: custom-namespace - -# Made by Bob diff --git a/charts/kruize/tests/minikube/storage_minikube_test.yaml b/charts/kruize/tests/minikube/storage_minikube_test.yaml index cd89a04..57b792f 100644 --- a/charts/kruize/tests/minikube/storage_minikube_test.yaml +++ b/charts/kruize/tests/minikube/storage_minikube_test.yaml @@ -109,4 +109,3 @@ tests: value: custom-namespace -# Made by Bob diff --git a/charts/kruize/tests/kruize_deployment_test.yaml b/charts/kruize/tests/openshift/kruize_deployment_test.yaml similarity index 88% rename from charts/kruize/tests/kruize_deployment_test.yaml rename to charts/kruize/tests/openshift/kruize_deployment_test.yaml index b5a12a5..08347e2 100644 --- a/charts/kruize/tests/kruize_deployment_test.yaml +++ b/charts/kruize/tests/openshift/kruize_deployment_test.yaml @@ -1,6 +1,8 @@ -suite: test kruize_deployment.yaml +suite: test kruize_deployment.yaml (openshift) templates: - kruize_deployment.yaml +values: + - ../../values-openshift.yaml tests: - it: should create a Deployment with the correct default settings @@ -13,6 +15,24 @@ tests: - equal: path: metadata.name value: RELEASE-NAME-kruize + - equal: + path: metadata.labels.app + value: RELEASE-NAME-kruize + - equal: + path: metadata.labels["app.kubernetes.io/name"] + value: kruize + - equal: + path: metadata.labels["app.kubernetes.io/instance"] + value: RELEASE-NAME + - equal: + path: metadata.labels["app.kubernetes.io/version"] + value: "0.8.1" + - equal: + path: metadata.labels["app.kubernetes.io/managed-by"] + value: Helm + - equal: + path: metadata.labels["helm.sh/chart"] + value: kruize-0.1.0 - equal: path: spec.replicas value: 1 @@ -143,6 +163,3 @@ tests: path: spec.template.spec.containers[?(@.name=='kruize')].resources.limits.cpu value: 2 - -# Made by Bob -# Made by Bob diff --git a/charts/kruize/tests/rbac_test.yaml b/charts/kruize/tests/openshift/rbac_test.yaml similarity index 98% rename from charts/kruize/tests/rbac_test.yaml rename to charts/kruize/tests/openshift/rbac_test.yaml index 1e808de..2de039d 100644 --- a/charts/kruize/tests/rbac_test.yaml +++ b/charts/kruize/tests/openshift/rbac_test.yaml @@ -1,8 +1,10 @@ -suite: test RBAC resources +suite: test RBAC resources (openshift) templates: - service_account.yaml - role.yaml - rolebinding.yaml +values: + - ../../values-openshift.yaml tests: - it: should not create ServiceAccount when disabled @@ -207,5 +209,3 @@ tests: - hasDocuments: count: 3 - -# Made by Bob diff --git a/charts/kruize/values-openshift.yaml b/charts/kruize/values-openshift.yaml new file mode 100644 index 0000000..f8b4e84 --- /dev/null +++ b/charts/kruize/values-openshift.yaml @@ -0,0 +1,52 @@ +# OpenShift-specific values for Kruize Helm Chart +# This file represents the default values.yaml settings for OpenShift deployments + +# Kruize Configuration +kruize: + config: + k8sType: "openshift" + + # OpenShift-specific datasource configuration + datasource: + - name: "prometheus-1" + provider: "prometheus" + serviceName: "prometheus-k8s" + namespace: "openshift-monitoring" + url: "" + authentication: + type: "bearer" + credentials: + tokenFilePath: "/var/run/secrets/kubernetes.io/serviceaccount/token" + + - name: "thanos-1" + provider: "prometheus" + serviceName: "thanos-querier" + namespace: "openshift-monitoring" + url: "" + authentication: + type: "bearer" + credentials: + tokenFilePath: "/var/run/secrets/kubernetes.io/serviceaccount/token" + +# RBAC Configuration +rbac: + # Enable OpenShift-specific RBAC resources + create: true + +# Service Account Configuration +serviceAccount: + # Create service account for OpenShift + create: true + name: "" + +# Network Policy Configuration +networkPolicy: + # Disable network policy for OpenShift (uses OpenShift's built-in network policies) + enabled: false + +# Monitoring Configuration +monitoring: + enabled: true + interval: 30s + + diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml index c4f6df7..2840a48 100644 --- a/charts/kruize/values.yaml +++ b/charts/kruize/values.yaml @@ -48,9 +48,9 @@ kruize: - name: KAFKA_RESPONSE_FILTER_EXCLUDE value: "" - config: + config: clusterType: "kubernetes" - k8sType: "openshift" + k8sType: "kubernetes" authType: "" monitoringAgent: "prometheus" monitoringService: "prometheus-k8s" @@ -84,26 +84,7 @@ kruize: secretAccessKey: "" logLevel: "INFO" - datasource: - - name: "prometheus-1" - provider: "prometheus" - serviceName: "prometheus-k8s" - namespace: "openshift-monitoring" - url: "" - authentication: - type: "bearer" - credentials: - tokenFilePath: "/var/run/secrets/kubernetes.io/serviceaccount/token" - - - name: "thanos-1" - provider: "prometheus" - serviceName: "thanos-querier" - namespace: "openshift-monitoring" - url: "" - authentication: - type: "bearer" - credentials: - tokenFilePath: "/var/run/secrets/kubernetes.io/serviceaccount/token" + datasource: [] cronJob: From f2a892893e7783687eb1e82409f60b2e75b66b31 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 9 Apr 2026 21:51:50 +0530 Subject: [PATCH 17/29] Updated workflow to release to Github container registry Signed-off-by: Chandrakala Subramanyam --- .github/workflows/release_to_ghcr.yml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/release_to_ghcr.yml diff --git a/.github/workflows/release_to_ghcr.yml b/.github/workflows/release_to_ghcr.yml new file mode 100644 index 0000000..6254c89 --- /dev/null +++ b/.github/workflows/release_to_ghcr.yml @@ -0,0 +1,38 @@ +name: Release Kruize Helm Chart to GHCR + +on: + push: + tags: + - 'v*.*.*' # Trigger on version tags like v0.1.0 + workflow_dispatch: + +permissions: + contents: write + packages: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + ref: mvp_demo + + - name: Install Helm + uses: azure/setup-helm@v5.0.0 + + - name: Login to GHCR + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin + + - name: Package Helm Chart + run: | + helm package charts/kruize + + - name: Push to GHCR + run: | + cd kruize-helm + echo "helm push kruize-*.tgz oci://ghcr.io/${{ github.repository_owner }}" + helm push kruize-*.tgz oci://ghcr.io/${{ github.repository_owner }} + + From ae7c3502cd7473eeca312b60c24799f56c4a6c85 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 9 Apr 2026 21:58:12 +0530 Subject: [PATCH 18/29] Removed ref from checkout Signed-off-by: Chandrakala Subramanyam --- .github/workflows/release_to_ghcr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release_to_ghcr.yml b/.github/workflows/release_to_ghcr.yml index 6254c89..cf5af36 100644 --- a/.github/workflows/release_to_ghcr.yml +++ b/.github/workflows/release_to_ghcr.yml @@ -16,7 +16,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - ref: mvp_demo - name: Install Helm uses: azure/setup-helm@v5.0.0 From c226e85c9a3f26b5bdae04725b3e5da810a76271 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 9 Apr 2026 22:01:33 +0530 Subject: [PATCH 19/29] Addressed sourcery comments Signed-off-by: Chandrakala Subramanyam --- .github/workflows/release_to_ghcr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release_to_ghcr.yml b/.github/workflows/release_to_ghcr.yml index cf5af36..e9ccabd 100644 --- a/.github/workflows/release_to_ghcr.yml +++ b/.github/workflows/release_to_ghcr.yml @@ -30,7 +30,6 @@ jobs: - name: Push to GHCR run: | - cd kruize-helm echo "helm push kruize-*.tgz oci://ghcr.io/${{ github.repository_owner }}" helm push kruize-*.tgz oci://ghcr.io/${{ github.repository_owner }} From 9d5df792d0aedad8171baca01dfdfefb74cc96fd Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 9 Apr 2026 22:25:35 +0530 Subject: [PATCH 20/29] Fixed permission issues Signed-off-by: Chandrakala Subramanyam --- .github/workflows/release_to_ghcr.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release_to_ghcr.yml b/.github/workflows/release_to_ghcr.yml index e9ccabd..dccfe2d 100644 --- a/.github/workflows/release_to_ghcr.yml +++ b/.github/workflows/release_to_ghcr.yml @@ -6,19 +6,21 @@ on: - 'v*.*.*' # Trigger on version tags like v0.1.0 workflow_dispatch: -permissions: - contents: write - packages: write jobs: release: + permissions: + contents: write + packages: write runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Install Helm - uses: azure/setup-helm@v5.0.0 + uses: azure/setup-helm@v4 + with: + version: 3.14.4 - name: Login to GHCR run: | @@ -30,7 +32,12 @@ jobs: - name: Push to GHCR run: | - echo "helm push kruize-*.tgz oci://ghcr.io/${{ github.repository_owner }}" - helm push kruize-*.tgz oci://ghcr.io/${{ github.repository_owner }} + for pkg in ./*.tgz; do + if [ -z "${pkg:-}" ]; then + break + fi + echo "helm push ${pkg} oci://ghcr.io/${{ github.repository_owner }}" + helm push "${pkg}" oci://ghcr.io/${{ github.repository_owner }} + done From d1dcfb2e6e90d03a10dc7344299152e0d90fdf10 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Fri, 13 Mar 2026 23:40:47 +0530 Subject: [PATCH 21/29] Included workflows to run unittests, lint & renamed test folders Signed-off-by: Chandrakala Subramanyam --- .github/workflows/helm-lint.yaml | 110 ++++++++++++++++++ .github/workflows/helm-unittest.yaml | 105 +++++++++++++++++ charts/kruize/README.md | 23 ++-- charts/kruize/tests/README.md | 57 ++++----- .../configmap_test.yaml | 0 .../cronjobs_test.yaml | 0 .../kruize_db_deployment_test.yaml | 0 .../kruize_db_service_test.yaml | 0 .../kruize_service_test.yaml | 0 .../kruize_ui_test.yaml | 0 .../network_policy_test.yaml | 0 .../service_monitor_test.yaml | 0 .../storage_test.yaml | 0 .../kruize_db_deployment_minikube_test.yaml | 0 .../kruize_deployment_minikube_test.yaml | 0 .../network_policy_minikube_test.yaml | 0 .../rbac_minikube_test.yaml | 0 .../service_monitor_minikube_test.yaml | 0 .../storage_minikube_test.yaml | 0 .../kruize_deployment_test.yaml | 0 .../rbac_test.yaml | 0 21 files changed, 255 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/helm-lint.yaml create mode 100644 .github/workflows/helm-unittest.yaml rename charts/kruize/tests/{common-tests => with-default-values}/configmap_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/cronjobs_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/kruize_db_deployment_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/kruize_db_service_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/kruize_service_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/kruize_ui_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/network_policy_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/service_monitor_test.yaml (100%) rename charts/kruize/tests/{common-tests => with-default-values}/storage_test.yaml (100%) rename charts/kruize/tests/{minikube => with-minikube-values}/kruize_db_deployment_minikube_test.yaml (100%) rename charts/kruize/tests/{minikube => with-minikube-values}/kruize_deployment_minikube_test.yaml (100%) rename charts/kruize/tests/{minikube => with-minikube-values}/network_policy_minikube_test.yaml (100%) rename charts/kruize/tests/{minikube => with-minikube-values}/rbac_minikube_test.yaml (100%) rename charts/kruize/tests/{minikube => with-minikube-values}/service_monitor_minikube_test.yaml (100%) rename charts/kruize/tests/{minikube => with-minikube-values}/storage_minikube_test.yaml (100%) rename charts/kruize/tests/{openshift => with-openshift-values}/kruize_deployment_test.yaml (100%) rename charts/kruize/tests/{openshift => with-openshift-values}/rbac_test.yaml (100%) diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml new file mode 100644 index 0000000..6a05c01 --- /dev/null +++ b/.github/workflows/helm-lint.yaml @@ -0,0 +1,110 @@ +name: Helm Lint + +on: + push: + branches: + - main + - mvp_demo + paths: + - 'charts/kruize/**' + - '.github/workflows/helm-lint.yaml' + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + - mvp_demo + paths: + - 'charts/kruize/**' + - '.github/workflows/helm-lint.yaml' + workflow_dispatch: + +env: + HELM_VERSION: v3.13.0 + +jobs: + helm-lint: + name: Lint Helm Chart + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up Helm + uses: azure/setup-helm@v4.3.1 + with: + version: ${{ env.HELM_VERSION }} + + - name: Lint chart with default values + run: | + echo "=== Linting with default values ===" + helm lint charts/kruize + + - name: Lint chart with minikube values + if: always() + run: | + echo "=== Linting with minikube values ===" + if [ -f charts/kruize/values-minikube.yaml ]; then + helm lint charts/kruize -f charts/kruize/values-minikube.yaml + else + echo "⚠️ values-minikube.yaml not found, skipping" + fi + + - name: Lint chart with openshift values + if: always() + run: | + echo "=== Linting with openshift values ===" + if [ -f charts/kruize/values-openshift.yaml ]; then + helm lint charts/kruize -f charts/kruize/values-openshift.yaml + else + echo "⚠️ values-openshift.yaml not found, skipping" + fi + + - name: Validate chart structure + run: | + echo "=== Validating chart structure ===" + + # Check required files + echo "Checking required files..." + required_files=( + "charts/kruize/Chart.yaml" + "charts/kruize/values.yaml" + "charts/kruize/templates" + ) + + for file in "${required_files[@]}"; do + if [ -e "$file" ]; then + echo "✅ $file exists" + else + echo "❌ $file is missing" + exit 1 + fi + done + + echo "" + echo "Chart structure validation passed!" + + - name: Lint Summary + if: always() + run: | + echo "=== Helm Lint Summary ===" + echo "" + echo "Linted configurations:" + echo " ✅ Default values" + + if [ -f charts/kruize/values-minikube.yaml ]; then + echo " ✅ Minikube values" + else + echo " ⚠️ Minikube values (not found)" + fi + + if [ -f charts/kruize/values-openshift.yaml ]; then + echo " ✅ OpenShift values" + else + echo " ⚠️ OpenShift values (not found)" + fi + + echo "" + echo "Lint checks completed!" + + diff --git a/.github/workflows/helm-unittest.yaml b/.github/workflows/helm-unittest.yaml new file mode 100644 index 0000000..1611710 --- /dev/null +++ b/.github/workflows/helm-unittest.yaml @@ -0,0 +1,105 @@ +name: Helm Unit Tests + +on: + push: + branches: + - main + - mvp_demo + paths: + - 'charts/kruize/**' + - '.github/workflows/helm-unittest.yaml' + pull_request: + types: [opened, synchronize, reopened] + branches: + - main + - mvp_demo + paths: + - 'charts/kruize/**' + - '.github/workflows/helm-unittest.yaml' + workflow_dispatch: + +env: + HELM_VERSION: v3.13.0 + +jobs: + helm-unittest: + name: Run Helm Unit Tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Set up Helm + uses: azure/setup-helm@v4.3.1 + with: + version: ${{ env.HELM_VERSION }} + + - name: Install helm-unittest plugin + run: | + helm plugin install https://github.com/helm-unittest/helm-unittest + + - name: Run unit tests + run: | + echo "Running all Helm unit tests with different values configurations..." + echo " • with-default-values/ - Tests using default values.yaml" + echo " • with-minikube-values/ - Tests using values-minikube.yaml" + echo " • with-openshift-values/ - Tests using values-openshift.yaml" + echo "" + helm unittest charts/kruize --color --with-subchart=false + + - name: Generate JUnit test report + if: always() + run: | + helm unittest --output-type JUnit --output-file test-results.xml --with-subchart=false charts/kruize + + - name: Generate HTML test report + if: always() + run: | + helm unittest --output-type html --output-file test-results.html --with-subchart=false charts/kruize + + - name: Upload test results (XML & HTML) + if: always() + uses: actions/upload-artifact@v7 + with: + name: helm-unittest-results + path: | + test-results.xml + test-results.html + retention-days: 4 + + - name: Test Summary + if: always() + run: | + echo "=== Helm Unit Test Summary ===" + echo "" + echo "Test suites executed:" + echo " • with-default-values/ - Tests using default values.yaml" + echo " • with-minikube-values/ - Tests using values-minikube.yaml" + echo " • with-openshift-values/ - Tests using values-openshift.yaml" + echo "" + echo "Note: All tests are unit tests that render and validate templates." + echo "No actual Kubernetes cluster is required to run these tests." + echo "" + if [ -f test-results.xml ]; then + echo "✅ Test results generated successfully" + echo "📊 View detailed results in the artifacts" + + # Count test results + TESTS=$(grep -o 'tests="[0-9]*"' test-results.xml | head -1 | grep -o '[0-9]*' || echo "0") + FAILURES=$(grep -o 'failures="[0-9]*"' test-results.xml | head -1 | grep -o '[0-9]*' || echo "0") + + echo "" + echo "Total tests: $TESTS" + echo "Failures: $FAILURES" + + if [ "$FAILURES" -gt 0 ]; then + echo "❌ Some tests failed" + exit 1 + fi + else + echo "❌ Test results not found" + exit 1 + fi + + diff --git a/charts/kruize/README.md b/charts/kruize/README.md index 3339080..dbe3a03 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -12,9 +12,16 @@ Kruize is an intelligent resource optimization platform that helps you optimize - Helm 3.0+ - [Prometheus](https://github.com/prometheus/prometheus) (for Minikube, Kind clusters) -## Installing the Chart +## Installation -### OpenShift Installation +### From Source Code + +To install the chart from source code, run: + +git clone https://github.com/kruize/kruize-helm +cd kruize-helm + +#### OpenShift Installation To install the chart with OpenShift-specific configuration: @@ -28,7 +35,7 @@ To install in a specific namespace: helm install kruize ./charts/kruize -f ./charts/kruize/values-openshift.yaml --namespace openshift-tuning --create-namespace ``` -### Minikube Installation +#### Minikube Installation To install the chart with Minikube-specific configuration: @@ -42,20 +49,12 @@ To install in a specific namespace: helm install kruize ./charts/kruize -f ./charts/kruize/values-minikube.yaml --namespace monitoring --create-namespace ``` -### Generic Kubernetes Installation - -To install with default values (generic Kubernetes): - -```bash -helm install kruize ./charts/kruize -``` - ## Uninstalling the Chart To uninstall/delete the `kruize` deployment: ```bash -helm uninstall kruize +helm uninstall kruize -n ``` ## Configuration diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md index 9d9795a..7ba9cd0 100644 --- a/charts/kruize/tests/README.md +++ b/charts/kruize/tests/README.md @@ -16,50 +16,50 @@ helm plugin install https://github.com/helm-unittest/helm-unittest ### Run all tests ```bash -helm unittest -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' charts/kruize +helm unittest -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' charts/kruize ``` Or from within the chart directory: ```bash cd charts/kruize -helm unittest -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . +helm unittest -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . ``` -### Run common tests only +### Run tests with default values only ```bash cd charts/kruize -helm unittest -f 'tests/common-tests/*.yaml' . +helm unittest -f 'tests/with-default-values/*.yaml' . ``` -### Run OpenShift-specific tests +### Run tests with OpenShift values ```bash cd charts/kruize -helm unittest -f 'tests/openshift/*.yaml' . +helm unittest -f 'tests/with-openshift-values/*.yaml' . ``` -### Run Minikube-specific tests +### Run tests with Minikube values ```bash cd charts/kruize -helm unittest -f 'tests/minikube/*.yaml' . +helm unittest -f 'tests/with-minikube-values/*.yaml' . ``` ### Run tests with verbose output ```bash cd charts/kruize -helm unittest -v -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . +helm unittest -v -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . ``` ### Generate JUnit Test Report ```bash cd charts/kruize -helm unittest --output-type JUnit --output-file test-results.xml -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . +helm unittest --output-type JUnit --output-file test-results.xml -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . ``` ## Directory Structure ``` tests/ -├── common-tests/ # Tests that work across all platforms (39 tests) +├── with-default-values/ # Tests using default values.yaml (39 tests) │ ├── configmap_test.yaml │ ├── cronjobs_test.yaml │ ├── kruize_db_deployment_test.yaml @@ -70,11 +70,11 @@ tests/ │ ├── service_monitor_test.yaml │ └── storage_test.yaml │ -├── openshift/ # OpenShift-specific tests (20 tests) +├── with-openshift-values/ # Tests using values-openshift.yaml (20 tests) │ ├── kruize_deployment_test.yaml │ └── rbac_test.yaml │ -└── minikube/ # Minikube-specific tests (34 tests) +└── with-minikube-values/ # Tests using values-minikube.yaml (34 tests) ├── kruize_db_deployment_minikube_test.yaml ├── kruize_deployment_minikube_test.yaml ├── network_policy_minikube_test.yaml @@ -83,20 +83,21 @@ tests/ └── storage_minikube_test.yaml ``` +> **Important:** All tests are **unit tests** that render and validate Helm templates. They do not require an actual Kubernetes cluster to run. The folder names indicate which values file configuration is being tested, not which cluster type is required. -## Environment-specific Tests +## Values-based Test Organization -### Common Tests (`tests/common-tests/`) -Tests that work across all platforms using default `values.yaml`. These validate core functionality that is consistent regardless of deployment platform. +### Tests with Default Values (`tests/with-default-values/`) +Tests that use the default `values.yaml`. These validate core functionality with standard configurations. -### OpenShift Tests (`tests/openshift/`) +### Tests with OpenShift Values (`tests/with-openshift-values/`) Tests that use `values-openshift.yaml` to validate OpenShift-specific configurations: - `serviceAccount.create: true` — creates a dedicated service account - `rbac.create: true` — includes OpenShift-specific ClusterRoleBindings (cluster-monitoring-view, SCC anyuid) - Resource requests/limits are set - Full KAFKA_RESPONSE_FILTER_INCLUDE configuration -### Minikube Tests (`tests/minikube/`) +### Tests with Minikube Values (`tests/with-minikube-values/`) Tests that use `values-minikube.yaml` to validate minikube-specific configurations: - `serviceAccount.create: false` — uses the `default` service account - `rbac.create: false` — skips OpenShift-specific ClusterRoleBindings @@ -165,18 +166,18 @@ tests: When adding new templates or modifying existing ones: -1. **For common functionality** (works across all platforms): - - Create or update test file in `charts/kruize/tests/common-tests/` +1. **For tests with default values**: + - Create or update test file in `charts/kruize/tests/with-default-values/` - Follow naming convention: `_test.yaml` - Use default `values.yaml` -2. **For OpenShift-specific behavior**: - - Create or update test file in `charts/kruize/tests/openshift/` +2. **For tests with OpenShift values**: + - Create or update test file in `charts/kruize/tests/with-openshift-values/` - Add `values: - ../../values-openshift.yaml` to the test suite - Test OpenShift-specific features (RBAC, SCC, monitoring, etc.) -3. **For Minikube-specific behavior**: - - Create or update test file in `charts/kruize/tests/minikube/` +3. **For tests with Minikube values**: + - Create or update test file in `charts/kruize/tests/with-minikube-values/` - Add `values: - ../../values-minikube.yaml` to the test suite - Test minikube-specific overrides (empty resources, default SA, etc.) @@ -200,15 +201,15 @@ helm plugin install https://github.com/helm-unittest/helm-unittest Run with verbose output to see detailed failure information: ```bash -helm unittest -v -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' charts/kruize +helm unittest -v -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' charts/kruize ``` ### Debugging Specific Tests ```bash -helm unittest -f 'tests/common-tests/kruize_db_deployment_test.yaml' -v charts/kruize -helm unittest -f 'tests/openshift/kruize_deployment_test.yaml' -v charts/kruize -helm unittest -f 'tests/minikube/kruize_deployment_minikube_test.yaml' -v charts/kruize +helm unittest -f 'tests/with-default-values/kruize_db_deployment_test.yaml' -v charts/kruize +helm unittest -f 'tests/with-openshift-values/kruize_deployment_test.yaml' -v charts/kruize +helm unittest -f 'tests/with-minikube-values/kruize_deployment_minikube_test.yaml' -v charts/kruize ``` ## Resources diff --git a/charts/kruize/tests/common-tests/configmap_test.yaml b/charts/kruize/tests/with-default-values/configmap_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/configmap_test.yaml rename to charts/kruize/tests/with-default-values/configmap_test.yaml diff --git a/charts/kruize/tests/common-tests/cronjobs_test.yaml b/charts/kruize/tests/with-default-values/cronjobs_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/cronjobs_test.yaml rename to charts/kruize/tests/with-default-values/cronjobs_test.yaml diff --git a/charts/kruize/tests/common-tests/kruize_db_deployment_test.yaml b/charts/kruize/tests/with-default-values/kruize_db_deployment_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/kruize_db_deployment_test.yaml rename to charts/kruize/tests/with-default-values/kruize_db_deployment_test.yaml diff --git a/charts/kruize/tests/common-tests/kruize_db_service_test.yaml b/charts/kruize/tests/with-default-values/kruize_db_service_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/kruize_db_service_test.yaml rename to charts/kruize/tests/with-default-values/kruize_db_service_test.yaml diff --git a/charts/kruize/tests/common-tests/kruize_service_test.yaml b/charts/kruize/tests/with-default-values/kruize_service_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/kruize_service_test.yaml rename to charts/kruize/tests/with-default-values/kruize_service_test.yaml diff --git a/charts/kruize/tests/common-tests/kruize_ui_test.yaml b/charts/kruize/tests/with-default-values/kruize_ui_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/kruize_ui_test.yaml rename to charts/kruize/tests/with-default-values/kruize_ui_test.yaml diff --git a/charts/kruize/tests/common-tests/network_policy_test.yaml b/charts/kruize/tests/with-default-values/network_policy_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/network_policy_test.yaml rename to charts/kruize/tests/with-default-values/network_policy_test.yaml diff --git a/charts/kruize/tests/common-tests/service_monitor_test.yaml b/charts/kruize/tests/with-default-values/service_monitor_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/service_monitor_test.yaml rename to charts/kruize/tests/with-default-values/service_monitor_test.yaml diff --git a/charts/kruize/tests/common-tests/storage_test.yaml b/charts/kruize/tests/with-default-values/storage_test.yaml similarity index 100% rename from charts/kruize/tests/common-tests/storage_test.yaml rename to charts/kruize/tests/with-default-values/storage_test.yaml diff --git a/charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/kruize_db_deployment_minikube_test.yaml similarity index 100% rename from charts/kruize/tests/minikube/kruize_db_deployment_minikube_test.yaml rename to charts/kruize/tests/with-minikube-values/kruize_db_deployment_minikube_test.yaml diff --git a/charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/kruize_deployment_minikube_test.yaml similarity index 100% rename from charts/kruize/tests/minikube/kruize_deployment_minikube_test.yaml rename to charts/kruize/tests/with-minikube-values/kruize_deployment_minikube_test.yaml diff --git a/charts/kruize/tests/minikube/network_policy_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/network_policy_minikube_test.yaml similarity index 100% rename from charts/kruize/tests/minikube/network_policy_minikube_test.yaml rename to charts/kruize/tests/with-minikube-values/network_policy_minikube_test.yaml diff --git a/charts/kruize/tests/minikube/rbac_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/rbac_minikube_test.yaml similarity index 100% rename from charts/kruize/tests/minikube/rbac_minikube_test.yaml rename to charts/kruize/tests/with-minikube-values/rbac_minikube_test.yaml diff --git a/charts/kruize/tests/minikube/service_monitor_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/service_monitor_minikube_test.yaml similarity index 100% rename from charts/kruize/tests/minikube/service_monitor_minikube_test.yaml rename to charts/kruize/tests/with-minikube-values/service_monitor_minikube_test.yaml diff --git a/charts/kruize/tests/minikube/storage_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/storage_minikube_test.yaml similarity index 100% rename from charts/kruize/tests/minikube/storage_minikube_test.yaml rename to charts/kruize/tests/with-minikube-values/storage_minikube_test.yaml diff --git a/charts/kruize/tests/openshift/kruize_deployment_test.yaml b/charts/kruize/tests/with-openshift-values/kruize_deployment_test.yaml similarity index 100% rename from charts/kruize/tests/openshift/kruize_deployment_test.yaml rename to charts/kruize/tests/with-openshift-values/kruize_deployment_test.yaml diff --git a/charts/kruize/tests/openshift/rbac_test.yaml b/charts/kruize/tests/with-openshift-values/rbac_test.yaml similarity index 100% rename from charts/kruize/tests/openshift/rbac_test.yaml rename to charts/kruize/tests/with-openshift-values/rbac_test.yaml From f5cf45c9ddd3cacd031037ce40b490b98f1afc9b Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 16 Mar 2026 22:52:33 +0530 Subject: [PATCH 22/29] Fixed issues with helm unittest workflow Signed-off-by: Chandrakala Subramanyam --- .github/workflows/helm-unittest.yaml | 51 ++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/.github/workflows/helm-unittest.yaml b/.github/workflows/helm-unittest.yaml index 1611710..176fb4c 100644 --- a/.github/workflows/helm-unittest.yaml +++ b/.github/workflows/helm-unittest.yaml @@ -37,7 +37,7 @@ jobs: - name: Install helm-unittest plugin run: | - helm plugin install https://github.com/helm-unittest/helm-unittest + helm plugin install https://github.com/helm-unittest/helm-unittest --version 1.0.3 - name: Run unit tests run: | @@ -46,17 +46,32 @@ jobs: echo " • with-minikube-values/ - Tests using values-minikube.yaml" echo " • with-openshift-values/ - Tests using values-openshift.yaml" echo "" - helm unittest charts/kruize --color --with-subchart=false + helm unittest \ + -f 'tests/with-default-values/*.yaml' \ + -f 'tests/with-minikube-values/*.yaml' \ + -f 'tests/with-openshift-values/*.yaml' \ + --color --with-subchart=false \ + charts/kruize - name: Generate JUnit test report if: always() run: | - helm unittest --output-type JUnit --output-file test-results.xml --with-subchart=false charts/kruize + helm unittest \ + -f 'tests/with-default-values/*.yaml' \ + -f 'tests/with-minikube-values/*.yaml' \ + -f 'tests/with-openshift-values/*.yaml' \ + --output-type JUnit --output-file test-results.xml --with-subchart=false \ + charts/kruize - name: Generate HTML test report if: always() run: | - helm unittest --output-type html --output-file test-results.html --with-subchart=false charts/kruize + helm unittest \ + -f 'tests/with-default-values/*.yaml' \ + -f 'tests/with-minikube-values/*.yaml' \ + -f 'tests/with-openshift-values/*.yaml' \ + --output-type html --output-file test-results.html --with-subchart=false \ + charts/kruize - name: Upload test results (XML & HTML) if: always() @@ -85,18 +100,40 @@ jobs: echo "✅ Test results generated successfully" echo "📊 View detailed results in the artifacts" - # Count test results - TESTS=$(grep -o 'tests="[0-9]*"' test-results.xml | head -1 | grep -o '[0-9]*' || echo "0") - FAILURES=$(grep -o 'failures="[0-9]*"' test-results.xml | head -1 | grep -o '[0-9]*' || echo "0") + # Count test results - try multiple patterns for different XML formats + TESTS=$(grep -oP 'tests="\K[0-9]+' test-results.xml | head -1) + FAILURES=$(grep -oP 'failures="\K[0-9]+' test-results.xml | head -1) + + # If empty, try testsuites format + if [ -z "$TESTS" ]; then + TESTS=$(grep -oP ' Date: Wed, 8 Apr 2026 13:34:03 +0530 Subject: [PATCH 23/29] Switched to checkout v4 Signed-off-by: Chandrakala Subramanyam --- .github/workflows/helm-lint.yaml | 2 +- .github/workflows/helm-unittest.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-lint.yaml b/.github/workflows/helm-lint.yaml index 6a05c01..418a12e 100644 --- a/.github/workflows/helm-lint.yaml +++ b/.github/workflows/helm-lint.yaml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Set up Helm uses: azure/setup-helm@v4.3.1 diff --git a/.github/workflows/helm-unittest.yaml b/.github/workflows/helm-unittest.yaml index 176fb4c..fa18560 100644 --- a/.github/workflows/helm-unittest.yaml +++ b/.github/workflows/helm-unittest.yaml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: Set up Helm uses: azure/setup-helm@v4.3.1 From ac7c2c61f54a32d2e9adcd12dde89fd5c2ef90b9 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 20 Apr 2026 18:01:11 +0530 Subject: [PATCH 24/29] Updated templates & tests for Kruize UI pod to deployment Signed-off-by: Chandrakala Subramanyam --- charts/kruize/Chart.yaml | 2 +- charts/kruize/README.md | 5 +- .../templates/kruize_ui_nginx_depoyment.yaml | 36 +++++++++++ .../kruize/templates/kruize_ui_nginx_pod.yaml | 25 -------- charts/kruize/tests/README.md | 19 +++++- .../with-default-values/cronjobs_test.yaml | 4 +- .../kruize_service_test.yaml | 2 +- .../with-default-values/kruize_ui_test.yaml | 64 ++++++++++++------- .../network_policy_test.yaml | 2 +- .../service_monitor_test.yaml | 2 +- .../kruize_deployment_minikube_test.yaml | 4 +- .../network_policy_minikube_test.yaml | 2 +- .../service_monitor_minikube_test.yaml | 2 +- .../kruize_deployment_test.yaml | 4 +- .../with-openshift-values/rbac_test.yaml | 2 +- charts/kruize/values.yaml | 5 +- 16 files changed, 111 insertions(+), 69 deletions(-) create mode 100644 charts/kruize/templates/kruize_ui_nginx_depoyment.yaml delete mode 100644 charts/kruize/templates/kruize_ui_nginx_pod.yaml diff --git a/charts/kruize/Chart.yaml b/charts/kruize/Chart.yaml index 2bda1eb..bdfc388 100644 --- a/charts/kruize/Chart.yaml +++ b/charts/kruize/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kruize description: Optimize resources used by your containerized workloads -appVersion: "0.8.1" +appVersion: "0.9" home: "https://kruize.io" icon: "https://raw.githubusercontent.com/kruize/kruize-helm/main/docs/images/kruize-icon.png" diff --git a/charts/kruize/README.md b/charts/kruize/README.md index dbe3a03..01695b0 100644 --- a/charts/kruize/README.md +++ b/charts/kruize/README.md @@ -67,7 +67,7 @@ The following table lists the configurable parameters of the Kruize chart and th |-----------|-------------|---------| | `kruize.image.repository` | Repository for Kruize container image | `quay.io/kruize/autotune_operator` | | `kruize.image.pullPolicy` | Image pull policy for the Kruize container image | `Always` | -| `kruize.image.tag` | Image tag for Kruize container | `0.8.1` | +| `kruize.image.tag` | Image tag for Kruize container | `0.9` | | `kruize.replicaCount` | Replica count for the Kruize container | `1` | | `kruize.resources.requests.memory` | Memory resource request for the Kruize container | `768Mi` | | `kruize.resources.requests.cpu` | CPU resource request for the Kruize container | `0.7` | @@ -180,7 +180,8 @@ The following table lists the configurable parameters of the Kruize chart and th |-----------|-------------|---------| | `kruizeUI.image.repository` | Repository for Kruize UI container image | `quay.io/kruize/kruize-ui` | | `kruizeUI.image.pullPolicy` | Image pull policy for the Kruize UI container image | `Always` | -| `kruizeUI.image.tag` | Image tag for Kruize UI container | `0.0.8` | +| `kruizeUI.image.tag` | Image tag for Kruize UI container | `0.1.0` | +| `kruizeUI.replicaCount` | Replica count for the Kruize UI container | `1` | | `kruizeUI.service.type` | Kruize UI service type | `NodePort` | | `kruizeUI.service.port` | Kruize UI service port | `8080` | diff --git a/charts/kruize/templates/kruize_ui_nginx_depoyment.yaml b/charts/kruize/templates/kruize_ui_nginx_depoyment.yaml new file mode 100644 index 0000000..32fe953 --- /dev/null +++ b/charts/kruize/templates/kruize_ui_nginx_depoyment.yaml @@ -0,0 +1,36 @@ +{{- $fullName := include "kruize.fullname" . -}} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ $fullName }}-ui-nginx + namespace: {{ .Release.Namespace }} + labels: + app: {{ $fullName }}-ui-nginx +spec: + replicas: {{ .Values.kruizeUI.replicaCount }} + strategy: + type: RollingUpdate + selector: + matchLabels: + app: {{ $fullName }}-ui-nginx + template: + metadata: + labels: + app: {{ $fullName }}-ui-nginx + spec: + containers: + - name: kruize-ui-nginx-container + image: "{{ .Values.kruizeUI.image.repository }}:{{ .Values.kruizeUI.image.tag }}" + imagePullPolicy: {{ .Values.kruizeUI.image.pullPolicy }} + env: + - name: KRUIZE_UI_ENV + value: "production" + volumeMounts: + - name: nginx-config-volume + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + volumes: + - name: nginx-config-volume + configMap: + name: {{ $fullName }}-nginx-config diff --git a/charts/kruize/templates/kruize_ui_nginx_pod.yaml b/charts/kruize/templates/kruize_ui_nginx_pod.yaml deleted file mode 100644 index 1546756..0000000 --- a/charts/kruize/templates/kruize_ui_nginx_pod.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{{- $fullName := include "kruize.fullname" . -}} ---- -apiVersion: v1 -kind: Pod -metadata: - name: {{ $fullName }}-ui-nginx-pod - namespace: {{ .Release.Namespace }} - labels: - app: {{ $fullName }}-ui-nginx -spec: - containers: - - name: kruize-ui-nginx-container - image: "{{ .Values.kruizeUI.image.repository }}:{{ .Values.kruizeUI.image.tag }}" - imagePullPolicy: {{ .Values.kruizeUI.image.pullPolicy }} - env: - - name: KRUIZE_UI_ENV - value: "production" - volumeMounts: - - name: nginx-config-volume - mountPath: /etc/nginx/nginx.conf - subPath: nginx.conf - volumes: - - name: nginx-config-volume - configMap: - name: {{ $fullName }}-nginx-config diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md index 7ba9cd0..34bb8d7 100644 --- a/charts/kruize/tests/README.md +++ b/charts/kruize/tests/README.md @@ -188,6 +188,18 @@ When adding new templates or modifying existing ones: - Namespace propagation (using `release.namespace`) - Label and selector validation +## Updating Version Numbers in Tests + +Version numbers in test files are hardcoded because helm-unittest does not support dynamic value substitution in test assertions. + +when versions are updated (e.g., kruize from 0.9 to 0.10) update the values in the tests as well. + +**Verify all tests pass:** + ```bash + cd charts/kruize + helm unittest -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . + ``` + ## Troubleshooting ### Plugin Not Found @@ -207,9 +219,10 @@ helm unittest -v -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift- ### Debugging Specific Tests ```bash -helm unittest -f 'tests/with-default-values/kruize_db_deployment_test.yaml' -v charts/kruize -helm unittest -f 'tests/with-openshift-values/kruize_deployment_test.yaml' -v charts/kruize -helm unittest -f 'tests/with-minikube-values/kruize_deployment_minikube_test.yaml' -v charts/kruize +helm unittest -f 'tests/common-tests/kruize_db_deployment_test.yaml' charts/kruize +helm unittest -f 'tests/common-tests/kruize_ui_test.yaml' charts/kruize +helm unittest -f 'tests/openshift/kruize_deployment_test.yaml' charts/kruize +helm unittest -f 'tests/minikube/kruize_deployment_minikube_test.yaml' charts/kruize ``` ## Resources diff --git a/charts/kruize/tests/with-default-values/cronjobs_test.yaml b/charts/kruize/tests/with-default-values/cronjobs_test.yaml index ce3a3b6..8d654f2 100644 --- a/charts/kruize/tests/with-default-values/cronjobs_test.yaml +++ b/charts/kruize/tests/with-default-values/cronjobs_test.yaml @@ -28,7 +28,7 @@ tests: value: kruize-cron-create - equal: path: spec.jobTemplate.spec.template.spec.containers[0].image - value: "quay.io/kruize/autotune_operator:0.8.1" + value: "quay.io/kruize/autotune_operator:0.9" - equal: path: spec.jobTemplate.spec.template.spec.containers[0].imagePullPolicy value: Always @@ -59,7 +59,7 @@ tests: value: kruize-cron-delete - equal: path: spec.jobTemplate.spec.template.spec.containers[0].image - value: "quay.io/kruize/autotune_operator:0.8.1" + value: "quay.io/kruize/autotune_operator:0.9" - contains: path: spec.jobTemplate.spec.template.spec.containers[0].env content: diff --git a/charts/kruize/tests/with-default-values/kruize_service_test.yaml b/charts/kruize/tests/with-default-values/kruize_service_test.yaml index aebe3a7..8d57bc1 100644 --- a/charts/kruize/tests/with-default-values/kruize_service_test.yaml +++ b/charts/kruize/tests/with-default-values/kruize_service_test.yaml @@ -23,7 +23,7 @@ tests: helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/version: "0.9" app.kubernetes.io/managed-by: Helm - equal: path: metadata.annotations diff --git a/charts/kruize/tests/with-default-values/kruize_ui_test.yaml b/charts/kruize/tests/with-default-values/kruize_ui_test.yaml index 782d317..65312e0 100644 --- a/charts/kruize/tests/with-default-values/kruize_ui_test.yaml +++ b/charts/kruize/tests/with-default-values/kruize_ui_test.yaml @@ -1,71 +1,87 @@ suite: test kruize UI templates templates: - - kruize_ui_nginx_pod.yaml + - kruize_ui_nginx_depoyment.yaml - kruize_ui_nginx_service.yaml tests: - - it: should create a UI nginx Pod with the correct default settings - template: kruize_ui_nginx_pod.yaml + - it: should create a UI nginx Deployment with the correct default settings + template: kruize_ui_nginx_depoyment.yaml asserts: - hasDocuments: count: 1 - equal: path: kind - value: Pod + value: Deployment - equal: path: apiVersion - value: v1 + value: apps/v1 - equal: path: metadata.name - value: RELEASE-NAME-kruize-ui-nginx-pod + value: RELEASE-NAME-kruize-ui-nginx - equal: path: metadata.labels.app value: RELEASE-NAME-kruize-ui-nginx - equal: - path: spec.containers[0].name + path: spec.replicas + value: 1 + - equal: + path: spec.strategy.type + value: RollingUpdate + - equal: + path: spec.selector.matchLabels.app + value: RELEASE-NAME-kruize-ui-nginx + - equal: + path: spec.template.metadata.labels.app + value: RELEASE-NAME-kruize-ui-nginx + - equal: + path: spec.template.spec.containers[0].name value: kruize-ui-nginx-container - equal: - path: spec.containers[0].image - value: "quay.io/kruize/kruize-ui:0.0.8" + path: spec.template.spec.containers[0].image + value: "quay.io/kruize/kruize-ui:0.1.0" - equal: - path: spec.containers[0].imagePullPolicy + path: spec.template.spec.containers[0].imagePullPolicy value: Always - contains: - path: spec.containers[0].env + path: spec.template.spec.containers[0].env content: name: KRUIZE_UI_ENV value: "production" - equal: - path: spec.containers[0].volumeMounts[0].name + path: spec.template.spec.containers[0].volumeMounts[0].name value: nginx-config-volume - equal: - path: spec.containers[0].volumeMounts[0].mountPath + path: spec.template.spec.containers[0].volumeMounts[0].mountPath value: /etc/nginx/nginx.conf - equal: - path: spec.containers[0].volumeMounts[0].subPath + path: spec.template.spec.containers[0].volumeMounts[0].subPath value: nginx.conf - equal: - path: spec.volumes[0].name + path: spec.template.spec.volumes[0].name value: nginx-config-volume - equal: - path: spec.volumes[0].configMap.name + path: spec.template.spec.volumes[0].configMap.name value: RELEASE-NAME-kruize-nginx-config - - it: should create a UI nginx Pod with the correct settings overrides - template: kruize_ui_nginx_pod.yaml + - it: should create a UI nginx Deployment with the correct settings overrides + template: kruize_ui_nginx_depoyment.yaml set: - kruizeUI.image.tag: "0.1.0" + kruizeUI.image.tag: "0.2.0" kruizeUI.image.pullPolicy: IfNotPresent + kruizeUI.replicaCount: 3 asserts: - equal: - path: spec.containers[0].image - value: "quay.io/kruize/kruize-ui:0.1.0" + path: spec.replicas + value: 3 + - equal: + path: spec.template.spec.containers[0].image + value: "quay.io/kruize/kruize-ui:0.2.0" - equal: - path: spec.containers[0].imagePullPolicy + path: spec.template.spec.containers[0].imagePullPolicy value: IfNotPresent - - it: should create a UI nginx Pod in the release namespace - template: kruize_ui_nginx_pod.yaml + - it: should create a UI nginx Deployment in the release namespace + template: kruize_ui_nginx_depoyment.yaml release: namespace: custom-namespace asserts: diff --git a/charts/kruize/tests/with-default-values/network_policy_test.yaml b/charts/kruize/tests/with-default-values/network_policy_test.yaml index 813b79b..49d556d 100644 --- a/charts/kruize/tests/with-default-values/network_policy_test.yaml +++ b/charts/kruize/tests/with-default-values/network_policy_test.yaml @@ -31,7 +31,7 @@ tests: helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/version: "0.9" app.kubernetes.io/managed-by: Helm - equal: path: spec.podSelector.matchLabels diff --git a/charts/kruize/tests/with-default-values/service_monitor_test.yaml b/charts/kruize/tests/with-default-values/service_monitor_test.yaml index bf3eab9..e81a137 100644 --- a/charts/kruize/tests/with-default-values/service_monitor_test.yaml +++ b/charts/kruize/tests/with-default-values/service_monitor_test.yaml @@ -32,7 +32,7 @@ tests: helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/version: "0.9" app.kubernetes.io/managed-by: Helm - equal: path: spec.selector.matchLabels diff --git a/charts/kruize/tests/with-minikube-values/kruize_deployment_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/kruize_deployment_minikube_test.yaml index 4f211eb..a6df123 100644 --- a/charts/kruize/tests/with-minikube-values/kruize_deployment_minikube_test.yaml +++ b/charts/kruize/tests/with-minikube-values/kruize_deployment_minikube_test.yaml @@ -29,7 +29,7 @@ tests: value: RELEASE-NAME - equal: path: metadata.labels["app.kubernetes.io/version"] - value: "0.8.1" + value: "0.9" - equal: path: metadata.labels["app.kubernetes.io/managed-by"] value: Helm @@ -77,7 +77,7 @@ tests: path: spec.template.spec.containers[?(@.name=='kruize')] - equal: path: spec.template.spec.containers[?(@.name=='kruize')].image - value: "quay.io/kruize/autotune_operator:0.8.1" + value: "quay.io/kruize/autotune_operator:0.9" - equal: path: spec.template.spec.containers[?(@.name=='kruize')].imagePullPolicy value: "Always" diff --git a/charts/kruize/tests/with-minikube-values/network_policy_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/network_policy_minikube_test.yaml index 9933c3f..135ca7f 100644 --- a/charts/kruize/tests/with-minikube-values/network_policy_minikube_test.yaml +++ b/charts/kruize/tests/with-minikube-values/network_policy_minikube_test.yaml @@ -24,7 +24,7 @@ tests: helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/version: "0.9" app.kubernetes.io/managed-by: Helm - equal: path: spec.podSelector.matchLabels diff --git a/charts/kruize/tests/with-minikube-values/service_monitor_minikube_test.yaml b/charts/kruize/tests/with-minikube-values/service_monitor_minikube_test.yaml index c9df138..82ed204 100644 --- a/charts/kruize/tests/with-minikube-values/service_monitor_minikube_test.yaml +++ b/charts/kruize/tests/with-minikube-values/service_monitor_minikube_test.yaml @@ -25,7 +25,7 @@ tests: helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/version: "0.9" app.kubernetes.io/managed-by: Helm - equal: path: spec.selector.matchLabels diff --git a/charts/kruize/tests/with-openshift-values/kruize_deployment_test.yaml b/charts/kruize/tests/with-openshift-values/kruize_deployment_test.yaml index 08347e2..8960c37 100644 --- a/charts/kruize/tests/with-openshift-values/kruize_deployment_test.yaml +++ b/charts/kruize/tests/with-openshift-values/kruize_deployment_test.yaml @@ -26,7 +26,7 @@ tests: value: RELEASE-NAME - equal: path: metadata.labels["app.kubernetes.io/version"] - value: "0.8.1" + value: "0.9" - equal: path: metadata.labels["app.kubernetes.io/managed-by"] value: Helm @@ -71,7 +71,7 @@ tests: path: spec.template.spec.containers[?(@.name=='kruize')] - equal: path: spec.template.spec.containers[?(@.name=='kruize')].image - value: "quay.io/kruize/autotune_operator:0.8.1" + value: "quay.io/kruize/autotune_operator:0.9" - equal: path: spec.template.spec.containers[?(@.name=='kruize')].imagePullPolicy value: "Always" diff --git a/charts/kruize/tests/with-openshift-values/rbac_test.yaml b/charts/kruize/tests/with-openshift-values/rbac_test.yaml index 2de039d..be66eac 100644 --- a/charts/kruize/tests/with-openshift-values/rbac_test.yaml +++ b/charts/kruize/tests/with-openshift-values/rbac_test.yaml @@ -34,7 +34,7 @@ tests: helm.sh/chart: kruize-0.1.0 app.kubernetes.io/name: kruize app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/version: "0.8.1" + app.kubernetes.io/version: "0.9" app.kubernetes.io/managed-by: Helm - it: should use custom ServiceAccount name when specified diff --git a/charts/kruize/values.yaml b/charts/kruize/values.yaml index 2840a48..542968d 100644 --- a/charts/kruize/values.yaml +++ b/charts/kruize/values.yaml @@ -8,7 +8,7 @@ kruize: ## @param kruize.image.pullPolicy Image pull policy for the Kruize container image pullPolicy: Always ## @param kruize.image.tag Image tag for Kruize container - tag: "0.8.1" + tag: "0.9" ## @param kruize.replicaCount Replica count for the Kruize container replicaCount: 1 resources: @@ -151,7 +151,8 @@ kruizeUI: ## @param kruizeUI.image.pullPolicy Image pull policy for the Kruize UI container image pullPolicy: Always ## @param kruizeUI.image.tag Image tag for Kruize UI container - tag: "0.0.8" + tag: "0.1.0" + replicaCount: 1 service: ## @param kruizeUI.service.type Kruize UI service type type: NodePort From e0460f640a4f4870d09f9ad78d25a7798f0f7857 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 20 Apr 2026 18:10:30 +0530 Subject: [PATCH 25/29] Fixed the typo in the file name Signed-off-by: Chandrakala Subramanyam --- ...ze_ui_nginx_depoyment.yaml => kruize_ui_nginx_deployment.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename charts/kruize/templates/{kruize_ui_nginx_depoyment.yaml => kruize_ui_nginx_deployment.yaml} (100%) diff --git a/charts/kruize/templates/kruize_ui_nginx_depoyment.yaml b/charts/kruize/templates/kruize_ui_nginx_deployment.yaml similarity index 100% rename from charts/kruize/templates/kruize_ui_nginx_depoyment.yaml rename to charts/kruize/templates/kruize_ui_nginx_deployment.yaml From a447ed01b46d1cd2acdf399253dd546b8e754211 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 20 Apr 2026 18:17:19 +0530 Subject: [PATCH 26/29] Fix typo in tests & update the test dir in readme Signed-off-by: Chandrakala Subramanyam --- charts/kruize/tests/README.md | 10 +++++----- .../tests/with-default-values/kruize_ui_test.yaml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md index 34bb8d7..d13451e 100644 --- a/charts/kruize/tests/README.md +++ b/charts/kruize/tests/README.md @@ -197,7 +197,7 @@ when versions are updated (e.g., kruize from 0.9 to 0.10) update the values in t **Verify all tests pass:** ```bash cd charts/kruize - helm unittest -f 'tests/common-tests/*.yaml' -f 'tests/openshift/*.yaml' -f 'tests/minikube/*.yaml' . + helm unittest -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . ``` ## Troubleshooting @@ -219,10 +219,10 @@ helm unittest -v -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift- ### Debugging Specific Tests ```bash -helm unittest -f 'tests/common-tests/kruize_db_deployment_test.yaml' charts/kruize -helm unittest -f 'tests/common-tests/kruize_ui_test.yaml' charts/kruize -helm unittest -f 'tests/openshift/kruize_deployment_test.yaml' charts/kruize -helm unittest -f 'tests/minikube/kruize_deployment_minikube_test.yaml' charts/kruize +helm unittest -f 'tests/with-default-values/kruize_db_deployment_test.yaml' charts/kruize +helm unittest -f 'tests/with-default-values/kruize_ui_test.yaml' charts/kruize +helm unittest -f 'tests/with-openshift-values/kruize_deployment_test.yaml' charts/kruize +helm unittest -f 'tests/with-minikube-values/kruize_deployment_minikube_test.yaml' charts/kruize ``` ## Resources diff --git a/charts/kruize/tests/with-default-values/kruize_ui_test.yaml b/charts/kruize/tests/with-default-values/kruize_ui_test.yaml index 65312e0..e896034 100644 --- a/charts/kruize/tests/with-default-values/kruize_ui_test.yaml +++ b/charts/kruize/tests/with-default-values/kruize_ui_test.yaml @@ -1,11 +1,11 @@ suite: test kruize UI templates templates: - - kruize_ui_nginx_depoyment.yaml + - kruize_ui_nginx_deployment.yaml - kruize_ui_nginx_service.yaml tests: - it: should create a UI nginx Deployment with the correct default settings - template: kruize_ui_nginx_depoyment.yaml + template: kruize_ui_nginx_deployment.yaml asserts: - hasDocuments: count: 1 @@ -64,7 +64,7 @@ tests: value: RELEASE-NAME-kruize-nginx-config - it: should create a UI nginx Deployment with the correct settings overrides - template: kruize_ui_nginx_depoyment.yaml + template: kruize_ui_nginx_deployment.yaml set: kruizeUI.image.tag: "0.2.0" kruizeUI.image.pullPolicy: IfNotPresent @@ -81,7 +81,7 @@ tests: value: IfNotPresent - it: should create a UI nginx Deployment in the release namespace - template: kruize_ui_nginx_depoyment.yaml + template: kruize_ui_nginx_deployment.yaml release: namespace: custom-namespace asserts: From 319576d2b96252fba554082298259c82f03ae12a Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Thu, 23 Apr 2026 14:27:44 +0530 Subject: [PATCH 27/29] Updated readme to indicate when -v can be used Signed-off-by: Chandrakala Subramanyam --- charts/kruize/tests/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md index d13451e..2bfe487 100644 --- a/charts/kruize/tests/README.md +++ b/charts/kruize/tests/README.md @@ -46,7 +46,10 @@ helm unittest -f 'tests/with-minikube-values/*.yaml' . ### Run tests with verbose output ```bash cd charts/kruize -helm unittest -v -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . +# Note: -v flag doesn't work with glob patterns, run specific test files instead +helm unittest -v -f tests/with-default-values/kruize_ui_test.yaml . +# Or run all tests without -v flag +helm unittest -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . ``` ### Generate JUnit Test Report From 63d0de673722b89c020dbbcb4b278a637ee3aeb8 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Mon, 27 Apr 2026 11:07:10 +0530 Subject: [PATCH 28/29] Fixed the verbose option to run the tests Signed-off-by: Chandrakala Subramanyam --- charts/kruize/tests/README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/charts/kruize/tests/README.md b/charts/kruize/tests/README.md index 2bfe487..372ac83 100644 --- a/charts/kruize/tests/README.md +++ b/charts/kruize/tests/README.md @@ -46,10 +46,7 @@ helm unittest -f 'tests/with-minikube-values/*.yaml' . ### Run tests with verbose output ```bash cd charts/kruize -# Note: -v flag doesn't work with glob patterns, run specific test files instead -helm unittest -v -f tests/with-default-values/kruize_ui_test.yaml . -# Or run all tests without -v flag -helm unittest -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' . +helm unittest -d -f tests/with-default-values/kruize_ui_test.yaml . ``` ### Generate JUnit Test Report @@ -216,7 +213,7 @@ helm plugin install https://github.com/helm-unittest/helm-unittest Run with verbose output to see detailed failure information: ```bash -helm unittest -v -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' charts/kruize +helm unittest -d -f 'tests/with-default-values/*.yaml' -f 'tests/with-openshift-values/*.yaml' -f 'tests/with-minikube-values/*.yaml' charts/kruize ``` ### Debugging Specific Tests From 730a3952b8b1138d613a20396590b8203ee06ed7 Mon Sep 17 00:00:00 2001 From: Chandrakala Subramanyam Date: Tue, 12 May 2026 13:58:50 +0530 Subject: [PATCH 29/29] Add kruize icon image Signed-off-by: Chandrakala Subramanyam --- docs/images/kruize-icon.png | Bin 0 -> 18084 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/images/kruize-icon.png diff --git a/docs/images/kruize-icon.png b/docs/images/kruize-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..318781f12a319918f3d948a281c202cd11cae710 GIT binary patch literal 18084 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 literal 0 HcmV?d00001