1. Home
  2. Training Library
  3. Google Cloud Platform
  4. Courses
  5. Introduction to Developing on Anthos

Integrating Anthos with an IDE using Google Cloud Code

Start course
Overview
Difficulty
Intermediate
Duration
54m
Students
220
Ratings
5/5
starstarstarstarstar
Description

Anthos is an enterprise-grade solution from Google aimed at nothing less than modernizing and unifying your entire server infrastructure, wherever it currently exists. Anthos encompasses a very broad spectrum of components, yet it’s still very new, so there isn’t a lot of good documentation and training material available for it yet. This can all make Anthos seem very daunting to learn, but this course aims to show you that the very purpose of Anthos is to simplify your infrastructure complexities for you.

Learning Objectives

  • Understand what Anthos is and does
  • Identify how Anthos fits in with other existing hybrid and multi-cloud solutions
  • Investigate options to modernize existing infrastructure configurations to use Anthos
  • Learn about the key components that make up Anthos, and how to configure them
  • Build and test a modern microservice application for Anthos on GCP
  • Create a CI/CD pipeline for deploying to Anthos

Intended Audience

  • Developers interested in learning about the latest in modern cloud-based development strategies

Prerequisites

  • Familiarity with Kubernetes and GKE
  • Have a Google Cloud Platform account
  • Have the Google Cloud SDK installed and initialized
  • Have Git installed

It is also highly recommended that you have Docker Desktop and Visual Studio Code pre-installed as well.

Transcript

Integrating Anthos with an IDE using Google Cloud Code. Welcome back! In the previous lecture group, we learned about the most important components we need to be familiar with as developers so we can write and deploy code to an Anthos environment. Now that we know how we can work with these components by writing just a few simple configuration files, let's see how we can put this into practice in our IDE and actually build and deploy a microservice for Anthos on GCP.

For the demos in this lecture group, we'll be working with Visual Studio Code to deploy a microservice written in Python. We'll also need to have Git already installed locally, as we can't automate deployment of new versions of our application without version control. Lastly, we'll need to have Docker installed locally as well, so we can build and test a containerized version of our application right in our development environment. Links to these installers can be found in the course resources.

All of these applications are free and cross platform, so you should be able to easily install them on whatever operating system you're running. If you're not a Python programmer or aren't very familiar with Visual Studio Code, don't worry, the same tools we're working with in these demos can be used with other programming languages and other IDEs as well. The first thing we'll need once we have the prerequisites installed is the Cloud Code extension. Adding Cloud Code to Visual Studio Code is as easy as clicking on Extensions, searching for Cloud Code, then clicking install.

Cloud Code integrates a number of Google APIs into our IDE, and uses minkube and Skaffold under the hood to streamline container-based development on our local machine. Minikube uses our local Docker installation to manage a single Kubernetes cluster on our development machine. Cloud Code then uses minikube to emulate GKE and Cloud Run workloads locally, so we can properly test our application in development and know how it'll behave before we even push it to a testing environment on GCP. Skaffold then handles the workflow of turning our application code into a container, and deploying it either to minikube for testing locally, or pushing it to a testing environment on GCP automatically.

With Cloud Code, we can almost forget about all the complexities of our microservices infrastructure and return to just writing code in an IDE again. But first, we'll need to authenticate our development environment to work with our GCP project. Cloud Code uses the Google Cloud SDK behind the scenes and will pick up on our active configuration's account by default. Let's make sure we're connected to the right project and authenticated with our user by typing the command gcloud init in a terminal, then follow the prompts to log in and select our project.

Now when we click on any Cloud Code components in VS Code, we are already authenticated with our Google account. We only need to click to enable any APIs required by Cloud Code to interact directly with our GCP project from within our IDE now. Cloud Code automatically updates our Application Default Credentials behind the scenes for us, so as long as our GCP user has all the right IAM roles, our application code should function as expected in our development environment. We now have our IDE configured and ready to build and test microservices locally, and set to then deploy them to a testing environment on our GCP project.

In the next lecture, we'll learn how to actually create a Cloud Run application on our Anthos deployment.

About the Author

Arthur spent seven years managing the IT infrastructure for a large entertainment complex in Arizona where he oversaw all network and server equipment and updated many on-premise systems to cloud-based solutions with Google Cloud Platform. Arthur is also a PHP and Python developer who specializes in database and API integrations. He has written several WordPress plugins, created an SDK for the Infusionsoft API, and built a custom digital signage management system powered by Raspberry Pis. Most recently, Arthur has been building Discord bots and attempting to teach a Python AI program how to compose music.