Skip to content

Commit

Permalink
Generate new 'setup-sumologic.yaml.tmpl'
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed Jun 4, 2020
1 parent 3a244bf commit 6d1b64c
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions deploy/kubernetes/setup-sumologic.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ data:

# Sumo Collector and HTTP sources
terraform import sumologic_collector.collector "$COLLECTOR_NAME"

terraform import sumologic_http_source.default_events_source "$COLLECTOR_NAME/events"
terraform import sumologic_http_source.default_logs_source "$COLLECTOR_NAME/logs"
terraform import sumologic_http_source.apiserver_metrics_source "$COLLECTOR_NAME/apiserver-metrics"
terraform import sumologic_http_source.control_plane_metrics_source "$COLLECTOR_NAME/control-plane-metrics"
terraform import sumologic_http_source.controller_metrics_source "$COLLECTOR_NAME/kube-controller-manager-metrics"
Expand All @@ -42,8 +43,6 @@ data:
terraform import sumologic_http_source.node_metrics_source "$COLLECTOR_NAME/node-exporter-metrics"
terraform import sumologic_http_source.scheduler_metrics_source "$COLLECTOR_NAME/kube-scheduler-metrics"
terraform import sumologic_http_source.state_metrics_source "$COLLECTOR_NAME/kube-state-metrics"
terraform import sumologic_http_source.logs_source "$COLLECTOR_NAME/logs"
terraform import sumologic_http_source.events_source "$COLLECTOR_NAME/events"


# Kubernetes Namespace and Secret
Expand All @@ -67,6 +66,8 @@ data:
}

locals {
default_events_source = "events"
default_logs_source = "logs"
apiserver_metrics_source = "apiserver-metrics"
control_plane_metrics_source = "control-plane-metrics"
controller_metrics_source = "kube-controller-manager-metrics"
Expand All @@ -75,8 +76,6 @@ data:
node_metrics_source = "node-exporter-metrics"
scheduler_metrics_source = "kube-scheduler-metrics"
state_metrics_source = "kube-state-metrics"
logs_source = "logs"
events_source = "events"
}

provider "sumologic" {}
Expand All @@ -88,6 +87,17 @@ data:
}
}

resource "sumologic_http_source" "default_events_source" {
name = local.default_events_source
collector_id = "${sumologic_collector.collector.id}"
category = "${var.cluster_name}/${local.default_events_source}"
}

resource "sumologic_http_source" "default_logs_source" {
name = local.default_logs_source
collector_id = "${sumologic_collector.collector.id}"
}

resource "sumologic_http_source" "apiserver_metrics_source" {
name = local.apiserver_metrics_source
collector_id = "${sumologic_collector.collector.id}"
Expand Down Expand Up @@ -127,17 +137,6 @@ data:
name = local.state_metrics_source
collector_id = "${sumologic_collector.collector.id}"
}

resource "sumologic_http_source" "logs_source" {
name = local.logs_source
collector_id = "${sumologic_collector.collector.id}"
}

resource "sumologic_http_source" "events_source" {
name = local.events_source
collector_id = "${sumologic_collector.collector.id}"
category = "${var.cluster_name}/${local.events_source}"
}

provider "kubernetes" {

Expand All @@ -159,6 +158,8 @@ data:
}

data = {
endpoint-events = "${sumologic_http_source.default_events_source.url}"
endpoint-logs = "${sumologic_http_source.default_logs_source.url}"
endpoint-metrics-apiserver = "${sumologic_http_source.apiserver_metrics_source.url}"
endpoint-control_plane_metrics_source = "${sumologic_http_source.control_plane_metrics_source.url}"
endpoint-metrics-kube-controller-manager = "${sumologic_http_source.controller_metrics_source.url}"
Expand All @@ -167,8 +168,6 @@ data:
endpoint-metrics-node-exporter = "${sumologic_http_source.node_metrics_source.url}"
endpoint-metrics-kube-scheduler = "${sumologic_http_source.scheduler_metrics_source.url}"
endpoint-metrics-kube-state = "${sumologic_http_source.state_metrics_source.url}"
endpoint-logs = "${sumologic_http_source.logs_source.url}"
endpoint-events = "${sumologic_http_source.events_source.url}"
}

type = "Opaque"
Expand Down

0 comments on commit 6d1b64c

Please sign in to comment.