Member-only story
Writing Kubernetes manifest files
This article will cover the basics on writing configuration files to deploy a project onto Kubernetes. We are going to be converting a docker-compose file into Kubernetes resources — While describing the various options and hurdles you may come across along the way.
To demonstrate this, I am going to be writing the required files used to deploy Home Assistant into Kubernetes and deploy it on our Kubernetes cluster.
See here for an article I wrote previously, following this process for phpipam: Managing your network IPs with IPAM.
NOTE: This article assumes a basic knowledge of Kubernetes resources (namespaces, services, deployments, Persistent Volume Claims)
Understanding the source
The first step in converting a docker project into Kubernetes manifests is to understand the source that you are going to be referencing.
In this instance, we’ll be using the docker-compose file from the Home Assistant website here.
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /PATH_TO_YOUR_CONFIG:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host