Skip to content

bhenderson-r7/r7-dev-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K8s Development Environment

This is a simple chart that deploys a development environment to a local K8s cluster. The intended use is with Docker Desktop

This environment consists of:

  • A MYSQL 8.0 database
  • A Redis database (latest)

Prerequisites

  • Install Docker Desktop
  • Enable Kubernetes
  • Install Helm

Installing Helm

brew install helm

Getting started

If you've used kubectl for K8s clusters other than the local Docker Desktop cluster, run

kubectl config use-context docker-desktop

The following command will install or upgrade MySQL 8.1 and Redis into your local Docker Desktop K8s cluster

make install

Uninstall everything

The following command will uninstall everything from your local Docker Desktop K8s cluster but leave the data directories intact

make uninstall

Create a snapshot of the mysql database

The following command will create a snapshot of the current mysql state

make snapshot

Restore the most recent mysql snapshot

The following command will restore the most recent mysql snapshot

make restore

Resoure a specific mysql snapshot

make restore MYSQLSNAPSHOT=mysql-20240627T151112.tar.gz

Health check the deployment

The following command will check the health of the deployment

make status 

A healthy state should look something like:

kubectl get all -n r7-dev-env
NAME                                  READY   STATUS    RESTARTS   AGE
pod/r7-dev-env-mysql-stateful-set-0   1/1     Running   0          2m25s
pod/r7-dev-env-redis-stateful-set-0   1/1     Running   0          2m25s

NAME                                  TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
service/r7-dev-env-mysql-db-service   LoadBalancer   10.106.1.77     localhost     3306:30778/TCP   2m25s
service/r7-dev-env-redis-db-service   LoadBalancer   10.101.34.138   localhost     6379:31483/TCP   2m25s

NAME                                             READY   AGE
statefulset.apps/r7-dev-env-mysql-stateful-set   1/1     2m25s
statefulset.apps/r7-dev-env-redis-stateful-set   1/1     2m25s

Troubleshooting

If your pods are not running check:

kubectl describe node docker-desktop

If you see an event like Warning EvictionThresholdMet ... Attempting to reclaim ephemeral-storage you may not have your Virtual disk limit set high enough

In Docker Desk top increase Settings -> Resources -> Advanced -> Virtual disk limit to 128 GB

About

An environment for local development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •