diff --git a/.github/workflows/helm-test.yml b/.github/workflows/helm-test.yml index e8e1c46..53d4916 100644 --- a/.github/workflows/helm-test.yml +++ b/.github/workflows/helm-test.yml @@ -39,12 +39,9 @@ jobs: uses: tj-actions/changed-files@v35 with: files: | - templates/** - Chart.yaml - values.yaml - helm-test.yml + charts/** - # change detection in ct seems to not detect some changes. Using simple file modification for now. + # change detection in ct seems to not detect some changes. Using simple file modification for now. # - name: Run chart-testing (list-changed) # id: list-changed # run: | @@ -56,7 +53,7 @@ jobs: # run: ct lint --chart-dirs . --target-branch ${{ github.event.repository.default_branch }} - name: Run chart-testing (lint) - run: ct lint --chart-dirs . --charts . + run: ct lint --all - name: Create kind cluster uses: helm/kind-action@v1.4.0 @@ -67,6 +64,5 @@ jobs: # run: ct install --chart-dirs . --target-branch ${{ github.event.repository.default_branch }} --upgrade - name: Run chart-testing (install) - run: ct install --chart-dirs . --charts . - - + run: ct install --all + if: steps.files-changed.outputs.any_modified == 'true' diff --git a/.github/workflows/publish.yml.off b/.github/workflows/publish.yml similarity index 92% rename from .github/workflows/publish.yml.off rename to .github/workflows/publish.yml index e18694f..cbdf72f 100644 --- a/.github/workflows/publish.yml.off +++ b/.github/workflows/publish.yml @@ -1,12 +1,9 @@ -# heavily borrowed from https://github.com/dirien/minecraft-prometheus-exporter/blob/main/.github/workflows/helm-publish.yaml --- name: chart-publish on: push: branches: - main - paths: - - 'charts/**' env: HELM_DOCS_VERSION: '1.11.0' @@ -50,7 +47,7 @@ jobs: - name: Run chart-releaser uses: helm/chart-releaser-action@be16258da8010256c6e82849661221415f031968 # v1.5.0 with: - charts_dir: ./ + charts_dir: charts config: './.github/configs/cr.yaml' env: CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' diff --git a/README.md b/README.md index 2354818..2048e7d 100644 --- a/README.md +++ b/README.md @@ -11,62 +11,18 @@ Opencost and Opencost UI | ---- | ------ | --- | | mattray | | | -## Installing the Chart +## Usage -To install the chart with the release name `my-release`: +[Helm](https://helm.sh/) must be installed to use the charts. Please refer to Helm's [documentation](https://helm.sh/docs/) to get started. + +Once Helm is set up properly, add the repo as follows: ```console -$ helm repo add -$ helm install opencost /opencost +helm repo add opencost https://opencost.github.io/opencost-helm-chart ``` -## Values - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| annotations | object | `{}` | | -| opencost.exporter.defaultClusterId | string | `"default-cluster"` | | -| opencost.exporter.extraEnv | object | `{}` | | -| opencost.exporter.image.registry | string | `"quay.io"` | | -| opencost.exporter.image.repository | string | `"kubecost1/kubecost-cost-model"` | | -| opencost.exporter.image.tag | string | `"latest"` | | -| opencost.exporter.resources.limits.cpu | string | `"999m"` | | -| opencost.exporter.resources.limits.memory | string | `"1G"` | | -| opencost.exporter.resources.requests.cpu | string | `"10m"` | | -| opencost.exporter.resources.requests.memory | string | `"55M"` | | -| opencost.metrics.serviceMonitor.additionalLabels | object | `{}` | | -| opencost.metrics.serviceMonitor.enabled | bool | `false` | | -| opencost.metrics.serviceMonitor.metricRelabelings | list | `[]` | | -| opencost.metrics.serviceMonitor.namespace | string | `""` | | -| opencost.metrics.serviceMonitor.namespaceSelector | object | `{}` | | -| opencost.metrics.serviceMonitor.relabelings | list | `[]` | | -| opencost.metrics.serviceMonitor.scrapeInterval | string | `"30s"` | | -| opencost.metrics.serviceMonitor.targetLabels | list | `[]` | | -| opencost.prometheus.external.enabled | bool | `false` | | -| opencost.prometheus.external.url | string | `"https://mimir-dev-push.infra.alto.com/prometheus"` | | -| opencost.prometheus.internal.enabled | bool | `true` | | -| opencost.prometheus.internal.namespaceName | string | `"opencost"` | | -| opencost.prometheus.internal.port | int | `9090` | | -| opencost.prometheus.internal.serviceName | string | `"my-prometheus"` | | -| opencost.tolerations | list | `[]` | | -| opencost.ui.enabled | bool | `true` | | -| opencost.ui.image.registry | string | `"quay.io"` | | -| opencost.ui.image.repository | string | `"kubecost1/opencost-ui"` | | -| opencost.ui.image.tag | string | `"latest"` | | -| opencost.ui.resources.limits.cpu | string | `"999m"` | | -| opencost.ui.resources.limits.memory | string | `"1G"` | | -| opencost.ui.resources.requests.cpu | string | `"10m"` | | -| opencost.ui.resources.requests.memory | string | `"55M"` | | -| service.annotations | object | `{}` | | -| service.labels | object | `{}` | | -| service.type | string | `"ClusterIP"` | | -| serviceAccount.annotations | object | `{}` | | -| serviceAccount.automountServiceAccountToken | bool | `true` | | -| serviceAccount.create | bool | `true` | | - -## Docs Generated by [helm-docs](https://github.com/norwoodj/helm-docs) -`helm-docs -t .github/configs/README.md.gotmpl` +You can then run `helm search repo opencost` to see the charts. ## OpenCost Links * https://github.com/opencost/opencost/tree/develop/kubernetes -* https://www.opencost.io/docs/ \ No newline at end of file +* https://www.opencost.io/docs/ diff --git a/Chart.yaml b/charts/opencost/Chart.yaml similarity index 100% rename from Chart.yaml rename to charts/opencost/Chart.yaml diff --git a/charts/opencost/README.md b/charts/opencost/README.md new file mode 100644 index 0000000..d55d172 --- /dev/null +++ b/charts/opencost/README.md @@ -0,0 +1,68 @@ +# opencost + +Opencost and Opencost UI + +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 1.9.8](https://img.shields.io/badge/AppVersion-1.9.8-informational?style=flat-square) + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| mattray | | | + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install opencost opencost/opencost +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| annotations | object | `{}` | | +| opencost.exporter.defaultClusterId | string | `"default-cluster"` | | +| opencost.exporter.extraEnv | object | `{}` | | +| opencost.exporter.image.registry | string | `"quay.io"` | | +| opencost.exporter.image.repository | string | `"kubecost1/kubecost-cost-model"` | | +| opencost.exporter.image.tag | string | `"latest"` | | +| opencost.exporter.resources.limits.cpu | string | `"999m"` | | +| opencost.exporter.resources.limits.memory | string | `"1G"` | | +| opencost.exporter.resources.requests.cpu | string | `"10m"` | | +| opencost.exporter.resources.requests.memory | string | `"55M"` | | +| opencost.metrics.serviceMonitor.additionalLabels | object | `{}` | | +| opencost.metrics.serviceMonitor.enabled | bool | `false` | | +| opencost.metrics.serviceMonitor.metricRelabelings | list | `[]` | | +| opencost.metrics.serviceMonitor.namespace | string | `""` | | +| opencost.metrics.serviceMonitor.namespaceSelector | object | `{}` | | +| opencost.metrics.serviceMonitor.relabelings | list | `[]` | | +| opencost.metrics.serviceMonitor.scrapeInterval | string | `"30s"` | | +| opencost.metrics.serviceMonitor.targetLabels | list | `[]` | | +| opencost.prometheus.external.enabled | bool | `false` | | +| opencost.prometheus.external.url | string | `"https://mimir-dev-push.infra.alto.com/prometheus"` | | +| opencost.prometheus.internal.enabled | bool | `true` | | +| opencost.prometheus.internal.namespaceName | string | `"opencost"` | | +| opencost.prometheus.internal.port | int | `9090` | | +| opencost.prometheus.internal.serviceName | string | `"my-prometheus"` | | +| opencost.tolerations | list | `[]` | | +| opencost.ui.enabled | bool | `true` | | +| opencost.ui.image.registry | string | `"quay.io"` | | +| opencost.ui.image.repository | string | `"kubecost1/opencost-ui"` | | +| opencost.ui.image.tag | string | `"latest"` | | +| opencost.ui.resources.limits.cpu | string | `"999m"` | | +| opencost.ui.resources.limits.memory | string | `"1G"` | | +| opencost.ui.resources.requests.cpu | string | `"10m"` | | +| opencost.ui.resources.requests.memory | string | `"55M"` | | +| service.annotations | object | `{}` | | +| service.labels | object | `{}` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.automountServiceAccountToken | bool | `true` | | +| serviceAccount.create | bool | `true` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +## Docs Generated by [helm-docs](https://github.com/norwoodj/helm-docs) +`helm-docs -t .README.md.gotmpl` diff --git a/.github/configs/README.md.gotmpl b/charts/opencost/README.md.gotmpl similarity index 66% rename from .github/configs/README.md.gotmpl rename to charts/opencost/README.md.gotmpl index db2ba5a..912b8b4 100644 --- a/.github/configs/README.md.gotmpl +++ b/charts/opencost/README.md.gotmpl @@ -1,5 +1,5 @@ - {{ template "chart.header" . }} + {{ template "chart.description" . }} {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} @@ -11,8 +11,7 @@ To install the chart with the release name `my-release`: ```console -$ helm repo add -$ helm install opencost /{{ template "chart.name" . }} +$ helm install opencost opencost/{{ template "chart.name" . }} ``` {{ template "chart.requirementsSection" . }} @@ -21,8 +20,4 @@ $ helm install opencost /{{ template "chart.name" . }} {{ template "helm-docs.versionFooter" . }} ## Docs Generated by [helm-docs](https://github.com/norwoodj/helm-docs) -`helm-docs -t .github/configs/README.md.gotmpl` - -## OpenCost Links -* https://github.com/opencost/opencost/tree/develop/kubernetes -* https://www.opencost.io/docs/ \ No newline at end of file +`helm-docs -t .README.md.gotmpl` diff --git a/templates/_helpers.tpl b/charts/opencost/templates/_helpers.tpl similarity index 100% rename from templates/_helpers.tpl rename to charts/opencost/templates/_helpers.tpl diff --git a/templates/clusterrole.yaml b/charts/opencost/templates/clusterrole.yaml similarity index 100% rename from templates/clusterrole.yaml rename to charts/opencost/templates/clusterrole.yaml diff --git a/templates/clusterrolebinding.yaml b/charts/opencost/templates/clusterrolebinding.yaml similarity index 100% rename from templates/clusterrolebinding.yaml rename to charts/opencost/templates/clusterrolebinding.yaml diff --git a/templates/deployment.yaml b/charts/opencost/templates/deployment.yaml similarity index 100% rename from templates/deployment.yaml rename to charts/opencost/templates/deployment.yaml diff --git a/templates/secret.yaml b/charts/opencost/templates/secret.yaml similarity index 100% rename from templates/secret.yaml rename to charts/opencost/templates/secret.yaml diff --git a/templates/service.yaml b/charts/opencost/templates/service.yaml similarity index 100% rename from templates/service.yaml rename to charts/opencost/templates/service.yaml diff --git a/templates/serviceaccount.yaml b/charts/opencost/templates/serviceaccount.yaml similarity index 100% rename from templates/serviceaccount.yaml rename to charts/opencost/templates/serviceaccount.yaml diff --git a/templates/servicemonitor.yaml b/charts/opencost/templates/servicemonitor.yaml similarity index 100% rename from templates/servicemonitor.yaml rename to charts/opencost/templates/servicemonitor.yaml diff --git a/values.yaml b/charts/opencost/values.yaml similarity index 100% rename from values.yaml rename to charts/opencost/values.yaml