You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: 5-hosted-resources/partA-config-connector.md
+11-3
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,12 @@ Expected output:
59
59
✅ Finished installing Config Connector on all clusters.
60
60
```
61
61
62
-
This script grants Config Connector (running in the GKE cluster) the IAM permissions it needs to create and update GCP resources in your project, and deploys Config Connector onto the cluster.
62
+
This script does the following:
63
+
1. Uninstalls Config Sync from the `cymbal-admin` cluster. (**Note** - currently a bug causes Config Sync and Config Connector to conflict with each other. In the future, you will be able to use Config Sync to deploy your Config Connector resources)
64
+
2. Grants Config Connector IAM permissions to lifecycle GCP resources in your project
65
+
3. Installs Config Connector on the `cymbal-admin` cluster.
66
+
67
+
grants Config Connector (running in the GKE cluster) the IAM permissions it needs to create and update GCP resources in your project, and deploys Config Connector onto the cluster.
63
68
64
69
### 5. **Verify that Config Connector is installed on the admin cluster.**
65
70
@@ -86,6 +91,7 @@ Let's start with a basic example of creating a GCP-hosted resource using Config
86
91

87
92
88
93
94
+
89
95
### 1. **View the GCE KRM resources.**
90
96
91
97
```
@@ -119,7 +125,7 @@ spec:
119
125
120
126
This KRM resource defines one Compute Engine instance, along with a Compute Disk and some networking resources. Notice how the KRM looks a lot like a Deployment YAML - it has a name, metadata with some labels, and a spec, with info specifically about a GCE instance. Config Connector knows how to read this `ComputeEngine` resource type, and take action on it - in this case, create a Compute Engine instance in our GCP project.
121
127
122
-
### 2. Apply the Compute Engine resources to the admin cluster. **⚠️ Note** - this demo shows applying the cloud-hosted KRM resources manually with kubectl, due to an ongoing bug between Config Sync and Config Connector. But in an ideal scenario, we use Config Sync to sync the Config Connector KRM just like we did policies.
128
+
### 2. Apply the Compute Engine resources to the admin cluster.
Note - it may take a few minutes for the resources to be created. In the meantime, you may see `UpdateFailed` or `DependencyNotReady`. This is expected.
156
162
157
-
### 4. **Open the Cloud Console and navigate to Compute Engine > VM Instances. Filter on `name:secadmin`. You should see the new GCE instance in the list.**
163
+
### 4. **Open the Cloud Console and navigate to [Compute Engine > VM Instances](https://console.cloud.google.com/compute/instances).
164
+
165
+
Filter on `name:secadmin`. You should see the new GCE instance in the list.**
### 2. **View the mock transaction dataset.** This is a 1000-line CSV file, whose fields mimic the data currently stored in the Cloud SQL `ledger_db` today.
### 3. **Verify that you have the gsutil tool installed** - this comes bundled with the gcloud command. [Install the tool](https://cloud.google.com/storage/docs/gsutil_install) if it's not in your PATH.
42
+
### 3. **Verify that you have the gsutil tool installed** - this comes bundled with the gcloud command.
43
+
44
+
[Install the tool](https://cloud.google.com/storage/docs/gsutil_install) if it's not in your PATH.
43
45
44
46
```
45
47
gsutil version
@@ -48,7 +50,7 @@ gsutil version
48
50
Expected output:
49
51
50
52
```
51
-
gsutil version: 4.61
53
+
gsutil version: 4.64
52
54
```
53
55
54
56
### 4. **Create a Cloud Storage bucket in your project, called `datasets`.**
@@ -60,7 +62,7 @@ gsutil mb -c standard gs://$PROJECT_ID-datasets
60
62
Expected output:
61
63
62
64
```
63
-
Creating gs://krm-test-5-datasets/...
65
+
Creating gs://krm-test11-datasets/...
64
66
```
65
67
66
68
### 5. **Upload the mock transaction data to Cloud Storage.**
@@ -189,14 +185,15 @@ Now let's come back to the restrictions we outlined at the beginning of this sec
189
185
190
186
This file defines a constraint template for `BigQueryDatasetAllowName`, and a constraint of type `BigQueryDatasetAllowName`, which together allow only one BigQuery dataset in the policy repo.
191
187
188
+
View the custom Constraint Template:
189
+
192
190
```
193
191
cat bigquery/constraint-template.yaml
194
-
cat bigquery/constraint.yaml
195
192
```
196
193
197
194
Expected output:
198
195
199
-
```
196
+
```YAML
200
197
apiVersion: templates.gatekeeper.sh/v1beta1
201
198
kind: ConstraintTemplate
202
199
metadata:
@@ -228,6 +225,24 @@ spec:
228
225
allowedName: cymbalmockdataset
229
226
```
230
227
228
+
View the Constraint, using the custom Constraint Template:
229
+
230
+
```
231
+
cat bigquery/constraint.yaml
232
+
```
233
+
234
+
Expected output:
235
+
236
+
```YAML
237
+
apiVersion: constraints.gatekeeper.sh/v1beta1
238
+
kind: BigQueryDatasetAllowName
239
+
metadata:
240
+
name: bigquery-allow-mock-only
241
+
spec:
242
+
parameters:
243
+
allowedName: cymbalmockdatase
244
+
```
245
+
231
246
### 12. **Apply the Constraint and Constraint Template** to the admin cluster.
Copy file name to clipboardexpand all lines: 5-hosted-resources/partC-existing-resources.md
+13-9
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,14 @@ config-connector version
14
14
Expected output:
15
15
16
16
```
17
-
1.46.0
17
+
1.53.0
18
18
```
19
19
20
20
### 2. **View the Cloud SQL KRM export script.**
21
21
22
-
This script generates static KRM resource files (YAML) for the Cloud SQL development database. (Although these steps only show KRM for the development DB, we could do the same for the staging and production databases as well.)
22
+
This script generates static KRM resource files (YAML) for the Cloud SQL development database.
23
+
24
+
**Note**: Although these steps only show KRM for the development DB, we could do the same for the staging and production databases as well.
23
25
24
26
```
25
27
cat cloudsql/generate-cloudsql-krm.sh
@@ -118,11 +120,12 @@ spec:
118
120
resourceID: ledger-db
119
121
```
120
122
121
-
These KRM files represent the live state of your Cloud SQL resources, originally created using Terraform. (You will see your PROJECT_ID next to `cnrm.cloud.google.com/project-id`.)
123
+
These KRM files represent the live state of your Cloud SQL resources, originally created using Terraform. (You should see your PROJECT_ID next to `cnrm.cloud.google.com/project-id`.)
122
124
123
125
### 5. **Apply the Cloud SQL KRM resources to the cymbal-admin cluster.**
### 7. **Open the Cloud Console and navigate to Cloud SQL**.
163
+
### 7. **Open the Cloud Console and [navigate to Cloud SQL](https://console.cloud.google.com/sql)**.
161
164
162
165
Notice how in the list, the `cymbal-dev` cluster now has a new label, `managed-by-cnrm: true`. This indicates that this SQL Instance is now under the management umbrella of Config Connector.
163
166
@@ -178,24 +181,25 @@ Notice how in the list, the `cymbal-dev` cluster now has a new label, `managed-b
178
181
179
182
## Wrap-up
180
183
181
-
If you made it this far, great work - you just completed several challenging demos that explored the Kubernetes Resource Model with multiple angles, developer personas, products, and tools.
184
+
If you made it this far, **great work**! You just completed several demos that explored the Kubernetes Resource Model with multiple developer personas, products, and tools in mind.
182
185
183
186
Let's summarize the key takeaways from all 5 demos:
184
187
185
188
-**Building a platform is hard**, especially in the cloud, especially when you have multiple Kubernetes clusters in play, on top of hosted resources.
186
-
-**KRM is one way to manage your Cloud and Kubernetes config**, but it's not the only way - Demo 1 showed us how to do it with Terraform.
187
189
- KRM is a great way to manage resources because Kubernetes is constantly running a **control loop** to make sure your **desired** state matches the **actual** cluster state. We saw this in action both for core Kubernetes API resources (Demo 2 / for instance, Deployments that keep Pods alive) and hosted Cloud resources (Demo 5 / via Config Connector)
188
190
-**KRM promotes a "GitOps" model** where you keep all your configuration in Git, and sync it down to multiple clusters at once.
189
191
- Policy Controller, together with Config Sync, allow you to impose custom policies on your KRM resources, both at deploy-time and during CI/CD (Demo 4). These **policies allow you to set fine-grained controls** on different resource types, to ensure compliance within your org.
190
192
-**KRM / the Kubernetes API can lifecycle resources that run outside a Kubernetes cluster.** We saw how Config Connector, running inside the admin cluster, created and updated resources in Google Cloud.
193
+
-**KRM is one way to manage your Cloud and Kubernetes resources**, but it's not the only way - for instance, we set up the initial demo environment with Terraform in part 1. The benefit of putting more and more resources in a KRM format is that you have a single language and toolchain for your infrastructure, in and outside of Kubernetes.
194
+
191
195
192
-
Hopefully you learned a thing or two from these demos- really, we've only just scratched the surface of what KRM can do. All the "learn more" links across Parts 1-5 are available in the [README of this repo](/README.md).
196
+
Hopefully you learned a thing or two from these demos- really, we've only just scratched the surface of what KRM can do.
193
197
194
-
And another set of resources to learn more about KRM, its design principles, and other helpful tools, see: **https://github.com/askmeegs/learn-krm**.
198
+
For a list of additional resources to learn the Kubernetes Resource Model, check out: **https://github.com/askmeegs/learn-krm**.
195
199
196
200
## ⭐️ We'd love your feedback! ⭐️
197
201
198
-
### 🗳 [If you have a moment, please fill out this short survey](https://forms.gle/pUX2DPW9fxgDMwEw8) to share your thoughts on this demo! Thank you!
202
+
### 🗳 [If you have a moment, please fill out this short survey](https://forms.gle/pUX2DPW9fxgDMwEw8) to share your thoughts on these demos. Thank you!
0 commit comments