GCP DevSecOps Series (Part 1)

GCP for DevOps: GCP Basic

Harshit Gupta
8 min readJul 2, 2024

Welcome to the first installment of my series on Google Cloud Platform (GCP) for DevOps. In this series, I’ll be sharing what I’m learning about GCP, aiming to provide you with practical insights and step-by-step guidance. Whether you’re a beginner or looking to enhance your skills, this series is designed to help you navigate and utilize GCP for DevOps tasks effectively.

Why GCP for DevOps?

Google Cloud Platform is one of the leading cloud service providers, offering a robust set of tools and services tailored for DevOps practices. With GCP, you can streamline your development processes, automate your workflows, and scale your applications effortlessly. Here’s why GCP stands out for DevOps:

  • Scalability: Easily scale your applications to meet demand without managing physical hardware.
  • Flexibility: A wide range of services and integrations that support various DevOps tools and practices.
  • Reliability: High availability and redundancy options to ensure your applications run smoothly.
  • Security: Comprehensive security features and compliance certifications to protect your data.

About Me:

Before diving into GCP, I’ve had extensive experience practicing DevOps with Amazon Web Services (AWS). I’ve completed several projects, ranging from setting up CI/CD pipelines to deploying scalable applications. This background has given me a solid foundation in cloud computing and DevOps principles, which I’m now excited to apply and expand upon with GCP.

Getting Started:

Before diving into the specifics, it’s important to understand that cloud computing and DevOps are vast fields. This series is meant to provide a structured path to learning and applying these concepts using GCP. Whether you’re aiming to deploy simple applications or complex infrastructures, the skills and knowledge you gain here will be foundational to your success.

So, let’s get started with the basics of GCP and set the stage for a deeper dive into the world of DevOps!

Overview

In this initial part, we will cover the fundamental aspects of GCP that every DevOps practitioner should be familiar with. This includes setting up your GCP account, understanding the GCP Console, and getting acquainted with the core concepts of regions, zones, and projects. We’ll also explore Cloud Shell, a powerful tool that provides a command-line interface directly in your browser.

By the end of this article, you will:

  • Have a GCP account set up and ready for use.
  • Understand the layout and features of the GCP Console.
  • Be familiar with the concepts of regions and zones and their significance in resource management.
  • Know how to create and manage projects within GCP.
  • Be able to use Cloud Shell for basic operations.

These foundational skills will prepare you for more advanced topics in the upcoming parts of this series, where we will dive deeper into DevOps practices on GCP.

Create GCP Account

To get started with GCP, you’ll need to create an account. Follow these steps to set up your GCP account:

Requirements:
• A valid Gmail ID
• A credit/debit card and a phone number

  1. Go to the Google Cloud Platform Website:
    Visit the Google Cloud Platform website.
  2. Start for Free:
    Click on “Get started for free” to begin the account creation process.
  3. Sign in or Create a Google Account:
    If you already have a Google account, sign in. If not, create a new Google account.
  4. Set Up Your Account:
    Follow the on-screen prompts to set up your GCP account. You will need to provide some basic information and set up billing details. Note that GCP offers a free tier with some credits to get you started.
  5. Verify Your Account:
    You may need to verify your identity using a phone number or credit card. Google uses this to prevent fraud and ensure legitimate use.

After setting up, the dashboard would look something like this👆

Console Walkthrough

Once your account is set up, familiarize yourself with the GCP Console. Here’s a quick walkthrough:

  1. Access the GCP Console:
    Go to the GCP Console.
  2. Dashboard Overview:
    The Dashboard is the first screen you see. It provides a high-level overview of your projects, billing, and recent activity.
  3. Navigation Menu:
    On the left-hand side, you’ll find the navigation menu. This menu allows you to access various GCP services such as Compute Engine, Cloud Storage, and BigQuery.
  4. Project Management:
    At the top of the console, you’ll see a project selector dropdown. Use this to switch between different projects or create a new one. Projects are the main organizational unit in GCP, and they allow you to group related resources together.

Regions & Zones

What are Regions?

Regions are specific geographical locations where Google Cloud Platform (GCP) services and resources are hosted. Each region is an independent area that consists of multiple zones. When you create resources such as virtual machines, storage, or databases, you must choose a region where these resources will reside.

