The Journey of a Microservice: From Source Code to a Full-Blown Kubernetes Deployment

In this lecture, we’ll containerize and deploy a RESTful Go microservice to a Kubernetes cluster. We’ll also learn about some important building blocks of our cluster such as Deployments, Services, ConfigMaps, Secrets, Ingresses, and the like.

There is harmony in all that Kubernetes complexity. (generated by Midjourney)

Introduction

In this lecture, we’ll containerize and deploy a RESTful Go microservice to a Kubernetes cluster. We’ll also learn about some important building blocks of our cluster such as Deployments, Services, ConfigMaps, Secrets, Ingresses, and the like.

Lecture

Deploying a Microservice to Kubernetes

Below, you’ll find the source code of the projects that we used in this video, links, resources, and other reference material for you learn and practice even further.

Read the Source

Below, you’ll find the zip archives of the projects and other related artifacts that we’ve covered in this article.

The Contents of the .netrc File

machine github.com
login your_github_username_comes_here
password ghp_your_github_api_key_comes_here
machine api.github.com
login your_github_username_comes_here
password ghp_your_github_api_key_comes_here

The Environment Variables

Here are the environment variables of interest that our builder script uses:

ECR_REPO=112233445566.dkr.ecr.us-west-2.amazonaws.com
ECR_IMAGE_FIZZ_CRYPTO=fizz-crypto
ECR_TAG_FIZZ_CRYPTO=0.0.15

ECR Login Script

Here’s the login script I used in the video:

aws ecr get-login-password --region us-west-2 | \
docker login --username AWS --password-stdin \
1122334455667788.dkr.ecr.us-west-2.amazonaws.com
Note

To use the above script, you need to install and configure AWS CLI first.

Resources and Additional Reading

This post is for subscribers only

Already have an account? Sign in.
 \
 \\,
  \\\,^,.,,.                    “Zero to Hero”
  ,;7~((\))`;;,,               <zerotohero.dev>
  ,(@') ;)`))\;;',    stay up to date, be curious: learn
   )  . ),((  ))\;,
  /;`,,/7),)) )) )\,,
 (& )`   (,((,((;( ))\,

Subscribe to Zero to Hero

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe