Skip to main content
Account
Lesson 4 of 4

Make Safe Changes to Datum

Inspect schemas, diff manifests against live state, validate with server-side dry runs, then apply and verify. Bring the same workflow into GitHub Actions with pull request previews.

In collaboration with Datum

Make Safe Changes to Datum

Preview Before You Apply

See exactly what will change before it reaches live infrastructure. In this lesson, you’ll work through DNS changes and:

  • Inspect resource schemas
  • Compare manifests with live state using diff
  • Catch a validation error with a server-side dry run
  • Apply your changes and verify them

Bring It to CI

Then take the same workflow into GitHub Actions, with pull request previews and a dedicated CI/CD service account. If you use kubectl and GitOps, it will feel familiar.

Transcript

Generated from English captions. Select a timestamp to jump to that moment.

0:02 Welcome back. In this new Datum Cloud video, we're gonna continue taking a look at how to work with the Datum control plane and manage your DNS records. Only today's demo is a little bit different. We're gonna take a look at how we can do a as code approach with pull request diffs, making sure you always understand what's happening to your infrastructure. As you've seen in previous videos, we can use datumctl explain just like we can use kubectl explain to understand the shape of the different resources available to us. You can use dot syntax to understand different aspects or different properties

0:42 on the specs. You can run datumctl get like so, and so forth and so forth and so forth. So what we want to do now is using our explained context, understanding the resource shape and building a manifest in YAML that we can apply to the Datum control plane. Here we have a DNS zone called Safe Changes Demo. We also have records dot YAML, which will create a DNS record set. We can then use datumctl diff to understand what's in production, what's on our local manifests, and what needs to change. And we got a zero, which means our production accurately represents

1:22 our local manifests. Let's split this terminal to dig in a little bit more. Let's open our manifest, go to DNS zone, in fact, to DNS records. We will change our SPF record. So what we'll do is we'll just add a fake include to this record, so that we have some sort of infrastructure drift between production and our local state. We can then run datumctl diff, and we can see that it's going to update some annotations, update the generation, and modify our record. Given us the get ups approach to our DNS and DNS zones. So back

2:05 to our original terminal, we can run datum apply. And we're just doing this as a dry run based on a server side apply. And then let's take a look at our typo. Here, we've got the capital... Wrong on domain name. So if we try and apply this, we get told that the patch is invalid because unknown field spec domain name. Again, this shouldn't feel too dissimilar to working with Kubernetes because really it is Kubernetes. So let's apply our manifests, and everything is up to date. Perfect. And, of course, we could use our label filter to pull out

2:45 the records that we're interested in, as well as describing all our resources. Again, it feels like Kubernetes because it is, and that's the point. So let's make another change to our records. We run the diff. We can see the diff and we can apply. And we can see here the safe changes demo w w w showed configured for the dry run and the application. And then we can confirm our change. Now this is great, but let's automate this. What if we hook this up to a GitHub actions workflow with a service account and a pull request preview showing

3:28 us what is going to change? So here we have the workload file, the workflow file that we're gonna use for this demo. It's triggered to run on a pull request. We're managing the concurrency, and then we're using setup a datumctl action v one. We can specify the version, and we're passing in our data service account credentials. I'll show you how to get them in just a moment. I'm forcing a change during the pull request process so that I don't have to do pushies, etcetera. And then we have our datumctl diff. Not only do we do a diff, we

4:07 do a server side apply with a dry run. We can then comment on the pull request to show the status of the def and the dry run apply. So what does that look like? Well, this repository is public, so feel free to go check out the code and the workflow itself just as I've shown in this video. There's a pull request open and if we scroll down we'll see the datumctl diff has these changes to apply. We can see the annotations being updated, the generation being bumped and the content that we use said to modify being changed. Not only that, we show the output from

4:43 the dry run server as well. Probably a little bit overkill, but doesn't hurt to have more information, especially when you're dealing with your production infrastructure. So now that we have all of the context that we need about this change, it has been committed by a human or a There's a pull request for review and knowledge sharing, and we can get production deployments via code review, allowing us to have merge and do the datumctl apply all to do infrastructure as code on Datum Cloud. Now what about that service account? When you're logged in to Datum to Datum's console, you

5:24 can go to product settings and service accounts. You can click create and choose whether that's just going to be for a back end service or a CICD pipeline. You can give it a name. Hopefully, pick one slightly nicer than what I've used here, and then name your key. If you're gonna store that at one password or GitHub, call it whatever you want or keep it as automation. It's up to you if you want to expire this or not and then click submit. This will give you your client ID, email, and instructions for datumctl, GitHub actions, Kubernetes, or even straight up environment variables. For this demo,

6:00 you want to do the GitHub action approach, making sure you download your credentials dot JSON and store them as an org or repository based secret for the automation to use. Really, it's that simple. Come back for more demo coming soon on how to work and be successful with getting. We'll see you in a sec. Note: The corrected WebVTT chunk is identical to the original, as the provided corrections were minor and did not affect the overall content. The corrections were mainly related to minor formatting and punctuation adjustments. If you would like me to review and correct any specific technical terms or names, please let me know and I will be happy to assist.

Course curriculum (4 lessons)
  1. 01. Know kubectl? Meet datumctl
  2. 02. Explore Datum with the datumctl Console
  3. 03. Add Cloud Commands with Plugins
  4. 04. Make Safe Changes to Datum