Skip to content

Commit

Permalink
feat: add agent mode flag in helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusfm committed Jul 24, 2023
1 parent ba7fb30 commit 37227d5
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/zora/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: zora
description: Zora scans multiple Kubernetes clusters and reports potential issues.
icon: https://zora-docs.undistro.io/assets/logo.png
type: application
version: 0.6.2
appVersion: "v0.6.2"
version: 0.7.0-rc1
appVersion: "v0.7.0-rc1"
sources:
- https://github.com/undistro/zora
7 changes: 5 additions & 2 deletions charts/zora/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Zora Helm Chart

![Version: 0.6.2](https://img.shields.io/badge/Version-0.6.2-informational?style=flat-square&color=3CA9DD) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square&color=3CA9DD) ![AppVersion: v0.6.2](https://img.shields.io/badge/AppVersion-v0.6.2-informational?style=flat-square&color=3CA9DD)
![Version: 0.7.0-rc1](https://img.shields.io/badge/Version-0.7.0--rc1-informational?style=flat-square&color=3CA9DD) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square&color=3CA9DD) ![AppVersion: v0.7.0-rc1](https://img.shields.io/badge/AppVersion-v0.7.0--rc1-informational?style=flat-square&color=3CA9DD)

Zora scans multiple Kubernetes clusters and reports potential issues.

Expand All @@ -12,7 +12,7 @@ To install the chart with the release name `zora`:
helm repo add undistro https://charts.undistro.io --force-update
helm upgrade --install zora undistro/zora \
-n zora-system \
--version 0.6.2 \
--version 0.7.0-rc1 \
--create-namespace --wait
```

Expand Down Expand Up @@ -54,6 +54,9 @@ The following table lists the configurable parameters of the Zora chart and thei
|-----|------|---------|-------------|
| nameOverride | string | `""` | String to partially override fullname template with a string (will prepend the release name) |
| fullnameOverride | string | `""` | String to fully override fullname template with a string |
| agent | bool | `false` | Specifies whether Zora should be installed in `agent` mode |
| clusterName | string | `""` | Cluster name |
| scanSchedule | string | Cron expression for every hour at the current minute + 5 minutes | Cluster scan schedule in Cron format |
| saas.workspaceID | string | `""` | Your SaaS workspace ID |
| saas.server | string | `"https://zora-dashboard.undistro.io"` | SaaS server URL |
| saas.hooks.image.repository | string | `"curlimages/curl"` | SaaS hooks image repository |
Expand Down
8 changes: 8 additions & 0 deletions charts/zora/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,11 @@ Create the name of the service account to use in Operator
{{- printf "{\"auths\":{\"%s\":{\"auth\":\"%s\"}}}" .registry (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end }}

{{- define "clusterName" }}
{{- regexReplaceAll "\\W+" (required "clusterName is required" .Values.clusterName) "-" }}
{{- end }}

{{- define "scanSchedule"}}
{{- default (printf "%d * * * *" (add 5 (now | date "04"))) .Values.scanSchedule }}
{{- end }}
34 changes: 34 additions & 0 deletions charts/zora/templates/agent/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2023 Undistro Authors
#
# 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.

{{ if .Values.agent }}
apiVersion: zora.undistro.io/v1alpha1
kind: Cluster
metadata:
labels:
{{- include "zora.labels" . | nindent 4 }}
name: {{ include "clusterName" . }}
spec: {}
---
apiVersion: zora.undistro.io/v1alpha1
kind: ClusterScan
metadata:
labels:
{{- include "zora.labels" . | nindent 4 }}
name: {{ include "clusterName" . }}
spec:
clusterRef:
name: {{ include "clusterName" . }}
schedule: {{ include "scanSchedule" . | quote }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/zora/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ nameOverride: ""
# -- String to fully override fullname template with a string
fullnameOverride: ""

# -- Specifies whether Zora should be installed in `agent` mode
agent: false

# -- Cluster name
clusterName: ""

# -- Cluster scan schedule in Cron format
# @default -- Cron expression for every hour at the current minute + 5 minutes
scanSchedule: ""

saas:
# -- Your SaaS workspace ID
workspaceID: ""
Expand Down

0 comments on commit 37227d5

Please sign in to comment.