Skip to content

Commit 957115e

Browse files
maria-reynosojontutcherdependabot[bot]davidcollom
authored
FinOps on EKS (#33)
* helmfile * prometheus exporter * Update docs * new line * update * env eks file * fix helmfile apply command * fix opencost templates chart * fix opencost * update env file * fix opencost template chart * remove opencost from prometheus * no aws access key needed * add dashboard to kind * update doc * new line * Re-word * Re-word * Update docs * Update docs * helmfile * prometheus exporter * Update docs * new line * update * env eks file * fix helmfile apply command * fix opencost templates chart * fix opencost * update env file * fix opencost template chart * remove opencost from prometheus * no aws access key needed * add dashboard to kind * update doc * new line * Re-word * Add scan pipeline * Bump golang.org/x/crypto in /scripts/chart-dep-updater (#37) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.26.0 to 0.31.0. - [Commits](golang/crypto@v0.26.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Re-word * Update docs * Update docs --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Jon Tutcher <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Collom <[email protected]>
1 parent 1e48cf3 commit 957115e

19 files changed

+366
-46
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The FinOps Stack is the blueprint for a solution to automate FinOps best practic
88

99
Our goal is to empower organisations with the tools they need to manage, visualise, and optimise their cloud resources in complex, ever-changing environments.
1010

11-
The FinOps Stack is designed to work out-of-the-box seamlessly with GKE standard/autopilot clusters using Google Managed Prometheus, and can be customised for an organisation’s business requirements and/or Kubernetes distribution.
11+
The FinOps Stack is designed to work out-of-the-box seamlessly with Kind, GKE standard/autopilot clusters using Google Managed Prometheus, and EKS and can be customised for an organisation’s business requirements and/or Kubernetes distribution.
1212

1313
This repository contains the core components of FinOps Stack, including:
1414

charts/opencost-config/templates/opencost/dashboards.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if .Values.dashboards }}
12
{{- range $path, $_ := .Files.Glob "dashboards/**.json" }}
23
---
34
apiVersion: v1
@@ -11,3 +12,4 @@ data:
1112
{{ base $path }}: |-
1213
{{ ($.Files.Get $path) | nindent 6 }}
1314
{{ end }}
15+
{{ end }}

content/install.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ To simplify installation, the FinOps Stack is installed using a single Helmfile
88

