From 86f2e4d11177bba1e489ae9a9d618b4be87d7a2c Mon Sep 17 00:00:00 2001 From: jesse goodier <31039225+jessegoodier@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:43:09 +0000 Subject: [PATCH] saved-report-configs in statefulset --- .kubeconfig | 20 +++++++++++++++++++ cost-analyzer/templates/_helpers.tpl | 3 +++ .../templates/aggregator-statefulset.yaml | 6 ++++++ 3 files changed, 29 insertions(+) create mode 100644 .kubeconfig diff --git a/.kubeconfig b/.kubeconfig new file mode 100644 index 000000000..b0995af40 --- /dev/null +++ b/.kubeconfig @@ -0,0 +1,20 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJME1ERXlOVEU1TWpVd09Wb1hEVE0wTURFeU1qRTVNalV3T1Zvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBS2JsCk5UaktPemdaNVdVakwybXdwaHNGU0Y4MXkvV3Vzd0lmZWtkMVI0UTA5RWZaRjE5WUFuOFhNMkhIelRQNU4wNXEKZXA0ZXlWdVZoNnVUS0dRQnh2TFZEN2E4bHlUZ3paVXFsZVJuRTJvQ2o4VCtpYnVDSS9SR3hkdis5NzJJYjBIUAp5MGJBK2NUWnRwMDBZeFZZMXYyTmF1c0g0NEw1OEdSTzIzME9QL01UU2Q1VENwZGJqRWdWOUhXR1FaOW1uL0RICnIzalB5eWtJeElpSDZtVWxBSUNCM25EK3RnOVQ4bzNka0FaZWlJWW92aExOamJGN2JtQXhSa1R4R0pYM0JFU3kKeU5aRjNwYmtNV0dyNXFMNzZGcjQrNlBFaXY1b0ZCWHFwNlBrSVVxOUk3a2RCczNmaW5ITWNUK1Z5aGRYK08rNwo2OFMvWldFdGNGMk5FMENuRlRVQ0F3RUFBYU5aTUZjd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZGUVdsNGJXTXdaSWtZcmZNY01Yb01PRlcvazJNQlVHQTFVZEVRUU8KTUF5Q0NtdDFZbVZ5Ym1WMFpYTXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBRGlPTnBXenRRNGI3YTBaanM0NQpvSVdjQVpTaUo4Mmx2Tks5RmJzSXo5dnZhOFVMRUVnQ0ZpUzVTdVUxV05sVDlQMnZUK0Q2ZjV5dUs4dWFNUGluCis5Y2FLYUw2L29oazg5V2FtYzNPUGpUWDhublhBNUU5M0pQakJWcHNmNEN1VE9EMDd1TDF3YVFDbTF5cjdvN0QKazV5RkJwY0UxTGZIcWtaRXpMVVNLUWpDdFhEUjFiTmxqVC9PSzZnSDJEcDBmUTFHT2RwWTlHZGVrQ09DRzZQcgpjeDh3Szk4ZWkwZzlsYnRTRmxkLzBPbTUvMlBUelQrR1ZXMExOQUZyY1ZZMkxtd0R6VnFvMWQwNkRzeElXYnBUCjRoQzdtUVgrWGsvS1cwUTg2QitVMHBwbEhRcVlsZmZuSHMwcVFpbjJzNEI4M2p1Qm5MeDczaUtvRkpweUR3NHAKVGhJPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== + server: https://127.0.0.1:46717 + name: kind-kind +contexts: +- context: + cluster: kind-kind + namespace: fmr-test + user: kind-kind + name: kind-kind +current-context: kind-kind +kind: Config +preferences: {} +users: +- name: kind-kind + user: + client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJQ2Z1RGlPOFUrcUF3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB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V4ZzdSaWJTazlsbEhxai9WaVRNM2tNaGY3ZnZWUkFxUnRlOGxJSGl6UHd5UE9LVVF6QkFobExXZApzN1A0R2V1aWRpUjN2YXM0cGFIYWlCQ244Rk1zSXlvK0daZmdxNDVXTml6azhLcWY5bk1UL0psNk1veXFoWVhJCnpYMm80UUtCZ1FEczJ0eVhOM0VZMm4vMERIRitOWDJpREZvQjRaRU8vZ3FqeFkwNVBHM0VFWjI0UWtlZGR2ZTIKRXJlTDg3U3piWlNhdGxMSE5YQXJYbUVtVVo2SklQcGRRYlVrZWs5clFRL2JtNUM0dVp6YkpzSllBWU1nQzBSTwo2L05DQ0JjWHlNOTRETUFzbmowalVxQTFnT3ZsRExWckVnSDM4TjZBTmpOdXRoL2dtcXphQ2c9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= diff --git a/cost-analyzer/templates/_helpers.tpl b/cost-analyzer/templates/_helpers.tpl index faf94e1b5..e4489e53d 100755 --- a/cost-analyzer/templates/_helpers.tpl +++ b/cost-analyzer/templates/_helpers.tpl @@ -960,6 +960,9 @@ Begin Kubecost 2.0 templates # This hasn't been observed as a problem in cost-analyzer, likely because # of the init container that gives everything under /var/configs 777. mountPath: /var/configs/waterfowl + - name: saved-report-configs + mountPath: /var/configs/reports.json + subPath: reports.json {{- end }} {{- if and ((.Values.kubecostProductConfigs).productKey).enabled ((.Values.kubecostProductConfigs).productKey).secretname (eq (include "aggregator.deployMethod" .) "statefulset") }} - name: productkey-secret diff --git a/cost-analyzer/templates/aggregator-statefulset.yaml b/cost-analyzer/templates/aggregator-statefulset.yaml index 3432d13e6..1dae847e7 100644 --- a/cost-analyzer/templates/aggregator-statefulset.yaml +++ b/cost-analyzer/templates/aggregator-statefulset.yaml @@ -74,6 +74,12 @@ spec: {{- end }} serviceAccountName: {{ template "aggregator.serviceAccountName" . }} volumes: + - name: saved-report-configs + configMap: + name: {{ .Values.savedReportConfigmapName | default "saved-report-configs" }} + items: + - key: saved-reports.json + path: reports.json - name: aggregator-staging emptyDir: sizeLimit: {{ .Values.kubecostAggregator.stagingEmptyDirSizeLimit }}