forked from FairwindsOps/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Insights Agent] Prometheus Collector (FairwindsOps#396)
* Add prometheus collector * Add subchart * Add prometheus address * Fix prometheus * Add RBAC * Add prometheus to list of repos * Fix prometheus version * Install prometheus on e2e tests * Fix URL for prometheus * Fix prometheus server name override * Fix hostname * Make prometheus run every 10 minutes * Fixup default valueS * Rename prometheus * remove dash * update helm dependencies * fixed condition * Update prometheus version * Fix lint
- Loading branch information
baderbuddy
committed
Dec 9, 2020
1 parent
537fc90
commit 28957ff
Showing
12 changed files
with
103 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,7 @@ kubehunter: | |
trivy: | ||
enabled: true | ||
maxScansPerRun: 2 | ||
|
||
resourcemetrics: | ||
enabled: true | ||
installPrometheus: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
dependencies: | ||
- name: goldilocks | ||
repository: https://charts.fairwinds.com/stable | ||
version: 2.3.1 | ||
condition: goldilocks.enabled | ||
- name: goldilocks | ||
repository: https://charts.fairwinds.com/stable | ||
version: 2.3.1 | ||
condition: goldilocks.enabled | ||
- name: prometheus | ||
repository: https://prometheus-community.github.io/helm-charts | ||
version: 11.16.9 | ||
condition: resourcemetrics.installPrometheus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
stable/insights-agent/templates/resource-metrics/cronjob.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{{- if .Values.resourcemetrics.enabled -}} | ||
{{- $_ := set . "Label" "resource-metrics" }} | ||
{{- $_ := set . "Config" .Values.resourcemetrics }} | ||
apiVersion: batch/v1beta1 | ||
kind: CronJob | ||
metadata: | ||
{{- include "metadata" . }} | ||
spec: | ||
{{ include "cronjob-spec" . | nindent 2 | trim }} | ||
jobTemplate: | ||
spec: | ||
{{ include "job-spec" . | nindent 6 | trim }} | ||
template: | ||
spec: | ||
{{ include "job-template-spec" . | indent 10 | trim }} | ||
containers: | ||
- {{ include "container-spec" . | indent 12 | trim }} | ||
command: | ||
- prometheus-collector | ||
env: | ||
- name: PROMETHEUS_ADDRESS | ||
value: {{ .Values.resourcemetrics.address | quote }} | ||
{{ include "security-context" . | indent 12 | trim }} | ||
{{ include "uploaderContainer" . | indent 10 | trim }} | ||
{{- end -}} |
24 changes: 24 additions & 0 deletions
24
stable/insights-agent/templates/resource-metrics/rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{- if .Values.resourcemetrics.enabled -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ include "insights-agent.fullname" . }}-resource-metrics | ||
labels: | ||
app: insights-agent | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "insights-agent.fullname" . }}-resource-metrics-view | ||
labels: | ||
app: insights-agent | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: view | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ include "insights-agent.fullname" . }}-resource-metrics | ||
namespace: {{ .Release.Namespace }} | ||
{{- end -}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters