Google Cloud MVK
Use case development pre-production
Section titled “Use case ”development pre-productionIntroduction
Section titled “Introduction”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.
Prerequisites
Section titled “Prerequisites”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:
curl -L https://codeberg.org/headshed/infctl-cli/raw/branch/main/install.sh | bash
Install OpenTofu
Section titled “Install OpenTofu”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
Sign Up for Google Cloud Console
Section titled “Sign Up for Google Cloud Console”To create and manage Google Cloud resources, you need a Google Cloud account.
- Visit the Google Cloud Console.
- Sign in with your Google account or create one if you don’t have one yet.
- Follow the prompts to set up billing (a free trial may be available).
- Once signed in, you can create a new project by clicking on the project dropdown at the top and selecting “New Project”.
- Name your project and click “Create”.
You will use this project to build and manage your cloud resources.
Install the Google Cloud CLI
Section titled “Install the Google Cloud CLI”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:
gcloud init
Refer to the official documentation for troubleshooting and advanced options.
Sign up for Hosted DNS
Section titled “Sign up for Hosted DNS”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.
- Go to Cloudflare Sign Up.
- Enter your email address and create a password.
- Click “Create Account”.
- After logging in if you already have a domain name, click “Add a Site” and enter your existing domain name.
- Select the free plan and continue.
- 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.