99
The following instructions are designed to work with a Kind cluster for quick setup. For full instructions, prerequisites and customisations, please see the [installation README](https://github.com/jetstack/finops-stack/blob/main/installation/README.md).
1010

11-
To work with GKE standard and GKE autopilot see the [ GKE installation guide]((https://github.com/jetstack/finops-stack/blob/main/installation/README.md))
11+
To work with GKE standard and GKE autopilot see the [ GKE installation guide]((https://github.com/jetstack/finops-stack/blob/main/installation/gke.md))
12+
13+
To work with EKS cluster see the [ EKS installation guide]((https://github.com/jetstack/finops-stack/blob/main/installation/eks.md))
1214

1315
### Helmfile
1416

installation/Helmfile_eks.yaml

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
repositories:
2+
- name: kyverno
3+
url: https://kyverno.github.io/kyverno/
4+
- name: prometheus-opencost-exporter
5+
url: https://prometheus-community.github.io/helm-charts
6+
- name: prometheus
7+
url: https://prometheus-community.github.io/helm-charts
8+
- name: grafana
9+
url: https://grafana.github.io/helm-charts
10+
- name: vpa
11+
url: https://charts.fairwinds.com/stable
12+
- name: cert-manager
13+
url: https://charts.jetstack.io
14+
- name: fairwinds-stable
15+
url: https://charts.fairwinds.com/stable
16+
17+
---
18+
helmDefaults:
19+
wait: true
20+
timeout: 1200
21+
---
22+
environments:
23+
default:
24+
values:
25+
- "./config/{{ requiredEnv "HOST_ENV" }}/enabled.yaml"
26+
---
27+
releases:
28+
- name: kyverno
29+
version: "3.2.6"
30+
chart: kyverno/kyverno
31+
condition: kyverno.enabled
32+
namespace: finops-stack
33+
values:
34+
- "./config/common/kyverno-values.yaml"
35+
- "./config/{{ requiredEnv "HOST_ENV" }}/kyverno-values.yaml"
36+
37+
- name: finops-policies
38+
version: "0.1.0"
39+
chart: "../charts/finops-policies"
40+
condition: finops-policies.enabled
41+
namespace: finops-stack
42+
disableValidationOnInstall: true
43+
needs:
44+
- kyverno
45+
46+
- name: cert-manager
47+
version: v1.15.3
48+
chart: cert-manager/cert-manager
49+
condition: cert-manager.enabled
50+
namespace: cert-manager
51+
values:
52+
- "./config/common/cert-manager-values.yaml"
53+
- "./config/{{ requiredEnv "HOST_ENV" }}/cert-manager-values.yaml"
54+
- global:
55+
leaderElection:
56+
namespace: cert-manager
57+
commonLabels:
58+
cost-center-label: "xyz"
59+
- serviceAccount:
60+
annotations:
61+
{{ env "CERT_MANAGER_SA_ANNOTATION" }}
62+
63+
- name: cert-manager-config
64+
version: "0.1.0"
65+
chart: "../charts/cert-manager-config"
66+
condition: cert-manager.enabled
67+
namespace: finops-stack
68+
disableValidationOnInstall: true
69+
needs:
70+
- cert-manager/cert-manager
71+
values:
72+
- email: {{ env "CERT_MANAGER_EMAIL" }}
73+
- grafanaTLSCert:
74+
hostname: {{ env "GRAFANA_FQDN" }}
75+
76+
- name: grafana
77+
version: "8.4.7"
78+
chart: grafana/grafana
79+
condition: grafana.enabled
80+
namespace: finops-stack
81+
values:
82+
- "./config/common/grafana-values.yaml"
83+
- "./config/{{ requiredEnv "HOST_ENV" }}/grafana-values.yaml"
84+
- adminUser: {{ env "GRAFANA_ADMIN_USER" }}
85+
- adminPassword: {{ env "GRAFANA_ADMIN_PW" }}
86+
- serviceAccount:
87+
annotations:
88+
{{ env "GRAFANA_SA_ANNOTATION" }}
89+
90+
# If you don't require ingress via an FQDN remove this ingress section
91+
- ingress:
92+
enabled: {{ env "GRAFANA_INGRESS" }}
93+
annotations:
94+
kubernetes.io/ingress.global-static-ip-name: {{ env "GRAFANA_PUBLIC_IP_NAME" }}
95+
hosts:
96+
- {{ env "GRAFANA_FQDN" }}
97+
# If you don't require https access to the Grafana dashboard remove this tls section
98+
tls:
99+
- secretName: {{ env "GRAFANA_FQDN" }}-tls
100+
hosts:
101+
- {{ env "GRAFANA_FQDN" }}
102+
needs:
103+
- cert-manager/cert-manager
104+
105+
- name: vpa
106+
version: "4.5.0"
107+
chart: "vpa/vpa"
108+
condition: vpa.enabled
109+
namespace: finops-stack
110+
values:
111+
- "./config/common/vpa-values.yaml"
112+
113+
- name: prometheus-opencost-exporter
114+
version: "0.1.1"
115+
chart: "prometheus-opencost-exporter/prometheus-opencost-exporter"
116+
condition: opencost-exporter.enabled
117+
namespace: finops-stack
118+
values:
119+
- "./config/common/prometheus-opencost-exporter-values.yaml"
120+
- "./config/{{ requiredEnv "HOST_ENV" }}/prometheus-opencost-exporter-values.yaml"
121+
122+
- name: finops-stack-opencost-templates
123+
version: "0.1.0"
124+
chart: "../charts/opencost-config"
125+
condition: opencost-templates.enabled
126+
namespace: finops-stack
127+
disableValidationOnInstall: true
128+
values:
129+
- "./config/{{ requiredEnv "HOST_ENV" }}/opencost-templates-values.yaml"
130+
131+
- name: goldilocks
132+
version: "9.0.0"
133+
chart: fairwinds-stable/goldilocks
134+
condition: goldilocks.enabled
135+
namespace: finops-stack
136+
values:
137+
- "./config/common/goldilocks-values.yaml"
138+
139+

installation/Makefile

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
.DEFAULT_GOAL := help
22

3-
CLUSTER_NAME := ambient
4-
PROJECT_ID := "$(shell gcloud config get-value project)"
5-
M_TYPE := n1-standard-2
6-
ZONE := europe-west2-a
7-
83
cluster: ## Setup cluster
94
kind create cluster
105

installation/README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Installation using Helmfile
1+
# FinOps Stack deployment
22

3-
Installing Helm charts with lots of dependencies and CRDs is challenging; these instructions use Helmfile to mitigate issues with Helm.
3+
This documentation provides instructions for installing the FinOps Stack in Kind cluster for a quick setup.
44

5-
This documentation provides instructions for installing the FinOps Stack in Kind cluster for a quick setup. For deployment on a GKE cluster, refer to the [gke docs](./gke.md).
5+
For deployment on a GKE cluster, refer to the [GKE docs](./gke.md) and deployment on a EKS cluster refer to the [EKS docs](./eks.md).
6+
7+
## Using Helmfile
8+
9+
Installing Helm charts with lots of dependencies and CRDs is challenging; these instructions use Helmfile to mitigate issues with Helm.
610

711
## Pre-requisites
812

installation/config/common/enabled.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ grafana:
1414
# -- Enable / Disable the installation of cert-manager
1515
cert-manager:
1616
enabled: false
17-
# -- Enable / Disable the installation of OpenCost
18-
opencost:
19-
enabled: false
2017
# -- Enable / Disable the installation of OpenCost Exporter
2118
opencost-exporter:
2219
enabled: true
20+
# -- Enable / Disable the installation of Prometheus (required when using EKS or Kind)
21+
prometheus:
22+
enabled: false
2323

2424
opencost-templates:
2525
enabled: true
2626

2727
# -- Enable / Disable the installation of GMP Proxy (required when using Google Managed Prometheus)
2828
gmp-proxy:
29-
enabled: true
29+
enabled: false
3030

3131
# -- Enable / Disable the installation of Fairwinds' Goldilocks
3232
goldilocks:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
datasources:
2+
datasources.yaml:
3+
apiVersion: 1
4+
datasources:
5+
- name: Prometheus
6+
type: prometheus
7+
uid: "PFB5ABA51A8A585D7"
8+
url: http://prometheus-server
9+
isDefault: true
10+
editable: true
11+
ingress:
12+
enabled: false
13+
annotations:
14+
kubernetes.io/ingress.global-static-ip-name: "ip-name"
15+
hosts:
16+
- grafana.example.com
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
features:
2+
backgroundScan:
3+
skipResourceFilters: false # Important so that background Scan's Exclude Namespaces, etc
4+
config:
5+
resourceFiltersIncludeNamespaces:
6+
- kube-system
7+
webhooks:
8+
- namespaceSelector:
9+
matchExpressions:
10+
- key: kubernetes.io/metadata.name
11+
operator: NotIn
12+
values:
13+
- kube-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dashboards: true
2+
opencost:
3+
customPricing:
4+
# -- This is only to enable custom pricing on on-premises or kind
5+
enabled: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
cloudCost:
2+
enabled: false
3+
opencost:
4+
cloudCost:
5+
enabled: false
6+
prometheus:
7+
external:
8+
enabled: false
9+
# url: http://prometheus-server
10+
internal:
11+
# -- Use in-cluster Prometheus
12+
enabled: true
13+
# -- Service name of in-cluster Prometheus
14+
serviceName: prometheus-server
15+
# -- Namespace of in-cluster Prometheus
16+
namespaceName: finops-stack
17+
# -- Service port of in-cluster Prometheus
18+
port: 80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
service:
2+
enabled: true
3+
opencost:
4+
prometheus:
5+
external:
6+
enabled: false
7+
# url: http://prometheus-server
8+
internal:
9+
# -- Use in-cluster Prometheus
10+
enabled: true
11+
# -- Service name of in-cluster Prometheus
12+
serviceName: prometheus-server
13+
# -- Namespace of in-cluster Prometheus
14+
namespaceName: finops-stack
15+
# -- Service port of in-cluster Prometheus
16+
port: 80
17+
exporter:
18+
persistence:
19+
enabled: false
20+
# -- Annotations for persistent volume
21+
annotations: {}
22+
# -- Access mode for persistent volume
23+
accessMode: ""
24+
# -- Storage class for persistent volume
25+
storageClass: "standard-rwo"
26+
# -- Size for persistent volume
27+
size: "10g"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extraScrapeConfigs: |
2+
- job_name: opencost
3+
honor_labels: true
4+
scrape_interval: 1m
5+
scrape_timeout: 10s
6+
metrics_path: /metrics
7+
scheme: http
8+
dns_sd_configs:
9+
- names:
10+
- opencost.opencost
11+
type: 'A'
12+
port: 9003
13+
14+
alertmanager:
15+
enabled: false
16+
prometheus-pushgateway:
17+
enabled: false
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
dashboards: true
2+
opencost:
3+
customPricing:
4+
# -- This is only to enable custom pricing on on-premises or kind
5+
enabled: false
16
gke:
2-
podmonitoring: true
7+
podmonitoring: true

installation/config/kind/enabled.yaml

-26
This file was deleted.

installation/config/kind/opencost-templates-values.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
dashboards: true
12
opencost:
23
configFileName: default
34
provider: kind

0 commit comments

Comments
 (0)