Skip to content

Commit

Permalink
Automated Config Connector import.
Browse files Browse the repository at this point in the history
  - f35a02a185cac03b0326d4f5ed10514495b5c36f Add GKEHubFeatureMembership/GKEHubFeature samples for ser... by Config Connector Team <[email protected]>

GitOrigin-RevId: f35a02a185cac03b0326d4f5ed10514495b5c36f
  • Loading branch information
Config Connector Team authored and copybara-github committed Dec 12, 2022
1 parent 1bd18b9 commit e187c54
Show file tree
Hide file tree
Showing 19 changed files with 428 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: gkehub.cnrm.cloud.google.com/v1beta1
kind: GKEHubFeature
metadata:
name: gkehubfeature-sample-asm
spec:
projectRef:
name: gkehubfeature-dep-asm
location: global
# The resourceID must be "servicemesh" if you want to use Anthos Service Mesh feature.
resourceID: servicemesh

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
name: gkehubfeaturemembership-dep
name: gkehubfeature-dep-asm
spec:
name: Config Connector Sample
organizationRef:
Expand All @@ -24,3 +24,4 @@ spec:
billingAccountRef:
# Replace "${BILLING_ACCOUNT_ID?}" with the numeric ID for your billing account
external: "${BILLING_ACCOUNT_ID?}"

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/disable-dependent-services: "false"
name: gkehubfeature-dep-asm
spec:
resourceID: mesh.googleapis.com
projectRef:
name: gkehubfeature-dep-asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ apiVersion: container.cnrm.cloud.google.com/v1beta1
kind: ContainerCluster
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-acm
name: gkehubfeaturemembership-dep-acm
spec:
location: us-central1-a
initialNodeCount: 1
workloadIdentityConfig:
# Workload Identity supports only a single namespace based on your project name.
workloadPool: gkehubfeaturemembership-dep.svc.id.goog
workloadPool: gkehubfeaturemembership-dep-acm.svc.id.goog
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
apiVersion: gkehub.cnrm.cloud.google.com/v1beta1
kind: GKEHubFeature
metadata:
name: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep-acm
spec:
projectRef:
name: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep-acm
location: global
# The resourceID must be "configmanagement" if you want to use Anthos config
# management feature.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ metadata:
name: gkehubfeaturemembership-sample
spec:
projectRef:
name: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep-acm
location: global
membershipRef:
name: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep-acm
featureRef:
name: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep-acm
configmanagement:
configSync:
sourceFormat: unstructured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ apiVersion: gkehub.cnrm.cloud.google.com/v1beta1
kind: GKEHubMembership
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-acm
name: gkehubfeaturemembership-dep-acm
spec:
location: global
authority:
# Issuer must contain a link to a valid JWT issuer. Your ContainerCluster is one.
issuer: https://container.googleapis.com/v1/projects/gkehubfeaturemembership-dep/locations/us-central1-a/clusters/gkehubfeaturemembership-dep
issuer: https://container.googleapis.com/v1/projects/gkehubfeaturemembership-dep-acm/locations/us-central1-a/clusters/gkehubfeaturemembership-dep-acm
description: A sample GKE Hub membership
endpoint:
gkeCluster:
resourceRef:
name: gkehubfeaturemembership-dep
name: gkehubfeaturemembership-dep-acm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
name: gkehubfeaturemembership-dep-acm
spec:
name: Config Connector Sample
organizationRef:
# Replace "${ORG_ID?}" with the numeric ID for your organization
external: "${ORG_ID?}"
billingAccountRef:
# Replace "${BILLING_ACCOUNT_ID?}" with the numeric ID for your billing account
external: "${BILLING_ACCOUNT_ID?}"
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-acm
cnrm.cloud.google.com/disable-dependent-services: "false"
name: gkehubfeaturemembership-dep-1
name: gkehubfeaturemembership-dep1-acm1
spec:
resourceID: container.googleapis.com
---
apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-acm
cnrm.cloud.google.com/disable-dependent-services: "false"
name: gkehubfeaturemembership-dep-2
name: gkehubfeaturemembership-dep2-acm
spec:
resourceID: gkehub.googleapis.com
---
apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-acm
cnrm.cloud.google.com/disable-dependent-services: "false"
name: gkehubfeaturemembership-dep-3
name: gkehubfeaturemembership-dep3-acm
spec:
resourceID: anthosconfigmanagement.googleapis.com
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: container.cnrm.cloud.google.com/v1beta1
kind: ContainerCluster
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-asm
labels:
# Replace ${PROJECT_NUMBER?} with the number of the project once created,
# this will give you access to the ASM UI in the Google Cloud Console
mesh_id: proj-${PROJECT_NUMBER?}
name: gkehubfeaturemembership-dep-asm
spec:
location: us-east4-a
initialNodeCount: 1
workloadIdentityConfig:
workloadPool: gkehubfeaturemembership-dep-asm.svc.id.goog
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: gkehub.cnrm.cloud.google.com/v1beta1
kind: GKEHubFeature
metadata:
name: gkehubfeaturemembership-dep-asm
spec:
projectRef:
name: gkehubfeaturemembership-dep-asm
location: global
# The resourceID must be "servicemesh" if you want to use Anthos Service Mesh feature.
resourceID: servicemesh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: gkehub.cnrm.cloud.google.com/v1beta1
kind: GKEHubFeatureMembership
metadata:
name: gkehubfeaturemembership-sample-asm
spec:
projectRef:
name: gkehubfeaturemembership-dep-asm
location: global
membershipRef:
name: gkehubfeaturemembership-dep-asm
featureRef:
name: gkehubfeaturemembership-dep-asm
mesh:
management: MANAGEMENT_AUTOMATIC
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: gkehub.cnrm.cloud.google.com/v1beta1
kind: GKEHubMembership
metadata:
annotations:
cnrm.cloud.google.com/project-id: gkehubfeaturemembership-dep-asm
name: gkehubfeaturemembership-dep-asm
spec:
location: global
authority:
issuer: https://container.googleapis.com/v1/projects/gkehubfeaturemembership-dep-asm/locations/us-east4-a/clusters/gkehubfeaturemembership-dep-asm
endpoint:
gkeCluster:
resourceRef:
name: gkehubfeaturemembership-dep-asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
kind: Project
metadata:
name: gkehubfeaturemembership-dep-asm
spec:
name: Config Connector Sample
organizationRef:
# Replace "${ORG_ID?}" with the numeric ID for your organization
external: "${ORG_ID?}"
billingAccountRef:
# Replace "${BILLING_ACCOUNT_ID?}" with the numeric ID for your billing account
external: "${BILLING_ACCOUNT_ID?}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: serviceusage.cnrm.cloud.google.com/v1beta1
kind: Service
metadata:
annotations:
cnrm.cloud.google.com/disable-dependent-services: "false"
name: gkehubfeaturemembership-dep-asm
spec:
resourceID: mesh.googleapis.com
projectRef:
name: gkehubfeaturemembership-dep-asm
5 changes: 3 additions & 2 deletions config/tests/samples/create/samples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ var testDisabledList = map[string]bool{
// Disable these samples for now until ContainerCluster supports
// hierarchical references or once we support proper deletion ordering
// (b/179907721).
"gkehubfeaturemembership": true,
"multi-cluster-ingress-feature": true,
"config-management-feature-membership": true,
"service-mesh-feature-membership": true,
"multi-cluster-ingress-feature": true,
// There is a quota limit of only 10 FirewallPolicies globally in an org,
// these samples tests are omitted to minimize the number of FirewallPolicies created.
"computefirewallpolicy": true,
Expand Down
1 change: 1 addition & 0 deletions pkg/snippet/snippetgeneration/snippetgeneration.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ var preferredSampleForResource = map[string]string{
"dnsrecordset": "dns-a-record-set",
"folder": "folder-in-folder",
"gkehubfeature": "multi-cluster-ingress-feature",
"gkehubfeaturemembership": "config-management-feature-membership",
"iamauditconfig": "project-level-audit-config",
"iamcustomrole": "project-role",
"iampolicy": "external-project-level-policy",
Expand Down
Loading

0 comments on commit e187c54

Please sign in to comment.