Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example for Config Sync auto-upgrades into google_gkehub_feature_membership resource doc #11684

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ description: |-

Contains information about a GKEHub Feature Memberships. Feature Memberships configure GKEHub Features that apply to specific memberships rather than the project as a whole. The google_gke_hub is the Fleet API.

## Example Usage - Config Management
## Example Usage - Config Management with Config Sync auto-upgrades and without Git/OCI

With [Config Sync auto-upgrades](https://cloud.devsite.corp.google.com/kubernetes-engine/enterprise/config-sync/docs/how-to/upgrade-config-sync#auto-upgrade-config), Google assumes responsibility for automatically upgrading Config Sync versions
and overseeing the lifecycle of its components.

```hcl
resource "google_container_cluster" "cluster" {
Expand Down Expand Up @@ -40,17 +43,20 @@ resource "google_gke_hub_feature_membership" "feature_member" {
feature = google_gke_hub_feature.feature.name
membership = google_gke_hub_membership.membership.membership_id
configmanagement {
version = "1.19.0"
# Don't use the `version` field with Config Sync auto-upgrades.
# To disable Config Sync auto-upgrades, you need to set the field `management` to
# `MANAGEMENT_MANUAL` if it has been set previously. Removing the field does not work.
management= "MANAGEMENT_AUTOMATIC"
config_sync {
# The field `enabled` was introduced in Terraform version 5.41.0, and
# needs to be set to `true` explicitly to install Config Sync.
enabled = true
git {
sync_repo = "https://github.com/hashicorp/terraform"
}
}
}
}
```
## Example Usage - Config Management with OCI

## Example Usage - Config Management with Git

```hcl
resource "google_container_cluster" "cluster" {
Expand Down Expand Up @@ -85,31 +91,15 @@ resource "google_gke_hub_feature_membership" "feature_member" {
version = "1.19.0"
config_sync {
enabled = true
oci {
sync_repo = "us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest"
policy_dir = "config-connector"
sync_wait_secs = "20"
secret_type = "gcpserviceaccount"
gcp_service_account_email = "[email protected]"
git {
sync_repo = "https://github.com/hashicorp/terraform"
}
}
}
}
```

## Example Usage - Multi Cluster Service Discovery

```hcl
resource "google_gke_hub_feature" "feature" {
name = "multiclusterservicediscovery"
location = "global"
labels = {
foo = "bar"
}
}
```

## Example Usage - Service Mesh
## Example Usage - Config Management with OCI

```hcl
resource "google_container_cluster" "cluster" {
Expand All @@ -128,16 +118,30 @@ resource "google_gke_hub_membership" "membership" {
}

resource "google_gke_hub_feature" "feature" {
name = "servicemesh"
name = "configmanagement"
location = "global"

labels = {
foo = "bar"
}
}

resource "google_gke_hub_feature_membership" "feature_member" {
location = "global"
feature = google_gke_hub_feature.feature.name
membership = google_gke_hub_membership.membership.membership_id
mesh {
management = "MANAGEMENT_AUTOMATIC"
configmanagement {
version = "1.19.0"
config_sync {
enabled = true
oci {
sync_repo = "us-central1-docker.pkg.dev/sample-project/config-repo/config-sync-gke:latest"
policy_dir = "config-connector"
sync_wait_secs = "20"
secret_type = "gcpserviceaccount"
gcp_service_account_email = "[email protected]"
}
}
}
}
```
Expand Down Expand Up @@ -187,6 +191,51 @@ resource "google_gke_hub_feature_membership" "feature_member" {
}
```

## Example Usage - Multi Cluster Service Discovery

```hcl
resource "google_gke_hub_feature" "feature" {
name = "multiclusterservicediscovery"
location = "global"
labels = {
foo = "bar"
}
}
```

## Example Usage - Service Mesh

```hcl
resource "google_container_cluster" "cluster" {
name = "my-cluster"
location = "us-central1-a"
initial_node_count = 1
}

resource "google_gke_hub_membership" "membership" {
membership_id = "my-membership"
endpoint {
gke_cluster {
resource_link = "//container.googleapis.com/${google_container_cluster.cluster.id}"
}
}
}

resource "google_gke_hub_feature" "feature" {
name = "servicemesh"
location = "global"
}

resource "google_gke_hub_feature_membership" "feature_member" {
location = "global"
feature = google_gke_hub_feature.feature.name
membership = google_gke_hub_membership.membership.membership_id
mesh {
management = "MANAGEMENT_AUTOMATIC"
}
}
```

## Example Usage - Policy Controller with minimal configuration

```hcl
Expand Down
Loading