From ebd3ca775645700b22efd5f42f826b71705aa169 Mon Sep 17 00:00:00 2001 From: seemywings Date: Tue, 17 Dec 2024 15:07:47 -0500 Subject: [PATCH] adding kubecost --- catalogs/devops/kubecost/README.md | 2 + catalogs/devops/kubecost/kubecost.yaml.liquid | 14 +++++++ .../kubecost/servicedeployment.yaml.liquid | 26 +++++++++++++ setup/catalogs/devops/kubecost.yaml | 37 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 catalogs/devops/kubecost/README.md create mode 100644 catalogs/devops/kubecost/kubecost.yaml.liquid create mode 100644 catalogs/devops/kubecost/servicedeployment.yaml.liquid create mode 100644 setup/catalogs/devops/kubecost.yaml diff --git a/catalogs/devops/kubecost/README.md b/catalogs/devops/kubecost/README.md new file mode 100644 index 00000000..7bd57b16 --- /dev/null +++ b/catalogs/devops/kubecost/README.md @@ -0,0 +1,2 @@ +# Plural Kubecost + diff --git a/catalogs/devops/kubecost/kubecost.yaml.liquid b/catalogs/devops/kubecost/kubecost.yaml.liquid new file mode 100644 index 00000000..3a634ff7 --- /dev/null +++ b/catalogs/devops/kubecost/kubecost.yaml.liquid @@ -0,0 +1,14 @@ +global: + grafana: + enabled: false + +kubecostFrontend: + enabled: false + +serviceMonitor: + enabled: true + +server: + global: + external_labels: + cluster_id: {{ context.cluster }} diff --git a/catalogs/devops/kubecost/servicedeployment.yaml.liquid b/catalogs/devops/kubecost/servicedeployment.yaml.liquid new file mode 100644 index 00000000..6ae5159c --- /dev/null +++ b/catalogs/devops/kubecost/servicedeployment.yaml.liquid @@ -0,0 +1,26 @@ +apiVersion: deployments.plural.sh/v1alpha1 +kind: ServiceDeployment +metadata: + name: kubecost-{{ context.cluster }} + namespace: apps +spec: + namespace: kubecost + git: + folder: helm/kubecost/{{ context.cluster }} + ref: main + repositoryRef: + kind: GitRepository + name: infra + namespace: infra + helm: + version: "2.5.x" + chart: kubecost + url: https://grafana.github.io/helm-charts + valuesFiles: + - kubecost.yaml.liquid + configuration: + cluster: { ? { context.cluster } } + clusterRef: + kind: Cluster + name: mgmt + namespace: infra diff --git a/setup/catalogs/devops/kubecost.yaml b/setup/catalogs/devops/kubecost.yaml new file mode 100644 index 00000000..f1f15893 --- /dev/null +++ b/setup/catalogs/devops/kubecost.yaml @@ -0,0 +1,37 @@ +apiVersion: deployments.plural.sh/v1alpha1 +kind: PrAutomation +metadata: + name: kubecost +spec: + name: kubecost + icon: https://cdn.icon-icons.com/icons2/2699/PNG/512/grafana_logo_icon_171048.png + documentation: | + Sets up Kubecost Kubernetes Cost Monitoring and Management. + creates: + git: + ref: sebastian/prod-2981-set-up-catalog-pipeline # TODO set to main + folder: catalogs/devops/kubecost + templates: + - source: README.md + destination: documentation/kubecost/README.md + external: true + - source: kubecost.yaml.liquid + destination: "helm/kubecost/{{ context.cluster }}/kubecost.yaml.liquid" + external: true + - source: servicedeployment.yaml.liquid + destination: "bootstrap/apps/kubecost/{{ context.cluster }}/servicedeployment.yaml" + external: true + repositoryRef: + name: scaffolds + catalogRef: + name: devops + scmConnectionRef: + name: plural # you'll need to add this ScmConnection manually before this is functional + title: "Kubecost setup ({{ context.cluster }})" + message: | + Sets up Kubecost on {{ context.cluster }} cluster. + identifier: pluralsh/plrl-dev-aws # FIXME + configuration: + - name: cluster + type: STRING + documentation: the cluster you want to deploy to