Skip to content

Commit

Permalink
Merge pull request #264 from kubecost/bolt/logs-role
Browse files Browse the repository at this point in the history
Thanos Env + Adding Role and RoleBinding for Pods/Log
  • Loading branch information
mbolt35 authored Feb 3, 2020
2 parents 666f44f + f2ac3a2 commit 89cf47a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 1 deletion.
17 changes: 17 additions & 0 deletions cost-analyzer/templates/cost-analyzer-cluser-role-template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
{{- if and .Values.bugReporting .Values.bugReporting.logCollection -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: {{ .Release.Namespace }}
name: {{ template "cost-analyzer.fullname" . }}
rules:
- apiGroups:
- ''
resources:
- "pods/log"
verbs:
- get
- list
- watch
---
{{- end }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
{{- if and .Values.bugReporting .Values.bugReporting.logCollection -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "cost-analyzer.fullname" . }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "cost-analyzer.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "cost-analyzer.fullname" . }}
namespace: {{ .Release.Namespace }}
---
{{- end }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
10 changes: 10 additions & 0 deletions cost-analyzer/templates/cost-analyzer-deployment-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ spec:
configMapKeyRef:
name: {{ template "cost-analyzer.fullname" . }}
key: prometheus-server-endpoint
{{- if .Values.thanos }}
{{- if .Values.thanos.query }}
{{- if .Values.thanos.query.enabled }}
- name: THANOS_ENABLED
value: "true"
- name: THANOS_QUERY_URL
value: http://{{ .Release.Name }}-thanos-query-http.{{ .Release.Namespace }}:{{ .Values.thanos.query.http.port }}
{{- end }}
{{- end }}
{{- end }}
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/configs/key.json
- name: KUBECOST_TOKEN
Expand Down
7 changes: 6 additions & 1 deletion cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,14 @@ networkCosts:

turndown:
enabled: false
image: gcr.io/kubecost1/kubecost-turndown:v2
image: gcr.io/kubecost1/kubecost-turndown:v3
imagePullPolicy: Always

# Kubecost bug report feature
bugReporting:
# .Release.Namespace Logs Access
logCollection: true

serviceMonitor:
enabled: false
additionalLabels: {}
Expand Down

0 comments on commit 89cf47a

Please sign in to comment.