 Hi, my name is Russ Savage, Director of Product Management here at Influx Data. And today I'm going to show you how to build a GitOps workflow using InfluxDB Cloud. So for those of you that don't know, InfluxDB is a time series platform for modern application builders. And this is where the GitOps workflow kind of comes into play. Modern application builders, and you all know this, love leveraging GitOps workflows for building out declarative statements about how a system should work and having the system automatically apply those changes in the Kubernetes world. That's obviously how a ton of that stuff works. And so we wanted to incorporate those ideas into InfluxDB and add that capability for application builders. And that's what I'm going to showcase today. So all systems must be described declaratively, right? You want to store all your configuration as code, manage everything with Git commands and version control, all of your changes need to be integrated and applied via a continuous integration or continuous deployment process. And your system should automatically maintain the declared state and alert on the variations in your system, right? And so all of these different tools and techniques kind of make up the foundations for the GitOps workflows that we're all familiar with. So how does that work in Influx data? And what kind of tools do we provide to enable these workflows? So InfluxDB has a bunch of different technologies incorporated into the platform that make GitOps workflows really easy to use. And so the first thing, we ship the command line interface built into our application but also as a separate standalone binary. And this is an easy way to build scripting against your Influx data APIs in the platform. So instead of having to manually manipulate curl commands and keep track of your tokens, command line interface can do that for you. So the next piece, part of the command line interface is configuration profiles. Configuration profiles make it super simple to switch between different instances of InfluxDB. So in this demo, you'll see how I can use it to switch between my local development InfluxDB instance as well as my cloud instance. We have a technology called InfluxDB templates, which it's a pre-configured set of resources to get you up and running to monitoring a specific technology quickly. So in this demo, I'm going to demonstrate using the Docker InfluxDB template, but there's over 40 different templates available in our Influx community repo. And you can find a link to that on our website. And then powering all of the template's work is something we like to call InfluxDB stacks. And really, the way to think about stacks is just an artifact for managing your InfluxDB templates. And what stacks allow you to do is maintain state and add, update, and remove resources over time as you build out these resources and these applications on the platform. So let's get into the demo since we only have a short amount of time here. This is a dashboard running on InfluxDB cloud and this is a Docker dashboard. So what this is doing is displaying a bunch of information collected from a Docker demon that's running on my local machine and I'm piping this up to cloud. Now what I want to do is make a change to this dashboard, right? And now normally, if I was just using kind of a standard process, I could come in and I could tweak and edit the name of this dashboard or I could delete a cell. And that would be great. But again, following those DevOps principles, those changes need to be applied into version control and deployed through automation. I'm going to show you how to set that up. So what we're going to do is build out a couple of scripts that help us automate the deployment of this system. So if I take a look at this setup. So this is a very simple batch script and there's a couple of iterations that we're going to go through during this demo. But really, all we're going to do in this batch script is leverage commands from the Influx CLI to actually set up a local instance of InfluxDB OSS. What we're going to do is we're going to actually initialize a new stack for our Docker dashboard, which I just showed you. We're going to then apply our stack to that local. We're going to apply that stack to our local instance. And we're going to check to make sure that everything went well, right? And when I talk about that Docker stack, that is actually maintained as a file in this repository. So again, everything that is represented in the UI can be represented as a simple text file and then changed from here and reapplied to our instance. So going back to our setup script, let's actually run that and see what happens. So right now I have a instance of InfluxDB locally on my machine that's running, but it's not configured to do anything yet. I'm just at the startup screen. I haven't actually set it up to do anything. So what this script is going to do is automatically set it up for me. So I'm going to run this setup script. What I should see is a little bit of information talking me through exactly what it's doing and saying that everything was set up successfully. So when I go back to my local instance and refresh, I get a message saying that it's already set up, which makes sense because that's what we just did. We log in with the username and password we put in the setup. Again, this is local development. So it's a pretty basic, basic password. And I can see I've got the same instance here. And actually when I look at my dashboard, I have the same configuration in my dashboard. But of course, I don't have any data flowing into my local instance. And so you don't see anything. But flowing data into local instances is pretty straightforward as well. So let's get that running with a simple telegraph script. So telegraph is a data collection agent that we open source data collection agent that we maintain at Influx data. And what's really awesome is on our Influx DB cloud, you can actually store your telegraph configurations and fetch that information remotely. And so baked into this Influx DB template is a pre-configured telegraph installation running as stored in my instance. And I can actually fetch that remotely using scripts and start my telegraph to push data into my instance. So in this case, I'm going to start telegraph. And what this is going to do is actually go into my instance, find my token, find more organization, find the telegraph instance, and find the URL, and actually spin up a telegraph writing data into my system. So now, if I jump back to my local instance and hit refresh, I should see data flowing in. And so what I've done so far is I've actually recreated my production cloud account locally on my machine without making any changes, which is awesome. So we've started with a very simple setup script. Now let's start to incorporate some more advanced techniques to help you deploy this into an actual CI CD pipeline. So the next version of our script is going to look a little bit different. But fundamentally, it's going to do the same thing. But what we're going to do is we're going to layer in configuration profiles into our process. And so in this case, if we look at the bottom here, I've got the same sort of process for applying the stack. I've got the same sort of process for creating the stack. So I look for an existing stack. I initialize the stack, all of those sort of things. But then in my setup here, I'm actually leveraging configuration profiles to check whether I'm connected to my local instance of my database, which is really useful for debugging and testing. Or I can actually set it up to connect to my remote instance as long as I configure the profile. So in this case, what I expect to happen is I can run this version of the setup script. And now I can pass in the configuration profile that I want. And if I don't have a configuration profile set up, it'll complain about that it's not there. So in this case, if I type in a prod, it tells me that there's no configuration profile found. My configuration profiles can be found just using influx config list. You can see that I've only got one configuration profile, which is my local instance. I could configure this to set up to go to my remote instance. But the reason we're actually setting up these configuration profiles in general is when we set up a CI CD pipeline, what we want to do is we want to leverage secrets to actually send that data directly to create that profile on the fly and actually connect to the cloud instance behind the scenes. And so if we jump to version three of this script, again, we've built this up over time. But it's starting to get a little complicated as these scripts start to do. But this is, again, essentially the same process. But in this case, I'm actually looking for configuration profile or environment variables that are actually being set. And I can dynamically create that configuration profile on the fly and then push the results into whichever influx DB instance I want. So why are we talking about configuration profiles? What are we doing? Well, so the whole point of this process is to get into a world of continuous delivery, continuous integration. And GitHub has a really awesome capability now called Github Actions, which let you actually set all of this stuff up. So when I jump into the actual actions and the workflows, I've actually configured this to have a deploy to cloud workflow. And if I view that workflow file, what's awesome is I can actually set these secrets in my GitHub repository. And this is a public repository, but you guys can't see any of my secrets. But I can reference those in my script. And so what this CI CD process is going to do is actually grab my token, grab my org, grab my URL, and then run that same setup script with those credentials and create that connection into my cloud instance, then actually deploy my changes. And let's see what that actually looks like. So I mentioned before that I wanted to make some changes to this dashboard. So I've renamed it here. But in this case, maybe I want to remove this note because it's not very interesting. So what I'm going to do is I'm going to go into my manifest file that has all of the definitions of all of my dashboards. I'm going to find the note that I'm looking for. And so in this case, this is a note that this dashboard gives me an overview. Yeah, I already know that, so I don't really need it. I'm actually just going to delete that whole chart, make a save. And what I'm going to do is test this against my local instance. So what I'll do is I'll run my final influx setup script, and that will go against my local instance. And let me check to make sure that my changes were actually deployed in my local instance. If I refresh, I should see this note disappear, which is awesome. So it's no longer there. This is my local instance. So I know that the change is good. So let's go ahead and check that change into GitHub and see if it gets deployed automatically to the cloud instance. So I'm going to do my get status. I'm going to add my Docker file. I'm going to commit it. Always type in those good messages there. And then I'm going to push my changes. So my changes have gone up into my GitHub repository. So let's take a look. So I've got my last change is my remove note. And now if I look into my actions, let's see what's happening. You can see that I've actually kicked off an automatic workflow in GitHub. And this is in the process of actually deploying it into my cloud instance. And it usually only takes a few seconds here. So let's see. Oh, it looks like it did. And now let's go back and refresh this page and see what's going on. So I refresh this page. And I can see that my note has actually disappeared. And so I know that my changes have actually gone through. I can see that this was last modified a few seconds ago, which is awesome. So again, just to recap what we did there, InfluxDB, it's designed to fit into your GitOps workflows that you know and love. We leverage the CLI as a powerful tool for building out scripts for automation. InfluxDB templates, stacks, config profiles, all allow you to connect to different instances, maintain resources in state, and helps you build these automation processes into your CI CD pipelines. Next steps, our InfluxDB cloud is free. So jump in there, sign up for an account, and you can run this demo yourself. As you saw, the demo is all live in my GitHub repository. And come connect with us on Slack or GitHub. GitHub, we're in there all the time looking for new users. So come join us and let us know what you think. Thank you. Thanks for joining this session, and I hope to chat with you soon.