Skip to content

Commit

Permalink
feat: Update eks-cost-exporter and add rbac manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreZiviani committed Dec 30, 2022
1 parent 18790f3 commit 574d915
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/eks-cost-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: eks-cost-exporter
description: Exports the cost of each Kubernetes pod as prometheus metrics
type: application
appVersion: v0.2.1
version: 0.1.0
appVersion: v0.3.0
version: 0.2.1
maintainers:
- name: AndreZiviani
3 changes: 3 additions & 0 deletions charts/eks-cost-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ helm repo add andreziviani https://andreziviani.github.io/helm-charts
| podPortName | string | `"http-metrics"` | |
| podSecurityContext | object | `{}` | |
| priorityClassName | string | `"system-node-critical"` | |
| rbac.annotations | object | `{}` | |
| rbac.create | bool | `true` | |
| rbac.labels | object | `{}` | |
| replicas | int | `1` | |
| resources.requests.cpu | string | `"50m"` | |
| resources.requests.memory | string | `"128Mi"` | |
Expand Down
56 changes: 56 additions & 0 deletions charts/eks-cost-exporter/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{- if .Values.rbac.create }}
{{- $root := . -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
{{- include "eks-cost-exporter.labels" . | nindent 4 }}
{{- with .Values.rbac.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{- tpl (toYaml . | nindent 4) $root }}
{{- end }}
name: {{ include "eks-cost-exporter.fullname" . }}
rules:
- apiGroups:
- ""
resources:
- nodes
- pods
verbs:
- get
- list
- watch
- apiGroups:
- metrics.k8s.io
resources:
- pods
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
{{- include "eks-cost-exporter.labels" . | nindent 4 }}
{{- with .Values.rbac.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{- tpl (toYaml . | nindent 4) $root }}
{{- end }}
name: {{ include "eks-cost-exporter.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "eks-cost-exporter.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "eks-cost-exporter.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/eks-cost-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ serviceMonitor:
scrapeTimeout: 30s
relabelings: []

rbac:
create: true
labels: {}
annotations: {}

#nodeSelector: |
# selector: label
#
Expand Down

0 comments on commit 574d915

Please sign in to comment.