diff --git a/charts/k8s-reporter/Chart.yaml b/charts/k8s-reporter/Chart.yaml index 65339772c..e9781491d 100644 --- a/charts/k8s-reporter/Chart.yaml +++ b/charts/k8s-reporter/Chart.yaml @@ -15,9 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.5.0 +version: 2.6.0 # This is the version number of the (CLI) application being deployed. This version number should be # incremented each time you make changes to the application. They should reflect the version the # application is using. It is recommended to use it with quotes. -appVersion: "v2.32.0" +appVersion: "v2.34.0" diff --git a/charts/k8s-reporter/README.md b/charts/k8s-reporter/README.md index 04612cde0..478f2ed15 100644 --- a/charts/k8s-reporter/README.md +++ b/charts/k8s-reporter/README.md @@ -224,9 +224,12 @@ cronSchedule: "*/15 * * * *" | podAnnotations | object | `{}` | annotations to add to the CronJob object itself. For pod-level annotations (added to each reporter pod), use `podTemplateAnnotations` instead. | | podLabels | object | `{}` | custom labels to add to pods | | podTemplateAnnotations | object | `{}` | annotations to add to the reporter pod template (applied to each Job pod that the CronJob creates) | +| reporterConfig.autoEnvironment | bool | `false` | create each Kosli environment (type K8S) if it does not already exist, before reporting the snapshot | | reporterConfig.dryRun | bool | `false` | whether the dry run mode is enabled or not. In dry run mode, the reporter logs the reports to stdout and does not send them to kosli. | +| reporterConfig.environmentDescription | string | `""` | description applied to every environment auto-created in this run. Only used when `autoEnvironment` is true; existing environments are never modified. Note: a single value is shared by all environments created during the run. | | reporterConfig.environments | list | `[]` | List of Kosli environments to report to. Each entry has required 'name' and optional namespace selectors. Use one entry to report a single environment; use multiple entries to report to multiple environments with different selectors. Per entry: name (required), namespaces, namespacesRegex, excludeNamespaces, excludeNamespacesRegex (optional). Leave namespace fields unset for an entry to report the entire cluster to that environment. | | reporterConfig.httpProxy | string | `""` | the http proxy url | +| reporterConfig.includeScaling | string | `nil` (server default) | whether to record scaling (replica count) changes for every environment auto-created in this run. Leave unset to use the Kosli server default; set to `true` to pass `--include-scaling` or `false` to pass `--exclude-scaling`. Only used when `autoEnvironment` is true; existing environments are never modified. | | reporterConfig.kosliOrg | string | `""` | the name of the Kosli org | | reporterConfig.securityContext | object | `{"allowPrivilegeEscalation":false,"runAsNonRoot":true,"runAsUser":1000}` | the security context for the reporter cronjob. Set to null or {} to disable security context entirely (not recommended). For OpenShift with SCC, explicitly set runAsUser to null to let OpenShift assign the UID from the allowed range. Simply omitting runAsUser from your values override will not work because Helm deep-merges with these defaults. Example OpenShift override: securityContext: allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: null | | reporterConfig.securityContext.allowPrivilegeEscalation | bool | `false` | whether to allow privilege escalation | diff --git a/charts/k8s-reporter/templates/cronjob.yaml b/charts/k8s-reporter/templates/cronjob.yaml index 71791821e..db7bb02a6 100644 --- a/charts/k8s-reporter/templates/cronjob.yaml +++ b/charts/k8s-reporter/templates/cronjob.yaml @@ -110,14 +110,27 @@ spec: - k8s - --config-file - /config/config.yaml - {{ if .Values.reporterConfig.dryRun }} + {{- if .Values.reporterConfig.autoEnvironment }} + - --auto-environment + {{- if .Values.reporterConfig.environmentDescription }} + - --environment-description + - {{ .Values.reporterConfig.environmentDescription | quote }} + {{- end }} + {{- if kindIs "bool" .Values.reporterConfig.includeScaling }} + {{- if .Values.reporterConfig.includeScaling }} + - --include-scaling + {{- else }} + - --exclude-scaling + {{- end }} + {{- end }} + {{- end }} + {{- if .Values.reporterConfig.dryRun }} - --dry-run - {{ end }} - {{ if .Values.reporterConfig.httpProxy }} + {{- end }} + {{- if .Values.reporterConfig.httpProxy }} - --http-proxy - {{ .Values.reporterConfig.httpProxy }} - {{ end }} - + {{- end }} resources: {{ toYaml .Values.resources | indent 14 }} restartPolicy: Never diff --git a/charts/k8s-reporter/values.yaml b/charts/k8s-reporter/values.yaml index 47362c5c8..faf304f8b 100644 --- a/charts/k8s-reporter/values.yaml +++ b/charts/k8s-reporter/values.yaml @@ -65,6 +65,13 @@ reporterConfig: # namespacesRegex: ["^staging-.*"] # - name: infra-env # excludeNamespaces: [prod-ns1, prod-ns2, default] + # -- create each Kosli environment (type K8S) if it does not already exist, before reporting the snapshot + autoEnvironment: false + # -- description applied to every environment auto-created in this run. Only used when `autoEnvironment` is true; existing environments are never modified. Note: a single value is shared by all environments created during the run. + environmentDescription: "" + # -- whether to record scaling (replica count) changes for every environment auto-created in this run. Leave unset to use the Kosli server default; set to `true` to pass `--include-scaling` or `false` to pass `--exclude-scaling`. Only used when `autoEnvironment` is true; existing environments are never modified. + # @default -- `nil` (server default) + includeScaling: null # -- whether the dry run mode is enabled or not. In dry run mode, the reporter logs the reports to stdout and does not send them to kosli. dryRun: false # -- the http proxy url