Skip to content

Commit

Permalink
Fix up charts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom committed Aug 19, 2024
1 parent 68057fe commit 77212fc
Show file tree
Hide file tree
Showing 9 changed files with 425 additions and 373 deletions.
25 changes: 17 additions & 8 deletions chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
dependencies:
- name: vpatron
repository: file://../../vpatron/chart/
repository: file://../../finops-toolkit/vpatron/chart/
version: v0.0.5
- name: autospot
repository: file://../../autospot/chart/
repository: file://../../finops-toolkit/autospot/chart/
version: v0.0.5
- name: limit-ranger
repository: file://../../limit-ranger/chart/
repository: file://../../finops-toolkit/limit-ranger/chart/
version: v0.0.5
- name: office-hours
repository: file://../../office-hours/chart/
repository: file://../../finops-toolkit/office-hours/chart/
version: v0.0.5
- name: prometheus-opencost-exporter
repository: https://prometheus-community.github.io/helm-charts
version: 0.1.1
- name: opencost
repository: https://opencost.github.io/opencost-helm-chart
version: 1.41.0
- name: kyverno
repository: https://kyverno.github.io/kyverno/
version: 3.2.6
- name: finops-policies
repository: file://../../finops-policies/chart/
repository: file://../../finops-toolkit/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"
version: 8.4.4
- name: finops-dashboards
repository: file://../../finops-toolkit/finops-dashboards/chart/
version: 0.1.0
digest: sha256:7fc5a075027ea2d9e13fc40e1d6f996a178a16dcc637b890824a7215113693cc
generated: "2024-08-15T17:39:39.63753+01:00"
106 changes: 52 additions & 54 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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
Expand All @@ -11,66 +10,65 @@ description: A FinOps Stack for Kubernetes
# 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://../../finops-toolkit/vpatron/chart/
- name: autospot
version: "~0.0.0"
condition: feature.autospot
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/autospot/chart/
- name: limit-ranger
version: "~0.0.0"
condition: feature.limit-ranger
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/limit-ranger/chart/
- name: office-hours
version: "~> 0.0.0"
condition: feature.office-hours
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/office-hours/chart/

# OpenCost
- name: prometheus-opencost-exporter
version: "~> 0.1.1"
condition: feature.opencost-exporter
repository: https://prometheus-community.github.io/helm-charts
- name: opencost
version: "~> 1.41.0"
condition: feature.opencost
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: https://charts.jetstack.io

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

