Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor template fixes #2735

Merged
merged 6 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cost-analyzer/charts/grafana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ spec:
subPath: download_dashboards.sh
- name: storage
mountPath: "/var/lib/grafana"
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
{{- range .Values.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
Expand Down Expand Up @@ -96,8 +98,10 @@ spec:
value: "{{ .Values.sidecar.dashboards.folder }}"
- name: ERROR_THROTTLE_SLEEP
value: "{{ .Values.sidecar.dashboards.error_throttle_sleep }}"
{{- with .Values.sidecar.resources }}
resources:
{{ toYaml .Values.sidecar.resources | indent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: sc-dashboard-volume
mountPath: {{ .Values.sidecar.dashboards.folder | quote }}
Expand Down Expand Up @@ -177,7 +181,9 @@ spec:
{{- end}}
- name: storage
mountPath: "/var/lib/grafana"
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
{{- range .Values.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
Expand Down
6 changes: 1 addition & 5 deletions cost-analyzer/charts/grafana/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{ if .Values.global.grafana.enabled }}
{{- if .Values.rbac.create }}
{{ if and .Values.global.grafana.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
thomasvn marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand All @@ -10,12 +9,9 @@ metadata:
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- if .Values.rbac.pspEnabled }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: [{{ template "grafana.fullname" . }}]
{{- end }}
{{- end }}
{{ end }}
6 changes: 2 additions & 4 deletions cost-analyzer/charts/grafana/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{ if .Values.global.grafana.enabled }}
{{- if .Values.rbac.create -}}
{{ if and .Values.global.grafana.enabled .Values.rbac.create .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand All @@ -17,5 +16,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "grafana.serviceAccountName" . }}
{{- end -}}
{{ end }}
{{ end }}
8 changes: 1 addition & 7 deletions cost-analyzer/charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,7 @@ sidecar:
repository: kiwigrid/k8s-sidecar
tag: 1.25.1
pullPolicy: IfNotPresent
resources:
# limits:
# cpu: 100m
# memory: 100Mi
# requests:
# cpu: 50m
# memory: 50Mi
resources: {}
dashboards:
enabled: false
# label that the configmaps with dashboards are marked with
Expand Down
10 changes: 6 additions & 4 deletions cost-analyzer/templates/cost-analyzer-deployment-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,18 @@ spec:
claimName: {{ template "cost-analyzer.fullname" . }}-db
{{- end }}
{{- end }}
initContainers:
{{- if .Values.supportNFS }}
initContainers:
- name: config-db-perms-fix
{{- if .Values.initChownDataImage }}
image: {{ .Values.initChownDataImage }}
{{- else }}
image: busybox
{{- end }}
{{- with .Values.initChownData.resources }}
resources:
{{ toYaml .Values.initChownData.resources | indent 12 }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if and (.Values.kubecostModel.etlToDisk | default true) .Values.persistentVolume.dbPVEnabled }}
command: ["sh", "-c", "/bin/chmod -R 777 /var/configs && /bin/chmod -R 777 /var/db"]
{{- else }}
Expand Down Expand Up @@ -465,10 +467,10 @@ spec:
- image: {{ .Values.kubecostModel.image }}:{{ .Values.imageVersion }}
{{- else }}
- image: {{ .Values.kubecostModel.image }}:prod-{{ $.Chart.AppVersion }}
{{ end }}
{{- end }}
{{- else }}
- image: gcr.io/kubecost1/cost-model:prod-{{ $.Chart.AppVersion }}
{{ end }}
{{- end }}
name: cost-model
{{- if .Values.kubecostModel.extraArgs }}
args:
Expand Down
1 change: 1 addition & 0 deletions cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ kubecostModel:
# - secretName: cost-analyzer-model-tls
# hosts:
# - cost-analyzer-model.local
utcOffset: "+00:00"

# etlUtils is a utility currently used by Kubecost internal support to implement specific functionality related to Thanos conversion.
etlUtils:
Expand Down