Skip to content

Commit

Permalink
Initial Import of Helm Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom committed Aug 8, 2024
1 parent d9595d4 commit f2a9a30
Show file tree
Hide file tree
Showing 10 changed files with 437 additions and 5 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/build-helm-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build Chart

on:
workflow_dispatch: # Enable manual generation
pull_request:
push:
branches:
- "main"
paths:
- "chart/**"


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-chart
cancel-in-progress: true

jobs:
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests

name: Lint Helm Chart
runs-on: ubuntu-latest
defaults:
run:
working-directory: chart/

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: azure/setup-helm@v4

- run: helm dep update
- run: helm lint


build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: chart/

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v4

- run: helm dep update

# Ensure that the chart's default values produce manifests
- run: helm template test

- if: ${{inputs.publish}}
name: checkout jetstack-charts
uses: actions/checkout@v3
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
repository: jetstack/jetstack-charts
ref: main
path: jetstack-charts

- if: ${{inputs.publish}}
name: Package helm chart
working-directory: ./${{inputs.chart-name}}/chart/
run: |
helm package . -d jetstack-charts/charts/
- name: Creating PR
if: ${{inputs.publish}}
uses: peter-evans/[email protected]
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
title: "Release ${{inputs.chart-name}} ${{github.ref_name }}"
commit-message: "Release ${{inputs.chart-name}} ${{github.ref_name }}"
branch: ${{inputs.chart-name}}/${{github.ref_name}}
path: jetstack-charts
add-paths: charts/*.tgz
delete-branch: true
signoff: true
base: main
draft: false
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
name: Build and Deploy
name: Build and Deploy Site
on:
workflow_dispatch: # Enable manual generation
pull_request:
push:
branches:
- "main"
paths:
- "!chart/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-docs
cancel-in-progress: true

jobs:
build_and_deploy_hugo_site:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

name: Build and Deploy Static site

Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/publish-helm-chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Publish Chart

on:
workflow_dispatch: # Enable manual generation
pull_request:
push:
tags:
- "v*"
paths:
- "chart/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-chart
cancel-in-progress: true

jobs:
lint:
permissions:
contents: read
pull-requests: read

name: Lint Helm Chart
runs-on: ubuntu-latest
defaults:
run:
working-directory: chart/

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: azure/setup-helm@v4

- run: helm dep update
- run: helm lint


build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: chart/

permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v4

- run: helm dep update

# Ensure that the chart's default values produce manifests
- run: helm template test

- name: checkout jetstack-charts
uses: actions/checkout@v3
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
repository: jetstack/jetstack-charts
ref: main
path: jetstack-charts

- name: Package helm chart
run: |
helm package . -d jetstack-charts/charts/
- name: Creating PR
uses: peter-evans/[email protected]
with:
token: ${{ secrets.JETSTACK_CHARTS_PAT }}
title: "Release FinOps Stack ${{github.ref_name }}"
commit-message: "Release FinOps Stack ${{github.ref_name }}"
branch: finops-stack/${{github.ref_name}}
path: jetstack-charts
add-paths: charts/*.tgz
delete-branch: true
signoff: true
base: main
draft: false
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,12 @@ $RECYCLE.BIN/

# End of https://www.toptal.com/developers/gitignore/api/windows,macos,python
site/
# Created by https://www.toptal.com/developers/gitignore/api/helm
# Edit at https://www.toptal.com/developers/gitignore?templates=helm

### Helm ###
# Chart dependencies
**/charts/*.tgz
*.tgz

# End of https://www.toptal.com/developers/gitignore/api/helm
23 changes: 23 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
27 changes: 27 additions & 0 deletions chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
dependencies:
- name: vpatron
repository: file://../../vpatron/chart/
version: v0.0.5
- name: autospot
repository: file://../../autospot/chart/
version: v0.0.5
- name: limit-ranger
repository: file://../../limit-ranger/chart/
version: v0.0.5
- name: office-hours
repository: file://../../office-hours/chart/
version: v0.0.5
- name: kyverno
repository: https://kyverno.github.io/kyverno/
version: 3.2.6
- name: finops-policies
repository: file://../../finops-policies/chart/
version: v0.0.5
- name: vpa
repository: https://charts.fairwinds.com/stable
version: 4.5.0
- name: grafana
repository: https://grafana.github.io/helm-charts
version: 8.4.1
digest: sha256:c652c255c5ee0273c90708b220340debf6a7669f8aec29a8d421be44c92af40a
generated: "2024-08-08T13:50:34.800366+01:00"
74 changes: 74 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apiVersion: v2
name: finops-stack
description: A FinOps Stack for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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: v0.0.5

# 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.
# It is recommended to use it with quotes.
appVersion: "0.0.3"

dependencies:
- name: vpatron
version: "~0.0.0"
condition: feature.vpatron
repository: https://charts.jetstack.io
# repository: file://../../vpatron/chart/
- name: autospot
version: "~0.0.0"
condition: feature.autospot
repository: https://charts.jetstack.io
# repository: file://../../autospot/chart/
- name: limit-ranger
version: "~0.0.0"
condition: feature.limit-ranger
repository: https://charts.jetstack.io
# repository: file://../../limit-ranger/chart/
- name: office-hours
version: "~0.0.0"
condition: feature.office-hours
repository: https://charts.jetstack.io
# repository: file://../../office-hours/chart/

# OpenCost
# - name: prometheus-opencost-exporter
# version: "*"
# repository: https://prometheus-community.github.io/helm-charts
# - name: opencost
# version: "*"
# repository: https://opencost.github.io/opencost-helm-chart

# Kyverno
- name: kyverno
version: "*"
condition: feature.kyverno
repository: https://kyverno.github.io/kyverno/
- name: finops-policies
version: "*"
condition: feature.finops-policies
repository: file://../../finops-policies/chart/

- name: vpa
version: "*"
condition: feature.vpa
repository: https://charts.fairwinds.com/stable

- name: grafana
version: "*"
condition: feature.grafana
repository: https://grafana.github.io/helm-charts
34 changes: 34 additions & 0 deletions chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# finops-stack

![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.2](https://img.shields.io/badge/AppVersion-0.0.2-informational?style=flat-square)

A FinOps Stack for Kubernetes

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| file://../../autospot/chart/ | autospot | * |
| file://../../finops-policies/chart/ | finops-policies | * |
| file://../../limit-ranger/chart/ | limit-ranger | * |
| file://../../office-hours/chart/ | office-hours | * |
| file://../../vpatron/chart/ | vpatron | * |
| https://charts.fairwinds.com/stable | vpa | * |
| https://grafana.github.io/helm-charts | grafana | * |
| https://kyverno.github.io/kyverno/ | kyverno | * |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| feature.autospot | bool | `false` | Enable / Disable the AutoSpot controller |
| feature.finops-policies | bool | `false` | Enable / Disable the installation of Kyverno FinOps Policies |
| feature.grafana | bool | `true` | Enable / Disable the installation of the Grafana |
| feature.kyverno | bool | `true` | Enable / Disable the installation of Kyverno |
| feature.limit-ranger | bool | `true` | Enable / Disable the limit-ranger controller |
| feature.office-hours | bool | `true` | Enable / Disable the office-hours controller |
| feature.vpa | bool | `false` | Enable / Disable the installation of the VPA Controller |
| feature.vpatron | bool | `true` | Enable / Disable the vpatron controller |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Loading

0 comments on commit f2a9a30

Please sign in to comment.