Characteristics of Regions:

  • Geographically Distinct: Regions are located in different parts of the world, such as us-central1 (Iowa, USA), europe-west1 (Belgium), and asia-east1 (Taiwan).
  • Redundancy and Availability: Regions are designed to provide high availability and redundancy. Each region is isolated from others to ensure that disruptions in one region do not affect others.
  • Latency Considerations: Choosing a region close to your users can reduce latency and improve performance. For example, if your users are primarily in Europe, selecting a region like europe-west1 would be beneficial.

What are Zones?

Zones are subdivisions within regions. Each region has multiple zones, typically three or more, such as us-central1-a, us-central1-b, and us-central1-c. Zones are designed to be independent of one another, providing additional fault tolerance within a region.

Characteristics of Zones:

  • Independence: Zones are isolated from each other in terms of physical infrastructure, meaning a failure in one zone does not impact the others within the same region.
  • High Availability: Deploying resources across multiple zones within a region can enhance availability and resilience. For example, running instances in us-central1-a and us-central1-b ensures that if one zone goes down, the other can continue to operate.
  • Resource Allocation: When creating resources, you can specify the zone where you want the resources to be located. This allows for granular control over the deployment and distribution of your resources.

How to Choose Regions and Zones

Selecting the appropriate region and zone is critical for optimizing performance, cost, and resilience of your applications. Here are some factors to consider:

  1. Proximity to Users:
    Choose a region that is geographically close to your users to minimize latency. For example, if most of your users are in North America, selecting a region like us-central1 or us-east1 would be ideal.
  2. Regulatory and Compliance Requirements:
    Some data may be subject to regulatory requirements that mandate it remains within a specific geographical location. Ensure you choose a region that complies with these regulations.
  3. Service Availability:
    Not all services are available in every region. Check the GCP services availability to ensure that the services you need are available in your chosen region.
  4. Cost Considerations:
    Pricing can vary between regions. Evaluate the cost differences and choose a region that fits your budget while meeting performance and regulatory requirements.
  5. Disaster Recovery and Redundancy:
    For high availability and disaster recovery, deploy resources across multiple zones within a region. This ensures that if one zone experiences an outage, your application can continue to run in another zone.

Creating New Project

Creating a new project in GCP is straightforward:

  1. Open the Project Selector:
    In the GCP Console, click on the project dropdown at the top of the page.
  2. Create a New Project:
    Select “New Project” from the dropdown menu.
  3. Enter Project Details:
    Provide a name for your project.
    Optionally, you can also provide a billing account, organization, and location.
  4. Create the Project:
    Click “Create” to set up your new project. Your project will be created, and you can start adding resources to it.

Cloud Shell

Cloud Shell provides a convenient command-line interface directly in your browser:

  1. Accessing Cloud Shell:
    Click on the Cloud Shell icon (a small terminal icon) in the top right corner of the GCP Console.
  2. Starting Cloud Shell:
    Click “Start Cloud Shell” in the dialog that appears. Cloud Shell will initialize, and you will see a terminal window at the bottom of the console.
  3. Basic Commands:
    Use standard Linux commands to navigate and manage your resources. For example, use ls to list files, cd to change directories, and gcloud commands to interact with GCP services.
  4. Using Cloud Shell Editor:
    Click on the pencil icon in the Cloud Shell window to open the Cloud Shell Editor. This editor allows you to edit code and configuration files directly within your browser.

What’s Next? : Part 2

As we continue this series, we’ll explore more advanced topics and tools within GCP that are essential for DevOps. In the next part, we will build on the basics we’ve covered here and delve into new areas that will enhance your GCP proficiency and DevOps skills. Stay tuned for more in-depth tutorials and practical guides.

Kudos to the creator of this awesome GIF!!!

Your feedback and questions are highly encouraged as they will help shape the upcoming content.

Connect to me, if you have any query, want to share or suggest me anything, here’s my Portfolio or dm me on LinkedIn. Stay tuned and follow me for more chapters of my odyssey, my projects, cybersec and devops articles, and write-ups and also thank you for being part of my story! 🚀

If you enjoy my posts and find them helpful, consider buying me a coffee! Your support helps me earn relevant certifications and continue sharing valuable insights. Buy Me a Coffee

https://buymeacoffee.com/harshit21

Let’s continue to strengthen our skills and build secure, scalable applications together!

--

--