88author : jsilvela
99tags :
1010 - blog
11+ - tutorial
1112 - migrations
1213 - devops
1314summary : Doing schema migrations on CloudNativePG clusters using the Atlas operator
@@ -78,7 +79,7 @@ To apply a migration, we need credentials to access our target database.
7879The Atlas operator quickstart uses the ` urlFrom `
7980stanza, but with CloudNativePG there is a more convenient way.
8081
81- From Step 0, we assumed we have a CloudNativePG cluster called
82+ From Step 0, we have assumed we have a CloudNativePG cluster called
8283` cluster-example ` .
8384CloudNativePG, by default, creates a database called ` app ` on clusters, and
8485a user ` app ` whose credentials are held in a Secret called
@@ -89,12 +90,13 @@ a user `app` whose credentials are held in a Secret called
8990cluster-example-app kubernetes.io/basic-auth 9 18h
9091```
9192
92- You can inspect the contents of the secret running ` kubectl get secrets cluster-example-app -o yaml ` ,
93+ You can inspect the contents of the secret running
94+ ` kubectl get secrets cluster-example-app -o yaml ` ,
9395and you will find that it contains a key called ` password ` , holding of course
9496the password for the ` app ` user (base64 encoded).
9597In addition to the ` cluster-example-app ` Secret, the CloudNativePG operator
9698creates Services for Postgres. In particular, we will want to use the ReadWrite
97- service called ` cluster-example-rw ` for the migrations.
99+ service, called ` cluster-example-rw ` , for the migrations.
98100
99101We're going to use the [ ` credentials ` object] ( https://atlasgo.io/integrations/kubernetes/declarative#credentials-object )
100102from the AtlasSchema CRD to reference
@@ -131,7 +133,7 @@ spec:
131133
132134Then apply it: ` kubectl apply -f atlas-schema.yaml`.
133135
134- You should soon be able to see the Schema has been applied :
136+ In a few seconds, you should be able to see the Schema has been reconciled :
135137
136138` ` ` console
137139> kubectl get atlasschemas.db.atlasgo.io
@@ -175,17 +177,17 @@ transactions, perhaps maps using PostGIS, etc.
175177
176178Application developers will regularly need to add functionality, and often
177179that will involve creating new tables, schemas, procedures, indexes, perhaps
178- doing some INSERT statements to populate static data, etc.
180+ doing some ` INSERT` statements to populate static data, etc.
179181The developers will be using a development database, probably hosted in their
180182dev machines.
181183There might be another database for the purpose of automated testing, and
182184of course there's the production database, where the changes will need to be
183185applied in the end. These different databases will have different data in them,
184186and different loads.
185187Add time and other developers, and you have a big chance for snafus of the type
186- " but it worked on my machine!"
188+ * "but it worked on my machine!"*
187189
188- Database migration tools manage this, bringing DevOps to this area of data .
190+ Database migration tools manage this, bringing DevOps to this area of databases .
189191Atlas, by working as a Kubernetes operator, makes the dev/prod transition even
190192smoother.
191193
0 commit comments