Skip to content

Commit d2ec68c

Browse files
yliaogapeabody
andauthored
feat: added fleet scope logging (#26)
Co-authored-by: Andrew Peabody <[email protected]>
1 parent 2948189 commit d2ec68c

File tree

4 files changed

+50
-2
lines changed

4 files changed

+50
-2
lines changed

4-fleetscope/envs/development/main.tf

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ locals {
2020
namespace_ids = ["frontend", "accounts", "transactions"]
2121
}
2222

23+
import {
24+
id = "projects/${var.cluster_project_id}/locations/global/features/fleetobservability"
25+
to = module.env.google_gke_hub_feature.fleet-o11y
26+
}
27+
2328
module "env" {
2429
source = "../../modules/env_baseline"
2530

4-fleetscope/envs/non-production/main.tf

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
locals {
1818
env = "non-production"
1919

20-
namespace_ids = ["frontend"]
20+
namespace_ids = ["frontend", "accounts", "transactions"]
21+
}
22+
23+
import {
24+
id = "projects/${var.cluster_project_id}/locations/global/features/fleetobservability"
25+
to = module.env.google_gke_hub_feature.fleet-o11y
2126
}
2227

2328
module "env" {

4-fleetscope/envs/production/main.tf

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
locals {
1818
env = "production"
1919

20-
namespace_ids = ["frontend"]
20+
namespace_ids = ["frontend", "accounts", "transactions"]
21+
}
22+
23+
import {
24+
id = "projects/${var.cluster_project_id}/locations/global/features/fleetobservability"
25+
to = module.env.google_gke_hub_feature.fleet-o11y
2126
}
2227

2328
module "env" {
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
resource "google_gke_hub_feature" "fleet-o11y" {
18+
name = "fleetobservability"
19+
project = var.cluster_project_id
20+
location = "global"
21+
spec {
22+
fleetobservability {
23+
logging_config {
24+
default_config {
25+
mode = "COPY"
26+
}
27+
fleet_scope_logs_config {
28+
mode = "MOVE"
29+
}
30+
}
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)