Skip to content

Commit

Permalink
feat: deploy homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
luissimas committed May 5, 2024
1 parent bd7aa49 commit 82af67f
Show file tree
Hide file tree
Showing 11 changed files with 299 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Apps are the user-facing services provided by the cluster.
- [x] Gpu acceleration
- [ ] Media folder on dedicated drive

### Homarr
### Homepage

- [X] Deploy
- [ ] Widgets
Expand All @@ -105,7 +105,7 @@ https://github.com/onedr0p/exportarr

### QbitTorrent

- [ ] Deploy
- [X] Deploy
- [ ] Monitoring

### Radarr
Expand Down
54 changes: 54 additions & 0 deletions apps/homepage/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: homepage
labels:
app.kubernetes.io/name: homepage
rules:
- apiGroups:
- ""
resources:
- namespaces
- pods
- nodes
verbs:
- get
- list
- apiGroups:
- extensions
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- apiGroups:
- traefik.containo.us
resources:
- ingressroutes
verbs:
- get
- list
- apiGroups:
- metrics.k8s.io
resources:
- nodes
- pods
verbs:
- get
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: homepage
labels:
app.kubernetes.io/name: homepage
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: homepage
subjects:
- kind: ServiceAccount
name: homepage
namespace: homepage
100 changes: 100 additions & 0 deletions apps/homepage/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: homepage
namespace: homepage
labels:
app.kubernetes.io/name: homepage
data:
kubernetes.yaml: |
mode: cluster
settings.yaml: |
title: Home server
quicklaunch:
searchDescriptions: true
hideInternetSearch: false
hideVisitURL: true
hideVersion: true
showStats: true
statusStyle: "dot"
layout:
Media:
style: columns
Management:
style: columns
custom.css: ""
custom.js: ""
bookmarks.yaml: |
- Developer:
- Github:
- abbr: GH
href: https://github.com/
services.yaml: |
- Media:
- Jellyfin:
icon: jellyfin.png
href: https://jellyfin.totorinho.duckdns.org
description: Media server.
- Sonarr:
icon: sonarr.png
href: https://sonarr.totorinho.duckdns.org
description: TV Shows management
- Radarr:
icon: radarr.png
href: https://radarr.totorinho.duckdns.org
description: Movie management
- Bazarr:
icon: bazarr.png
href: https://bazarr.totorinho.duckdns.org
description: Subtitles management
- Readarr:
icon: readarr.png
href: https://readarr.totorinho.duckdns.org
description: Books management
- Prowlarr:
icon: prowlarr.png
href: https://prowlarr.totorinho.duckdns.org
description: Indexers management
- qBittorrent:
icon: qbittorrent.png
href: https://qbittorrent.totorinho.duckdns.org
description: Torrent client
- Management:
- Grafana:
icon: grafana.png
href: https://grafana.totorinho.duckdns.org
description: Application monitoring
- Flux:
icon: flux-cd.png
href: https://weave.totorinho.duckdns.org
description: GitOps UI
widgets.yaml: |
- kubernetes:
cluster:
show: true
cpu: true
memory: true
showLabel: true
label: "cluster"
nodes:
show: true
cpu: true
memory: true
showLabel: true
- resources:
backend: resources
expanded: true
cpu: true
memory: true
uptime: true
units: metric
- search:
provider: google
target: _blank
- openmeteo:
label: São Carlos
latitude: 22.0028
longitude: 47.8970
cache: 5
units: metric
docker.yaml: ""
65 changes: 65 additions & 0 deletions apps/homepage/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: homepage
namespace: homepage
labels:
app.kubernetes.io/name: homepage
spec:
revisionHistoryLimit: 3
replicas: 1
strategy:
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: homepage
template:
metadata:
labels:
app.kubernetes.io/name: homepage
spec:
serviceAccountName: homepage
automountServiceAccountToken: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
containers:
- name: homepage
image: "ghcr.io/gethomepage/homepage:latest"
imagePullPolicy: Always
ports:
- name: http
containerPort: 3000
protocol: TCP
volumeMounts:
- mountPath: /app/config/custom.js
name: homepage-config
subPath: custom.js
- mountPath: /app/config/custom.css
name: homepage-config
subPath: custom.css
- mountPath: /app/config/bookmarks.yaml
name: homepage-config
subPath: bookmarks.yaml
- mountPath: /app/config/docker.yaml
name: homepage-config
subPath: docker.yaml
- mountPath: /app/config/kubernetes.yaml
name: homepage-config
subPath: kubernetes.yaml
- mountPath: /app/config/services.yaml
name: homepage-config
subPath: services.yaml
- mountPath: /app/config/settings.yaml
name: homepage-config
subPath: settings.yaml
- mountPath: /app/config/widgets.yaml
name: homepage-config
subPath: widgets.yaml
- mountPath: /app/config/logs
name: logs
volumes:
- name: homepage-config
configMap:
name: homepage
- name: logs
emptyDir: {}
29 changes: 29 additions & 0 deletions apps/homepage/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: homepage
namespace: homepage
labels:
app.kubernetes.io/name: homepage
annotations:
gethomepage.dev/description: Dynamically Detected Homepage
gethomepage.dev/enabled: "true"
gethomepage.dev/group: Cluster Management
gethomepage.dev/icon: homepage.png
gethomepage.dev/name: Homepage
spec:
tls:
- hosts:
- home.totorinho.duckdns.org
secretName: duckdns-wildcard-cert-totorinho.duckdns.org
rules:
- host: home.totorinho.duckdns.org
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: homepage
port:
number: 3000
11 changes: 11 additions & 0 deletions apps/homepage/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- serviceaccount.yaml
- secret.yaml
- configmap.yaml
- clusterrole.yaml
- service.yaml
- deployment.yaml
- ingress.yaml
4 changes: 4 additions & 0 deletions apps/homepage/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: homepage
10 changes: 10 additions & 0 deletions apps/homepage/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
name: homepage
namespace: homepage
labels:
app.kubernetes.io/name: homepage
annotations:
kubernetes.io/service-account.name: homepage
14 changes: 14 additions & 0 deletions apps/homepage/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: homepage
namespace: homepage
labels:
app.kubernetes.io/name: homepage
annotations:
spec:
selector:
app.kubernetes.io/name: homepage
ports:
- port: 3000
targetPort: 3000
9 changes: 9 additions & 0 deletions apps/homepage/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: homepage
namespace: default
labels:
app.kubernetes.io/name: homepage
secrets:
- name: homepage
1 change: 1 addition & 0 deletions apps/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- media
- homepage

0 comments on commit 82af67f

Please sign in to comment.