Skip to content

Commit bea1926

Browse files
authored
feat(gke): add config_sync (fleet) example (#793)
1 parent f248b0d commit bea1926

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright 2024-2025 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+
# [START gke_enterprise_config_sync_git]
18+
resource "google_gke_hub_feature" "default" {
19+
name = "configmanagement"
20+
location = "global"
21+
22+
fleet_default_member_config {
23+
configmanagement {
24+
config_sync {
25+
# The field `enabled` was introduced in Terraform version 5.41.0, and
26+
# needs to be set to `true` explicitly to install Config Sync.
27+
enabled = true
28+
git {
29+
sync_repo = "REPO"
30+
sync_branch = "BRANCH"
31+
policy_dir = "DIRECTORY"
32+
secret_type = "SECRET"
33+
}
34+
}
35+
}
36+
}
37+
}
38+
# [END gke_enterprise_config_sync_git]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2024-2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# The kubernetes_manifest resource can only be used with pre-existing clusters.
16+
apiVersion: blueprints.cloud.google.com/v1alpha1
17+
kind: BlueprintTest
18+
metadata:
19+
name: config_sync_git
20+
spec:
21+
skip: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Copyright 2024-2025 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+
# [START gke_enterprise_config_sync_oci]
18+
resource "google_gke_hub_feature" "configmanagement_feature_member" {
19+
name = "configmanagement"
20+
location = "global"
21+
22+
fleet_default_member_config {
23+
configmanagement {
24+
config_sync {
25+
# The field `enabled` was introduced in Terraform version 5.41.0, and
26+
# needs to be set to `true` explicitly to install Config Sync.
27+
enabled = true
28+
oci {
29+
sync_repo = "REPO"
30+
policy_dir = "DIRECTORY"
31+
secret_type = "SECRET"
32+
}
33+
}
34+
}
35+
}
36+
}
37+
# [END gke_enterprise_config_sync_oci]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2024-2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# The kubernetes_manifest resource can only be used with pre-existing clusters.
16+
apiVersion: blueprints.cloud.google.com/v1alpha1
17+
kind: BlueprintTest
18+
metadata:
19+
name: config_sync_oci
20+
spec:
21+
skip: true

0 commit comments

Comments
 (0)