Products and Services
The course is part of these learning pathsSee 4 more
There are a lot of different options, across a variety of cloud platforms that are well suited for running specific workloads, such as web applications. Things such as Google App Engine, AWS Elastic Beanstalk, Azure App Services: Web Apps, among others.
However, there are still plenty of times where we need to set up our own infrastructure. And so cloud vendors offer IaaS (infrastructure as a service) options. Google provides us with Compute Engine which allows us to create virtual machines, custom images, snapshots, networks, auto-scalers and load balancers.
If we're going to create and implement an application on the Google Cloud Platform system operations, then understanding these services are going to help us to create highly available, highly scalable applications.
All the major cloud providers offer the ability to set up virtual machines, networks, auto-scalers, and load balancers. Where the Google Cloud is different is in the speed of creating and starting up virtual machine instances. As well as the massively scalable software-based, global load balancer; which doesn't require pre-warming. Google also offers per-minute billing for VM instances, after the first 10 minutes.
So Google has a lot to offer. And if you're looking to learn more about the Google Cloud systems operations, then this may be the course for you.
What exactly will we cover in this course?
Course Objectives: Google Cloud Platform system operations
By the end of this course, you'll know:
How to use Compute Engine to create virtual machines
How to create disk snapshots
How to create images
How to create instance templates and groups
How to create networks
How to use the auto-scaler and load balancer
This is an intermediate level course because it assumes:
You have at least a basic understanding of the cloud
You’re at least familiar with general IT concepts
What You'll Learn
Summary A review of the course
|Lecture||What you'll learn|
|Intro||What will be covered in this course|
|Getting Started||An introduction to the Google Cloud Platform|
|Networking||How to create and secure Cloud Networks|
|Disks and Images||An overview of disk types and images|
|Authorization and IAM||How to authenticate and authorise users|
|Disk Snapshots||How to use snapshots for point-in-time backups|
|Cloud Storage Overview||A refresher on Cloud Storage|
|Instance Groups||How to manage instances with managed and unmanaged groups|
|Cloud SQL Overview||A quick primer on how to use Cloud SQL|
|Startup and Shutdown Scripts||Using startup scripts to provision machines at boot time|
|Autoscaling||How to automatically add and remove instances|
|Load Balancing||How to balance traffic across instances|
|Putting It All Together||A demo of how to use some of the services we've learned about|
Welcome back. In this lesson, we'll be talking about metadata. We'll talk about the metadata server and how to get and set metadata.
Let's start with a quick explanation of what metadata is in this context. Metadata is a set of key value pairs containing information related to running instances or our project. This can be stuff such as project-level settings. Maybe things like API keys for external services. And instance-level information are things such as tags or the zone that we're running in or the hostname or whether the instance is pre-emptible or not.
So, as I mentioned, there are two types of metadata: instance and project. And they're accessed through the same base URL. Now we have three URL options and they're all going to direct you to the same place. There's the full URL, that's metadata.google.internal/computeMetadata/v1. There's the short URL which is metadata/computeMetadata/v1. And then the final option is to use the IP address. And then, you'll either append project or instance to the end of the URL to access the metadata specific to those topics.
Let's look at how to actually get and set data. Like most everything else, we can use the API, the SDK or the console to get and set metadata. However, to get metadata from a compute engine instance, using these options would add extra steps that we just don't need. From a running instance, all we need to do is call the URLs and add these specific values to the end of the URL. You could do it in code, or you could use a tool such as curl or Wget.
Let's connect in to an instance that we have running and see how to use these. We're connected via SSH to a compute engine instance. So, we're going to use cURL and we can start getting data from the metadata server. If we start with the base URL, we have two options here. You can see we have instance and project. And these values are what we use to append to the end of the URL and this allows us to drill-down in to the different keys. So, if we append instance to the end of this, you can see we have some additional things that we can drill in to here.
Let's check out tags. So, all we have to do is add tags to the end of the URL and you can see we get some tags back here. These ones allow us to have http and https traffic through the firewall. We can query for things such as the zone that we're in. And, in this case, we're in east1-d. And if we edit the URL, we can query for project-wide settings as well. We can see here that we have just two attributes. One is a Google-supplied and the other is a value that I've added. So, if we want to read the value for the dotnet environment, we'd append that string. And we can see that we have a value there.
Now, to change it, if we jump in to the console on the compute engine page, in to the metadata section, we can change that value. Let's change it to staging. Okay, and then we'll save it. Great, now, if we jump back in to the command line, we can refetch that and see if it says staging. So, there it is. It's changed to staging. It's a project-wide setting.
So, metadata will make our script more dynamic, because we don't need to hard-code any values. And, we don't need to know, at the time that we write our code, some of these values. For example, we don't need to know the project ID because we can fetch it dynamically. And it's not uncommon to use environment variables to store things such as API keys, connection strings, access tokens, etc. So, if we use project metadata for those sort of things, we can ensure that instances will have access to the data they need and have it in a centralized location for us to easily manage. Okay, that's gonna wrap up this lesson.
In our next lesson, we'll talk about startup and shutdown scripts. So, if you're ready to keep going, then let's get started.
Ben Lambert is a software engineer and was previously the lead author for DevOps and Microsoft Azure training content at Cloud Academy. His courses and learning paths covered Cloud Ecosystem technologies such as DC/OS, configuration management tools, and containers. As a software engineer, Ben’s experience includes building highly available web and mobile apps. When he’s not building software, he’s hiking, camping, or creating video games.