Skip to content

Commit

Permalink
Merge pull request #28 from philips-labs/feature/remove-grafana
Browse files Browse the repository at this point in the history
Remove Grafana
  • Loading branch information
loafoe authored Jul 9, 2021
2 parents 3b1925b + cdc12be commit 3f0b331
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 212 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Generate terraform docs

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Render terraform docs inside the README.md and push changes back to PR branch
uses: terraform-docs/[email protected]
with:
working-dir: .
output-file: README.md
output-method: inject
git-push: "true"
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## v4.0.0
- BREAKING: remove Grafana from module
- NOTE: Before upgrade: `terraform state rm module.thanos.grafana_data_source.thanos`
- NOTE: Before upgrade: `terraform destroy -target=module.thanos.module.grafana`


## v3.0.1
- Update variant to support discovering CF instances

## v3.0.0
- Add [variant](https://github.com/philips-labs/variant) support
- Rename cf_exporter_config to more generic cf_functional_account
Expand Down
141 changes: 55 additions & 86 deletions README.md

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ module "thanos" {
cf_org_name = "demo"
cf_space_id = "test"

grafana_password = "password"

cf_functional_account = {
api_endpoint = var.cf_api_url
username = var.cf_username
password = var.cf_password
}
}
}
5 changes: 0 additions & 5 deletions examples/default/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ provider "cloudfoundry" {
skip_ssl_validation = false
}

provider "grafana" {
url = "http://foo"
auth = "admin:password"
}

provider "hsdp" {
region = "us-east"
}
4 changes: 0 additions & 4 deletions examples/default/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@ terraform {
source = "philips-software/hsdp"
version = ">= 0.17.0"
}
grafana = {
source = "grafana/grafana"
version = ">= 1.11.0"
}
}
}
36 changes: 0 additions & 36 deletions grafana.tf

This file was deleted.

3 changes: 1 addition & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
}

resource "random_id" "id" {
byte_length = 8
byte_length = 4
}

resource "random_password" "password" {
Expand Down Expand Up @@ -35,7 +35,6 @@ resource "cloudfoundry_app" "thanos" {
VARIANT_PROMETHEUS_CONFIG = "/sidecars/etc/prometheus.yml"
VARIANT_TENANTS = join(",", var.tenants)
VARIANT_RELOAD = "true"
PG_EXPORTERS = join(",", [module.grafana.grafana_database_metrics_endpoint])
}, var.environment)

dynamic "routes" {
Expand Down
34 changes: 2 additions & 32 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
locals {
grafana_endpoint = join("", module.grafana.*.grafana_endpoint)
}

output "cluster_id" {
description = "Cluster ID of Thanos deployment"
output "postfix" {
description = "Cluster ID / Postfix of Thanos deployment"
value = local.postfix
}

Expand Down Expand Up @@ -41,29 +37,3 @@ output "thanos_store_endpoint" {
description = "Internal only URL of Thanos store deployment"
value = "${cloudfoundry_route.thanos_store_internal.endpoint}:9090"
}

output "grafana_app_id" {
description = "App id for Grafana"
value = join("", module.grafana.*.grafana_id)
}

output "grafana_endpoint" {
description = "URL of Grafana deployment (optional)"
value = var.grafana_public_endpoints ? local.grafana_endpoint : "${local.grafana_endpoint}:3000"
}

output "grafana_auth" {
description = "The Grafana auth token to use for e.g. configuring Grafana provider"
value = local.grafana_auth
sensitive = true
}

output "grafana_username" {
description = "The Grafana username"
value = var.grafana_username
}

output "grafana_url" {
description = "The Grafana URL"
value = local.grafana_url
}
11 changes: 0 additions & 11 deletions providers.tf

This file was deleted.

29 changes: 0 additions & 29 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,12 @@ variable "thanos_public_endpoints" {
default = false
}

variable "grafana_username" {
description = "Grafana username"
type = string
default = "admin"
}

variable "grafana_password" {
description = "Grafana password"
type = string
}

variable "grafana_image" {
description = "Image to use for Grafana"
default = "grafana/grafana:8.0.4"
type = string
}

variable "grafana_public_endpoints" {
description = "Make Grafana public endpoint"
type = bool
default = true
}

variable "environment" {
type = map(any)
description = "Pass environment variable to the app"
default = {}
}

variable "grafana_environment" {
type = map(any)
description = "Pass environment variable to Grafana"
default = {}
}

variable "docker_username" {
type = string
description = "Docker registry username"
Expand Down
4 changes: 0 additions & 4 deletions terraform.tf → versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ terraform {
source = "philips-software/hsdp"
version = ">= 0.16.3"
}
grafana = {
source = "grafana/grafana"
version = ">= 1.11.0"
}
random = {
source = "random"
version = ">= 2.2.1"
Expand Down

0 comments on commit 3f0b331

Please sign in to comment.