Skip to content

wagov-dtt/tutorials-and-workshops

Repository files navigation

tutorials-and-workshops

See our DevSecOps Induction for more structured content, this repo has concepts and templates. Best local environment to play with this repo is project Bluefin as primary OS / a VM or Debian on WSL2 with systemd support

IaC intro

Getting started - run below commands to setup your local devcontainer ready to interact with AWS.

just prereqs
just awslogin # Follow instructions to setup sso account
just setup-eks # Create the training01 cluster in your AWS account

Once configured can deploy the 2048 application as per AWS quickstart and test out cluster operations. Using k9s to explore the cluster is another great way to learn k8s basics.

TODO: Configure Managed Identity proxying of S3 via s3proxy to enable in cluster resources to access S3 without secrets.

Local development

Similar to above, a close-to-production environment can be stood up locally with k3d (we use this over minikube as it has better loadbalancer/storage defaults). This configuration also uses the k3s helm-controller to enable kustomize to directly deploy HelmCharts from helm-charts.yaml and is much more lightweight than a full argocd or flux config.

just deploy-local

This configures dbs for postgres, mysql, mongodb locally and an S3Proxy . The deployment can be tweaked for local use just by commenting out resources in the kustomization.yaml files, bit more work required to add below capabilities:

  • Percona Everest preconfigured to use s3proxy endpoint (currently need to create bucket manually at the internal http://s3proxy.everest.svc.cluster.local address)
  • K8up preconfigured with s3proxy to demonstrate app aware backups on e.g. a nightly schedule
  • Predefine a single node Elastic template for local testing of elastic workloads

macOS tips

To get working x86_64 devcontainers locally on macOS below is a quickstart on Apple Silicon with homebrew installed.

# Setup devpod & colima for docker support
brew install colima docker docker-buildx devpod
mkdir -p ~/.docker/cli-plugins
ln -s $(which docker-buildx) ~/.docker/cli-plugins/docker-buildx
# Create a suitably sized vm for dev activities (k3d clusters with local dbs will use 2-3GB of memory)
softwareupdate --install-rosetta --agree-to-license
colima start --cpu 4 --memory 12 --vz-rosetta
devpod provider add docker

# Launch devcontainer with default ide
cd ~/GitHub
gh repo clone wagov-dtt/tutorials-and-workshops
DOCKER_DEFAULT_PLATFORM=linux/amd64 devpod up tutorials-and-workshops