Skip to content

Homer-k8s

Homer is a static home page that gathers links to your services, described in a single YAML file. Homer-k8s is the Kubernetes controller that makes that page dynamic: you declare your services in CRDs, and Homer’s configuration is regenerated and reloaded on every change.

RoleKubernetes controller generating a Homer dashboard from CRDs
StackGo · controller-runtime
LicenseApache-2.0
Imagebananaops/homer-k8s
Helm chartbananaops.github.io/homer-k8s/
RepositoryBananaOps/homer-k8s · releases
  • HomerServices CRDs to declare services from your manifests
  • Helm chart that deploys Homer and its controller
  • Homer configuration in the chart values
  • EC2 discovery: automatically adds a page listing your AWS instances
  • Multi-architecture: amd64 and arm64
  • Smart cards: support for Homer’s custom services
  • A Kubernetes cluster and Helm
  • To work on the code: Go 1.22+ and ko-build
Terminal window
helm repo add bananaops https://bananaops.github.io/homer-k8s/
helm repo update bananaops
# Install with default values
helm install homer bananaops/homer-k8s

To customise:

Terminal window
wget https://raw.githubusercontent.com/bananaops/homer-k8s/main/helm/homer-k8s/values.yaml
# edit values.yaml
helm install homer bananaops/homer-k8s -f values.yaml

The services shown on the dashboard are described by HomerServices resources. Each group becomes a section of the page.

apiVersion: homer.bananaops.io/v1alpha1
kind: HomerServices
metadata:
labels:
app.kubernetes.io/name: homer-k8s
name: homerservices-sample
spec:
groups:
- name: ci
icon: "fas fa-code-branch"
items:
- name: "Awesome app"
logo: "assets/tools/sample.png"
icon: "fab fa-jenkins"
subtitle: "Bookmark example"
tag: "app"
tagstyle: "is-success"
keywords: "self hosted reddit" # optional, used by search
url: "https://www.reddit.com/r/selfhosted/"
target: "_blank" # optional
- name: "Another one"
logo: "assets/tools/sample.png"
subtitle: "Another application"
tag: "app"
tagstyle: "is-success"
url: "#"
Terminal window
kubectl apply -f homerservices-sample.yaml

The controller picks up the resource, regenerates the configuration and reloads Homer.

values.yaml
image:
repository: bananaops/homer-k8s
pullPolicy: IfNotPresent
tag: ""
serviceAccount:
create: true
annotations: {}
rbac:
create: true
scope: false # true to restrict the controller to its namespace
service:
type: ClusterIP
port: 8080
ingress:
enabled: false
className: ""
hosts:
- host: homer-k8s.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
resources:
limits:
cpu: 250m
memory: 128Mi

This feature walks the AWS account and fills an ec2.yml page with, for each instance, its IP and a link to its page in the AWS console.

  1. Create the IAM policy allowing instances to be described

    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Action": "ec2:DescribeInstances",
    "Effect": "Allow",
    "Resource": "*"
    }
    ]
    }
  2. Enable the feature in the values

    env:
    - name: HOMER_EC2_ENABLED
    value: "true"
  3. Attach the IAM role to the ServiceAccount (on EKS)

    serviceAccount:
    create: true
    annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::{{ AWS_ACCOUNT }}:role/{{ AWS_ROLE }}
Terminal window
# Build (binary in bin/)
skaffold build
# Update generated manifests
make manifest
# Deploy to the current cluster (adjust skaffold.yaml first)
skaffold run