Architecting a development lifecycle for a Kubernetes-based deployments

Local Development

Setting up local Kubernetes

sudo apt -y install docker.io
sudo systemctl enable docker.service
/bin/cat <<EOM > /etc/docker/daemon.json
{
"insecure-registries": ["localhost:5000", "localhost:32000"]
}
EOM
sudo sed -i ‘s/-H fd:\/\//-H fd:\/\/ -H tcp:\/\/0.0.0.0:4243/g’ /lib/systemd/system/docker.servicesudo systemctl daemon-reload
sudo service docker restart
sudo docker run -d -p 5000:5000 — restart=always — name “registry” registry:2
sudo snap install microk8s --classic
sudo microk8s.disable ha-cluster — force
sudo microk8s status — wait-ready
sudo microk8s.enable dns
sudo microk8s status — wait-ready
sudo snap alias microk8s.kubectl kubectl
sudo iptables -P FORWARD ACCEPT
sudo sed -i ‘/\[plugins.cri.registry.mirrors\]/a \ \ \ \ \ \ \ \ [plugins.”io.containerd.grpc.v1.cri”.registry.mirrors.”localhost:5000"]\n \ \ \ \ \ \ \ \ \ endpoint = [“http:\/\/localhost:5000”]’ /var/snap/microk8s/current/args/containerd-template.toml
 microk8s.inspect 

Deploying your pods on MicroK8s

Closing the loop

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store