Skip to content

Google Cloud MVK

Google Cloud can be used to host a lab that can be cheaper to run if the hardware you use for your day to day is not sufficiently capable and can also offer an alternative that is close or identical to production.

The approach adopted by MVK strongly supports the use of infrastructure as code. A key benefit of this being its ability to build and more imortantly rebuild infrastructure from scratch.

This means that you can destroy infrastructure when it is not needed.

Fort test, development and validation work, this has many benefits.

  • Reduced costs - your not paying for hosting when you don’t need it

  • Increased confidence - in your infrastructure being recoverable in the event of a disaster

  • Better testing - of both your infrastructure and your applications as each test cycle is guaranteed to have a ‘clean’, consistent and predictable environment.

If you have not already installed infctl please do so.

If your a Windows user, be sure to check Notes for Windows Users to ensure you have Git and Bash installed.

Suffice to say, you will need to run the following in a bash capable console:

Terminal window
curl -L https://codeberg.org/headshed/infctl-cli/raw/branch/main/install.sh | bash

We will build Google Cloud infrastructure with Terrarorm and using OpenTofu which you can find download and installation instructions for all major platforms here:

https://opentofu.org/docs/intro/install

To create and manage Google Cloud resources, you need a Google Cloud account.

  1. Visit the Google Cloud Console.
  2. Sign in with your Google account or create one if you don’t have one yet.
  3. Follow the prompts to set up billing (a free trial may be available).
  4. Once signed in, you can create a new project by clicking on the project dropdown at the top and selecting “New Project”.
  5. Name your project and click “Create”.

You will use this project to build and manage your cloud resources.

To interact with Google Cloud resources, you need to install the gcloud command line interface.

gcloud is available for all major platforms, be they Windows, Linux or Mac.

You can find an installation and download for each at :

https://cloud.google.com/sdk/docs/install

After installation, open a new Command Prompt and initialize the CLI:

Terminal window
gcloud init

Refer to the official documentation for troubleshooting and advanced options.

To access your lab in Gcloud, you need to buy or already have a domain name and the ability to manage where its ‘A records’ point to.

You can use any DNS provider of your choosing that can do this for you but here is a quick guide to sign up for a free Cloudflare account where you can both buy and manage existing or new domain names.

Cloudflare offers free DNS management and security features for your domains.

  1. Go to Cloudflare Sign Up.
  2. Enter your email address and create a password.
  3. Click “Create Account”.
  4. After logging in if you already have a domain name, click “Add a Site” and enter your existing domain name.
  5. Select the free plan and continue.
  6. Cloudflare will scan your DNS records; review and confirm them and give instructions to complete the process.

Once sign up is complete, you can buy or import other Domain names and manage their records and settings from the Cloudflare dashboard.

Next we will run a pipeline to create a single node development cluster running k3s in gcloud.