Post

New Job As An Internal It Manager But Everything Is Managed By An Msp

Welcome to your new role as an internal IT manager, where most of the infrastructure is managed by a Managed Service Provider (MSP). However, you still have the opportunity to.

# New Job as an Internal IT Manager but Everything is Managed by an MSP: A Self-Hosted Homelab Guide for DevOps Professionals

Welcome to your new role as an internal IT manager, where most of the infrastructure is managed by a Managed Service Provider (MSP). However, you still have the opportunity to build and manage a self-hosted homelab for personal projects or prototyping. This guide will walk you through setting up a basic self-hosted infrastructure with an emphasis on open-source tools, automation, and DevOps best practices.

Prerequisites

  • Ubuntu Server 20.04 LTS (Focal Fossa) or higher
  • Minimum 8GB RAM and 50GB of free disk space
  • Docker CE 19.03.13+
  • Kubernetes 1.17.0+
  • Access to the server via SSH

Solution Steps

1. Update your system

1
sudo apt update && sudo apt upgrade -y

2. Install Docker CE and Kubernetes

1
2
3
curl -s https://lists.canonical.com/mailman3/download/ubuntu-focal-support-updates/dists/focal-updates/InRelease | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial/" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt update && sudo apt install docker-ce=5.0.8 docker-ce-cli containerd.io kubeadm=1.17.0 kubelet=1.17.0 kubectl=1.17.0 -y

3. Initialize and configure Kubernetes

Create a kubeadm user, switch to it, and initialize the cluster:

1
2
3
sudo adduser kubeadm
su kubeadm
kubeadm init --pod-network-cidr=10.244.0.0/16

Set up kubectl:

1
2
mkdir -p $HOME/.kube && sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config && sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml

4. Deploy your first application

Create a deployment.yaml file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      containers:
      - name: my-app-container
        image: my-app:latest

Apply the deployment:

1
kubectl apply -f ./deployment.yaml

Troubleshooting

If you encounter issues, refer to the Kubernetes documentation for assistance.

Conclusion

By following this guide, you can set up a basic self-hosted infrastructure within your organization’s network. This homelab will allow you to practice DevOps techniques and work on open-source projects in an environment that closely mirrors production. Remember to adhere to security best practices when configuring your applications and network settings.

In subsequent blog posts, we will explore advanced topics such as monitoring, logging, continuous integration/continuous deployment (CI/CD), and orchestrating complex multi-container applications using Kubernetes. Stay tuned!

This post is licensed under CC BY 4.0 by the author.