Skip to content

Commit 89cf47a

Browse files
authored
Merge pull request #264 from kubecost/bolt/logs-role
Thanos Env + Adding Role and RoleBinding for Pods/Log
2 parents 666f44f + f2ac3a2 commit 89cf47a

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

cost-analyzer/templates/cost-analyzer-cluser-role-template.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
{{- if and .Values.bugReporting .Values.bugReporting.logCollection -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
namespace: {{ .Release.Namespace }}
6+
name: {{ template "cost-analyzer.fullname" . }}
7+
rules:
8+
- apiGroups:
9+
- ''
10+
resources:
11+
- "pods/log"
12+
verbs:
13+
- get
14+
- list
15+
- watch
16+
---
17+
{{- end }}
118
apiVersion: rbac.authorization.k8s.io/v1
219
kind: ClusterRole
320
metadata:

cost-analyzer/templates/cost-analyzer-cluster-role-binding-template.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
{{- if and .Values.bugReporting .Values.bugReporting.logCollection -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: RoleBinding
4+
metadata:
5+
name: {{ template "cost-analyzer.fullname" . }}
6+
labels:
7+
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
8+
roleRef:
9+
apiGroup: rbac.authorization.k8s.io
10+
kind: Role
11+
name: {{ template "cost-analyzer.fullname" . }}
12+
subjects:
13+
- kind: ServiceAccount
14+
name: {{ template "cost-analyzer.fullname" . }}
15+
namespace: {{ .Release.Namespace }}
16+
---
17+
{{- end }}
118
apiVersion: rbac.authorization.k8s.io/v1
219
kind: ClusterRoleBinding
320
metadata:

cost-analyzer/templates/cost-analyzer-deployment-template.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ spec:
140140
configMapKeyRef:
141141
name: {{ template "cost-analyzer.fullname" . }}
142142
key: prometheus-server-endpoint
143+
{{- if .Values.thanos }}
144+
{{- if .Values.thanos.query }}
145+
{{- if .Values.thanos.query.enabled }}
146+
- name: THANOS_ENABLED
147+
value: "true"
148+
- name: THANOS_QUERY_URL
149+
value: http://{{ .Release.Name }}-thanos-query-http.{{ .Release.Namespace }}:{{ .Values.thanos.query.http.port }}
150+
{{- end }}
151+
{{- end }}
152+
{{- end }}
143153
- name: GOOGLE_APPLICATION_CREDENTIALS
144154
value: /var/configs/key.json
145155
- name: KUBECOST_TOKEN

cost-analyzer/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,14 @@ networkCosts:
229229

230230
turndown:
231231
enabled: false
232-
image: gcr.io/kubecost1/kubecost-turndown:v2
232+
image: gcr.io/kubecost1/kubecost-turndown:v3
233233
imagePullPolicy: Always
234234

235+
# Kubecost bug report feature
236+
bugReporting:
237+
# .Release.Namespace Logs Access
238+
logCollection: true
239+
235240
serviceMonitor:
236241
enabled: false
237242
additionalLabels: {}

0 commit comments

Comments
 (0)