-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update samples and user guide for version 0.0.9
- Loading branch information
Michael Kibbe
committed
Aug 8, 2019
1 parent
b3e7523
commit 863de74
Showing
34 changed files
with
277 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
apps/musicians/manifests/overlays/prod/cloud-sql-user.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Copyright 2019 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 | ||
# | ||
# https://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: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLUser | ||
metadata: | ||
name: root | ||
spec: | ||
instanceRef: | ||
name: musicians-demo-prod | ||
host: "%" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
resources/computefirewall/deny-rule/compute_v1alpha1_computefirewall.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: compute.cnrm.cloud.google.com/v1alpha1 | ||
kind: ComputeFirewall | ||
metadata: | ||
labels: | ||
label-one: "value-one" | ||
name: computefirewall-deny-sample | ||
spec: | ||
deny: | ||
- protocol: icmp | ||
networkRef: | ||
name: computefirewall-dep |
7 changes: 7 additions & 0 deletions
7
resources/computefirewall/deny-rule/compute_v1alpha1_computenetwork.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: compute.cnrm.cloud.google.com/v1alpha1 | ||
kind: ComputeNetwork | ||
metadata: | ||
name: computefirewall-dep | ||
spec: | ||
routingMode: REGIONAL | ||
autoCreateSubnetworks: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ metadata: | |
name: computehealthcheck-sample | ||
spec: | ||
checkIntervalSec: 10 | ||
type: HTTP | ||
httpHealthCheck: | ||
port: 80 |
7 changes: 7 additions & 0 deletions
7
resources/computesubnetwork/compute_v1alpha1_computenetwork.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: compute.cnrm.cloud.google.com/v1alpha1 | ||
kind: ComputeNetwork | ||
metadata: | ||
name: computesubnetwork-dep | ||
spec: | ||
routingMode: REGIONAL | ||
autoCreateSubnetworks: false |
18 changes: 18 additions & 0 deletions
18
resources/computesubnetwork/compute_v1alpha1_computesubnetwork.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: compute.cnrm.cloud.google.com/v1alpha1 | ||
kind: ComputeSubnetwork | ||
metadata: | ||
labels: | ||
label-one: "value-one" | ||
name: computesubnetwork-sample | ||
spec: | ||
ipCidrRange: 10.2.0.0/16 | ||
region: us-central1 | ||
description: My subnet | ||
enableFlowLogs: true | ||
privateIpGoogleAccess: false | ||
networkRef: | ||
name: computesubnetwork-dep | ||
logConfig: | ||
aggregationInterval: INTERVAL_10_MIN | ||
flowSampling: "0.5" | ||
metadata: INCLUDE_ALL_METADATA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
resources/iampolicy/project-level/iam_v1alpha1_iampolicy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# **WARNING**: The bindings here represent the full declarative intent for the project. | ||
# It will fully overwrite the existing policy on the given project. | ||
# | ||
# This sample assumes the following additional APIs are enabled: | ||
# - compute.googleapis.com | ||
# - container.googleapis.com | ||
# - containerregistry.googleapis.com | ||
# - redis.googleapis.com | ||
# | ||
# Replace [PROJECT_ID], [PROJECT_NUMBER], and [ACCOUNT] with your desired project ID, | ||
# that project's project number, and your Google Cloud account email respectively. | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMPolicy | ||
metadata: | ||
labels: | ||
label-one: value-one | ||
name: iampolicy-project-level-sample | ||
spec: | ||
resourceRef: | ||
kind: Project | ||
name: [PROJECT_ID] | ||
bindings: | ||
- members: | ||
- serviceAccount:service-[PROJECT_NUMBER]@compute-system.iam.gserviceaccount.com | ||
role: roles/compute.serviceAgent | ||
- members: | ||
- serviceAccount:service-[PROJECT_NUMBER]@container-engine-robot.iam.gserviceaccount.com | ||
role: roles/container.serviceAgent | ||
- members: | ||
- serviceAccount:[PROJECT_NUMBER][email protected] | ||
- serviceAccount:[PROJECT_NUMBER]@cloudservices.gserviceaccount.com | ||
- serviceAccount:cnrm-application-demo@[PROJECT_ID].iam.gserviceaccount.com | ||
- serviceAccount:service-[PROJECT_NUMBER]@containerregistry.iam.gserviceaccount.com | ||
role: roles/editor | ||
- members: | ||
# Make sure to keep the "cnrm-system" service account permission, or else KCC will | ||
# be locked out from managing GCP resources. | ||
- serviceAccount:cnrm-system@[PROJECT_ID].iam.gserviceaccount.com | ||
# Ensure that your account is not locked out of the project. | ||
- user:[ACCOUNT] | ||
role: roles/owner | ||
- members: | ||
- serviceAccount:service-[PROJECT_NUMBER]@cloud-redis.iam.gserviceaccount.com | ||
role: roles/redis.serviceAgent | ||
- members: | ||
- serviceAccount:cnrm-system@[PROJECT_ID].iam.gserviceaccount.com | ||
role: roles/storage.admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,14 @@ kind: IAMPolicy | |
metadata: | ||
labels: | ||
label-one: value-one | ||
name: iampolicy-sample | ||
name: iampolicy-pubsubtopic-admin-sample | ||
spec: | ||
resourceRef: | ||
apiVersion: pubsub.cnrm.cloud.google.com/v1alpha2 | ||
kind: PubSubTopic | ||
name: iampolicy-dep | ||
bindings: | ||
- role: roles/pubsub.admin | ||
- role: roles/editor | ||
members: | ||
- user:[email protected] | ||
# replace ${PROJECT_NAME?} with your project name | ||
- serviceAccount:iampolicy-dep@${PROJECT_NAME?}.iam.gserviceaccount.com |
4 changes: 4 additions & 0 deletions
4
resources/iampolicy/pubsub-admin/iam_v1alpha1_iamserviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMServiceAccount | ||
metadata: | ||
name: iampolicy-dep |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
resources/iampolicy/workload-identity/iam_v1alpha1_iampolicy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMPolicy | ||
metadata: | ||
name: iampolicy-workload-identity-sample | ||
spec: | ||
resourceRef: | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMServiceAccount | ||
name: iampolicy-gsa-dep | ||
bindings: | ||
- role: roles/iam.workloadIdentityUser | ||
members: | ||
# replace ${PROJECT_NAME?} with your project name | ||
- serviceAccount:${PROJECT_NAME?}.svc.id.goog[default/iampolicy-ksa-dep] |
6 changes: 6 additions & 0 deletions
6
resources/iampolicy/workload-identity/iam_v1alpha1_iamserviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMServiceAccount | ||
metadata: | ||
name: iampolicy-gsa-dep | ||
spec: | ||
displayName: Example Service Account |
7 changes: 7 additions & 0 deletions
7
resources/iampolicy/workload-identity/kubernetes_service_account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: iampolicy-ksa-dep | ||
annotations: | ||
# replace ${PROJECT_NAME?} with your project name | ||
iam.gke.io/gcp-service-account: iampolicy-gsa-dep@${project_name?}.iam.gserviceaccount.com |
4 changes: 4 additions & 0 deletions
4
resources/iamserviceaccountkey/iam_v1alpha1_iamserviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMServiceAccount | ||
metadata: | ||
name: iamserviceaccountkey-dep |
12 changes: 12 additions & 0 deletions
12
resources/iamserviceaccountkey/iam_v1alpha1_iamserviceaccountkey.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: iam.cnrm.cloud.google.com/v1alpha1 | ||
kind: IAMServiceAccountKey | ||
metadata: | ||
name: key-sample | ||
labels: | ||
label-one: "value-one" | ||
spec: | ||
publicKeyType: TYPE_X509_PEM_FILE | ||
keyAlgorithm: KEY_ALG_RSA_2048 | ||
privateKeyType: TYPE_GOOGLE_CREDENTIALS_FILE | ||
serviceAccountRef: | ||
name: iamserviceaccountkey-dep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha2 | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: sqldatabase-dep | ||
spec: | ||
region: us-central1 | ||
databaseVersion: MYSQL_5_7 | ||
settings: | ||
tier: db-n1-standard-1 |
2 changes: 1 addition & 1 deletion
2
...sqldatabase/sql_v1alpha2_sqldatabase.yaml → ...sqldatabase/sql_v1alpha3_sqldatabase.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
resources/sqlinstance/mysql-sql-instance-with-replication/sql_v1alpha3_sqlinstance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: mysql-instance-sample-with-replication-primary | ||
spec: | ||
databaseVersion: MYSQL_5_7 | ||
region: us-central1 | ||
settings: | ||
tier: db-f1-micro | ||
backupConfiguration: | ||
binaryLogEnabled: true | ||
enabled: true | ||
startTime: "18:00" | ||
ipConfiguration: | ||
requireSsl: true | ||
locationPreference: | ||
zone: us-central1-b | ||
--- | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: mysql-instance-sample-with-replication-secondary | ||
spec: | ||
databaseVersion: MYSQL_5_7 | ||
region: us-central1 | ||
masterInstanceRef: | ||
name: mysql-instance-sample-with-replication-primary | ||
replicaConfiguration: | ||
connectRetryInterval: 30 | ||
settings: | ||
tier: db-f1-micro | ||
ipConfiguration: | ||
requireSsl: true | ||
locationPreference: | ||
zone: us-central1-c |
9 changes: 9 additions & 0 deletions
9
resources/sqlinstance/mysql-sql-instance-with-sql-user/sql_v1alpha3_sqlinstance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: mysql-instance-sample-with-sql-user | ||
spec: | ||
databaseVersion: MYSQL_5_7 | ||
region: us-central1 | ||
settings: | ||
tier: db-f1-micro |
12 changes: 12 additions & 0 deletions
12
resources/sqlinstance/mysql-sql-instance-with-sql-user/sql_v1alpha3_sqluser.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLUser | ||
metadata: | ||
name: sqluser-sample | ||
spec: | ||
instanceRef: | ||
name: mysql-instance-sample-with-sql-user | ||
host: "%" | ||
password: change-me | ||
# after running this sample, you can verify that sql instance can be accessed | ||
# with user credentials by running from cloud shell: | ||
# gcloud sql connect mysql-instance-sample-with-sql-user --user=sqluser-sample |
8 changes: 8 additions & 0 deletions
8
resources/sqlinstance/mysql-sql-instance/sql_v1alpha3_sqlinstance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: mysql-instance-sample | ||
spec: | ||
databaseVersion: MYSQL_5_7 | ||
settings: | ||
tier: db-f1-micro |
10 changes: 10 additions & 0 deletions
10
resources/sqlinstance/postgres-sql-instance-high-availability/sql_v1alpha3_sqlinstance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: postgres-sql-instance-ha-sample | ||
spec: | ||
databaseVersion: POSTGRES_9_6 | ||
region: us-central1 | ||
settings: | ||
tier: db-custom-1-3840 | ||
availabilityType: REGIONAL |
8 changes: 8 additions & 0 deletions
8
resources/sqlinstance/postgres-sql-instance/sql_v1alpha3_sqlinstance.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: sql.cnrm.cloud.google.com/v1alpha3 | ||
kind: SQLInstance | ||
metadata: | ||
name: postgres-sql-instance-sample | ||
spec: | ||
databaseVersion: POSTGRES_9_6 | ||
settings: | ||
tier: db-custom-16-61440 # see https://cloud.google.com/sql/docs/postgres/create-instance |
Oops, something went wrong.