BananaOps / homer-k8s

homer dashboard with kubernetes controller
https://github.com/bastienwirtz/homer
Apache License 2.0
7 stars 2 forks source link
controller dashboard go golang hacktoberfest hacktoberfest2024 homer k8s kubernetes kubernetes-operator

homer-k8s

homer-k8s

An Open-Source kubernetes controller to use Homer on k8s

About Homer-k8s

Homer is a dead simple static HOMepage for your servER to keep your services on hand, from a simple yaml configuration file.

Homer Dashboard https://github.com/bastienwirtz/homer

This project in to order to facilite the deployment in Kubernetes Cluster with dynamic CRDs to define Service aand reload the configuration on each CRDs change.

Features

Getting Started 🚀

Requirements

Crds HomerServices

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"
          tagstyle: "is-success"
          icon: "fab fa-jenkins"
          subtitle: "Bookmark example"
          tag: "app"
          keywords: "self hosted reddit" # optional keyword used for searching purpose
          url: "https://www.reddit.com/r/selfhosted/"
          target: "_blank" # optional html tag target attribute

          # background: red # optional color for card to set color directly without custom stylesheet
        - name: "Another one"
          logo: "assets/tools/sample.png"
          subtitle: "Another application"
          tag: "app"
          # Optional tagstyle
          tagstyle: "is-success"
          url: "#"

Build

To compile homer-k8s run this command, output a binnary in bin/event

skaffold build

Update Manifest

To updates manifest files :

make manifest

Deploy with skaffold

To deploy with skaffold:

! Need to modify skafflod config

skaffold run

Deploy with Helm

helm repo add bananaops https://bananaops.github.io/homer-k8s/
helm repo update bananaops

# install with all defaults
helm install homer bananaops/homer-k8s

# install with customisations
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

EC2 Discovery

This feature discover all instance in AWS account and feed a page ec2.yml with link IP and link AWS Instance detail.

Need token to describe EC2 instance or EKS IAM Role Service Account.

IAM Policy

Need to create an IAM Policy to describe All EC2 instances

{
    "Statement": [
        {
            "Action": "ec2:DescribeInstances",
            "Effect": "Allow",
            "Resource": "*"
        }
    ],
    "Version": "2012-10-17"
}

Enable Feature

In values.yaml add env HOMER_EC2_ENABLED to true.

env:
  - name: HOMER_EC2_ENABLED
    value: "true"

In EKS add annotation for IAM Role.

serviceAccount:
  create: true
  annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::{{ AWS_ACCOUNT}}:role/{{ AWS_ROLE }}

Contributing

Please see the contribution guidelines and our code of conduct. All contributions are subject to the Apache 2.0 open source license.

help wanted issues: