Skip to content

Commit

Permalink
Add support for mimir on gcp
Browse files Browse the repository at this point in the history
Will use this to test grafana agent on our cd-demo cluster
  • Loading branch information
michaeljguarino committed Nov 16, 2023
1 parent ade6b63 commit b4579cd
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mimir/helm/mimir/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: mimir
description: helm chart for mimir
type: application
version: 0.1.6
version: 0.1.7
appVersion: 2.7.1
dependencies:
- name: mimir-distributed
Expand Down
5 changes: 5 additions & 0 deletions mimir/helm/mimir/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ mimir-distributed:
annotations:
eks.amazonaws.com/role-arn: {{ importValue "Terraform" "iam_role_arn" }}
{{- end }}
{{- if $isGcp }}
serviceAccount:
annotations:
iam.gke.io/gcp-service-account: {{ importValue "Terraform" "service_account_email" }}
{{ end }}
{{- if and .Values.basicAuth .Values.hostname (not $traceShield) }}
gateway:
enabledNonEnterprise: true
Expand Down
1 change: 0 additions & 1 deletion mimir/plural/recipes/mimir-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: mimir-gcp
description: Installs mimir on an aws eks cluster
provider: GCP
primary: true
private: true
dependencies:
- repo: bootstrap
name: gcp-k8s
Expand Down
6 changes: 4 additions & 2 deletions mimir/terraform/gcp/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ apiVersion: plural.sh/v1alpha1
kind: Dependencies
metadata:
description: mimir gcp setup
version: 0.1.0
version: 0.1.1
spec:
dependencies:
- name: gcp-bootstrap
repo: bootstrap
type: terraform
version: '>= 0.1.1'
providers:
- gcp
- gcp
outputs:
service_account_email: service_account_email
20 changes: 20 additions & 0 deletions mimir/terraform/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,23 @@ resource "kubernetes_namespace" "mimir" {
}
}


module "mimir-workload-identity" {
source = "terraform-google-modules/kubernetes-engine/google//modules/workload-identity"
name = "${var.cluster_name}-mimir-sa"
namespace = var.namespace
project_id = var.project_id
use_existing_k8s_sa = true
annotate_k8s_sa = false
k8s_sa_name = var.mimir_serviceaccount
roles = ["roles/storage.admin"]
}

module "gcs_buckets" {
source = "github.com/pluralsh/module-library//terraform/gcs-buckets"

project_id = var.project_id
bucket_names = [var.dagster_bucket]
service_account_email = module.dagster-workload-identity.gcp_service_account_email
location = var.bucket_location
}
3 changes: 3 additions & 0 deletions mimir/terraform/gcp/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "service_account_email" {
value = module.mimir-workload-identity.gcp_service_account_email
}
5 changes: 5 additions & 0 deletions mimir/terraform/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ variable "namespace" {
variable "cluster_name" {
type = string
}

variable "mimir_serviceaccount" {
type = string
default = "mimir"
}

0 comments on commit b4579cd

Please sign in to comment.