- name: grafana
version: "8.4.0"
condition: feature.grafana
repository: https://grafana.github.io/helm-charts
- name: vpatron
version: "~0.0.0"
condition: feature.vpatron
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/vpatron/chart/
- name: autospot
version: "~0.0.0"
condition: feature.autospot
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/autospot/chart/
- name: limit-ranger
version: "~0.0.0"
condition: feature.limit-ranger
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/limit-ranger/chart/
- name: office-hours
version: "~> 0.0.0"
condition: feature.office-hours
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/office-hours/chart/
# OpenCost
- name: prometheus-opencost-exporter
version: "*"
condition: feature.opencost-exporter
repository: https://prometheus-community.github.io/helm-charts
- name: opencost
version: "~> 1.41.0"
condition: feature.opencost
repository: https://opencost.github.io/opencost-helm-chart
# Kyverno
- name: kyverno
version: "3.2.6"
condition: feature.kyverno
repository: https://kyverno.github.io/kyverno/
- name: finops-policies
version: "*"
condition: feature.finops-policies
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/finops-policies/chart/
- name: vpa
version: "4.5.0"
condition: feature.vpa
repository: https://charts.fairwinds.com/stable
- name: grafana
version: "8.4.4"
condition: feature.grafana
repository: https://grafana.github.io/helm-charts
- name: finops-dashboards
version: "*"
condition: feature.finops-dashboards
# repository: https://charts.jetstack.io
repository: file://../../finops-toolkit/finops-dashboards/chart/
13 changes: 13 additions & 0 deletions chart/cloud-integration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "jetstack-david",
"private_key_id": "78e91aee7a823d5bc2fa1f08e8d2dfe942857620",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3YtG7peWpitOL\nqo6EvGZI4OnxRVB6OvsBHcw4kSGYbxw7t8QdI46sQBjNRUlCnALPxeiTZK4a8xYj\nXF2d8crvN309qAS/+GfnfopTIxFbaRNtTc9zhFTpwVmWExpotrGh5TDO3NU7o0tf\nJkm6jYMF+tg6GMUZiHvWsWDXhZPK/vJ8LjuI2+VIlrYYPFOoFuEl7Z0i4QO8tFPm\nvd9UycwhDy1SS47SZSzB/H4QSrKPoCeK6jeEwppcMHUnMFbnbOmd85luHUByA3fC\n1GQxe5/OLT76k4QhIyEYpeq01sGv/Yjt0LY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+mpLFs4F8SY21\nkO2taxoWA2tMXH6FYGxeSiUphx97BwCm7Rfw3uECgYBoLUnb4pvJTp0k6ux38GGh\ndXkI6M5VicQP9JGkX7CIoXPjIeF0xfQ+Tl0hCBWoVFsGElO9JIiPJxYYThA6FcFs\nyAoL2f3ofa7Y+xYAydvsxEEft78I2ysuSv4V7A1fy7as0oxxzlKYITaF8pNB8xsS\nL0eDTdinPdLwSDPRT/W9Ew==\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "107872192335592257166",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/compute-viewer-opencost%40jetstack-david.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}
16 changes: 16 additions & 0 deletions chart/templates/opencost/gmp.opencost-exporter-podmonitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ if and .Values.gke .Values.gke.podmonitoring (get .Values.feature "opencost-exporter") }}
---
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: opencost-exporter
spec:
selector:
matchLabels:
app.kubernetes.io/name: prometheus-opencost-exporter
endpoints:
- port: http
interval: 60s
targetLabels:
metadata: []
{{end}}
16 changes: 16 additions & 0 deletions chart/templates/opencost/gmp.opencost-podmonitoring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ if and .Values.gke .Values.gke.podmonitoring .Values.feature.opencost }}
---
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: opencost
spec:
selector:
matchLabels:
app.kubernetes.io/name: opencost
endpoints:
- port: http
interval: 60s
targetLabels:
metadata: []
{{end}}
28 changes: 27 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ feature:
# -- Enable / Disable the installation of Kyverno
kyverno: true
# -- Enable / Disable the installation of Kyverno FinOps Policies
finops-policies: false
finops-policies: true
# -- Enable / Disable the installation of the VPA Controller
vpa: false
# -- Enable / Disable the installation of the Grafana
grafana: true
# -- Enable / Disable the installation of Grafana FinOps Dashboards
finops-dashboards: true
# -- Enable / Disable the installation of OpenCost
opencost: true
# -- Enable / Disable the installation of OpenCost Exporter
Expand Down Expand Up @@ -62,6 +64,20 @@ vpa:
# image:
# tag: main

# @ignore
kyverno:
reportsController:
rbac:
clusterRole:
extraResources:
- apiGroups: [events.k8s.io]
resources: ["events"]
verbs: [create]
grafana:
enabled: true
labels:
grafana_dashboard: "finops"

# @ignored
grafana:
rbac:
Expand Down Expand Up @@ -89,3 +105,13 @@ grafana:
sidecar:
dashboards:
enabled: true
labelValue: finops

# @ignored
prometheus-opencost-exporter:
podSecurityContext:
fsGroup: 2000
opencost:
prometheus:
amp: {}
thanos: {}
5 changes: 3 additions & 2 deletions scripts/chart-dep-updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/Masterminds/semver/v3"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"gopkg.in/yaml.v3"

"helm.sh/helm/v3/pkg/chart/loader"
"helm.sh/helm/v3/pkg/cli"
"helm.sh/helm/v3/pkg/downloader"
Expand Down Expand Up @@ -48,7 +49,7 @@ func run(cmd *cobra.Command, args []string) {
chartPath := args[0]

// Load the Chart.yaml using yaml.Node to preserve structure
content, err := ioutil.ReadFile(chartPath)
content, err := os.ReadFile(chartPath)
if err != nil {
logger.Fatalf("Error reading Chart.yaml: %v", err)
}
Expand Down
Loading

0 comments on commit 77212fc

Please sign in to comment.