diff --git a/.github/ct.yaml b/.github/ct.yaml index dc4a4578..8bb9f42e 100644 --- a/.github/ct.yaml +++ b/.github/ct.yaml @@ -14,14 +14,14 @@ # See https://github.com/helm/chart-testing#configuration remote: origin -target-branch: main +target-branch: master chart-dirs: - charts chart-repos: - stable=https://charts.helm.sh/stable - # - prometheus-community=https://prometheus-community.github.io/helm-charts - # - grafana=https://grafana.github.io/helm-charts + - prometheus-community=https://prometheus-community.github.io/helm-charts + - banzaicloud=https://kubernetes-charts.banzaicloud.com helm-extra-args: --timeout 600s -excluded-charts: +# excluded-charts: # If not running on GCE, will error: "Failed to get GCE config" - # - xxxxxx \ No newline at end of file + # - xxxxxx diff --git a/.github/templates/index.hbs b/.github/templates/index.hbs new file mode 100644 index 00000000..376e6e37 --- /dev/null +++ b/.github/templates/index.hbs @@ -0,0 +1,11 @@ +# Portefaix Hub - Helm charts repository + +Welcome to the Portefaix Hub. + +|Name|version|description|Type|appVersion|created| +|:--|:-:|:--|:--|:--:|:--| +{{#each entries}} +{{#each .}} +{{this.name}}|{{this.version}}|{{this.description}}|{{this.type}}|{{this.appVersion}}|{{this.created}} +{{/each}} +{{/each}} \ No newline at end of file diff --git a/.github/workflows/chart-test.yml b/.github/workflows/chart-test.yml new file mode 100644 index 00000000..ae95150d --- /dev/null +++ b/.github/workflows/chart-test.yml @@ -0,0 +1,84 @@ +# Copyright (C) 2020 Nicolas Lamirault + +# 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. + +name: Lint and Test Charts + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# jobs: +# lint-test: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v2 + +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.4.0 + +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 + +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.0.1 + +# - name: Run chart-testing (lint) +# id: lint +# run: ct lint --config .github/ct.yaml +# if: steps.list-changed.outputs.changed == 'true' + +# - name: Create kind cluster +# uses: helm/kind-action@v1.1.0 +# if: steps.list-changed.outputs.changed == 'true' + +# - name: Run chart-testing (install) +# run: ct install --config .github/ct.yaml +# if: steps.list-changed.outputs.changed == 'true' + + + +jobs: + # Reference https://github.com/marketplace/actions/helm-chart-testing + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Fetch history + run: git fetch --prune --unshallow + + - name: Run chart-testing (lint) + id: lint + uses: helm/chart-testing-action@v1.1.0 + with: + command: lint + config: .github/ct.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.0.0 + # Only build a kind cluster if there are chart changes to test. + if: steps.lint.outputs.changed == 'true' + + # - name: Run chart-testing (install) + # uses: helm/chart-testing-action@v1.1.0 + # with: + # command: install + # config: .github/ct.yaml diff --git a/.github/workflows/github-pages.yml b/.github/workflows/chart-web.yml similarity index 56% rename from .github/workflows/github-pages.yml rename to .github/workflows/chart-web.yml index 1ec4f27c..cda1ad17 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/chart-web.yml @@ -12,21 +12,35 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: GitHub Pages +name: Chart website + on: push: branches: - - master + - gh-pages jobs: - build: - name: Deploy docs + update-ui: runs-on: ubuntu-latest steps: - - name: Checkout master - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + + - run: npx js-yaml index.yaml | npx hbs-cli .github/templates/index.hbs -i - -e md - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@master + - name: Commit changes + uses: EndBug/add-and-commit@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/charts-test.yml b/.github/workflows/charts-test.yml deleted file mode 100644 index f0bfe9e5..00000000 --- a/.github/workflows/charts-test.yml +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (C) 2020 Nicolas Lamirault - -# 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. - -name: Lint and Test Charts - -on: pull_request - -jobs: - lint-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.4.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.0.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --config .github/ct.yaml) - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - fi - - - name: Run chart-testing (lint) - id: lint - run: ct lint --config .github/ct.yaml - if: steps.list-changed.outputs.changed == 'true' - - - name: Create kind cluster - uses: helm/kind-action@v1.1.0 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install --config .github/ct.yaml - if: steps.list-changed.outputs.changed == 'true' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9c83317b..ed25ef87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,16 @@ -# Terraform -**/.terraform -.tfstate.* +# Created by https://www.toptal.com/developers/gitignore/api/helm,vscode +# Edit at https://www.toptal.com/developers/gitignore?templates=helm,vscode -# Python -.venv -__pycache__ +### Helm ### +# Chart dependencies +**/charts/*.tgz + +### vscode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# End of https://www.toptal.com/developers/gitignore/api/helm,vscode \ No newline at end of file diff --git a/Makefile b/Makefile index 7934a6a6..ce945ee5 100644 --- a/Makefile +++ b/Makefile @@ -38,3 +38,5 @@ init: # ==================================== ##@ Helm + + diff --git a/charts/thanos-mixin/Chart.yaml b/charts/thanos-mixin/Chart.yaml index 4d172f2c..e0c66877 100644 --- a/charts/thanos-mixin/Chart.yaml +++ b/charts/thanos-mixin/Chart.yaml @@ -1,29 +1,52 @@ +# Copyright (C) 2020 Nicolas Lamirault + +# 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. + apiVersion: v2 name: thanos-mixin description: A Helm chart for Thanos Mixin -home: https://thanos.io/ +home: https://github.com/nlamirault/portefaix-hub icon: https://raw.githubusercontent.com/thanos-io/thanos/master/docs/img/Thanos-logo_fullmedium.png sources: - - https://github.com/thanos-io/thanos + - https://github.com/nlamirault/portefaix-hub/tree/master/charts/thanos-mixin type: application keywords: - thanos - monitoring-mixin + - portefaix # 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: 0.2.0 +version: 0.3.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. appVersion: 0.17.1 +dependencies: + - name: kube-prometheus-stack + version: 12.3.0 + repository: https://prometheus-community.github.io/helm-charts + - name: thanos + version: 0.3.30 + repository: https://kubernetes-charts.banzaicloud.com + maintainers: - name: nlamirault email: nicolas.lamirault@gmail.com - + # https://artifacthub.io/docs/topics/repositories/ annotations: artifacthub.io/changes: | diff --git a/charts/thanos-mixin/ci/test-values.yaml b/charts/thanos-mixin/ci/test-values.yaml new file mode 100644 index 00000000..cc0c4e31 --- /dev/null +++ b/charts/thanos-mixin/ci/test-values.yaml @@ -0,0 +1,8 @@ +# Values for CI +# + +additionalLabels: + test: github + +additionalAnnotations: + made-by: portefaix \ No newline at end of file diff --git a/charts/thanos-mixin/templates/NOTES.txt b/charts/thanos-mixin/templates/NOTES.txt index 1cded55a..49499b74 100644 --- a/charts/thanos-mixin/templates/NOTES.txt +++ b/charts/thanos-mixin/templates/NOTES.txt @@ -1,4 +1,4 @@ {{ $.Chart.Name }} has been installed. Check its status by running: - kubectl --namespace {{ template "thanos-mixin.namespace" . }} get prometheusrules -l "release={{ $.Release.Name }}" + kubectl --namespace {{ template "thanos-mixin.namespace" . }} get prometheusrules -Visit https://github.com/nlamirault/portefaix/charts/thanos-mixin. +Visit https://github.com/nlamirault/portefaix-hub/charts/thanos-mixin. diff --git a/charts/thanos-mixin/values.schema.json b/charts/thanos-mixin/values.schema.json index 97994ac8..cd44ce5a 100644 --- a/charts/thanos-mixin/values.schema.json +++ b/charts/thanos-mixin/values.schema.json @@ -9,13 +9,13 @@ }, "additionalLabels": { "title": "Additional labels to add to the Prometheus rules", - "type": "array", - "default": [] + "type": "object", + "default": {} }, "additionalAnnotations": { "title": "Additional annotations to add to the Prometheus rules", - "type": "array", - "default": [] + "type": "object", + "default": {} } }, "required": [] diff --git a/charts/thanos-mixin/values.yaml b/charts/thanos-mixin/values.yaml index 4c358442..ffc3be52 100644 --- a/charts/thanos-mixin/values.yaml +++ b/charts/thanos-mixin/values.yaml @@ -12,4 +12,4 @@ additionalLabels: {} ## Additional annotations to add to the Prometheus rules ## -additionalAnnotations: {} \ No newline at end of file +additionalAnnotations: {} diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/docs/thanos-mixin-0.3.0.tgz b/docs/thanos-mixin-0.3.0.tgz new file mode 100644 index 00000000..a4a7f710 Binary files /dev/null and b/docs/thanos-mixin-0.3.0.tgz differ