deploy homepage

This commit is contained in:
2025-08-07 13:37:40 -05:00
parent 8dc2243140
commit d2d3ee7c78
15 changed files with 466 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
---
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-app

View File

@@ -0,0 +1,30 @@
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: homepage-bookmarks-secret
namespace: homepage-app
spec:
secretStoreRef:
kind: ClusterSecretStore
name: doppler-cluster
refreshInterval: "1h"
data:
- secretKey: bookmarks.yaml
remoteRef:
key: HOMEPAGE_BOOKMARKS
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: homepage-services-secret
namespace: homepage-app
spec:
secretStoreRef:
kind: ClusterSecretStore
name: doppler-cluster
refreshInterval: "1h"
data:
- secretKey: services.yaml
remoteRef:
key: HOMEPAGE_SERVICES

View File

@@ -0,0 +1,66 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: homepage
namespace: homepage-app
labels:
app.kubernetes.io/name: homepage
data:
kubernetes.yaml: |
mode: cluster
settings.yaml: |
title: MK-Labs Homepage
background:
image: https://images.unsplash.com/photo-1502790671504-542ad42d5189?auto=format&fit=crop&w=2560&q=80
saturate: 100 # 0, 50, 100... see https://tailwindcss.com/docs/backdrop-saturate
brightness: 50 # 0, 50, 75... see https://tailwindcss.com/docs/backdrop-brightness
opacity: 100 # 0-100
theme: dark
color: slate
useEqualHeights: true
layout:
Proxmox:
header: true
style: row
columns: 4
Network:
header: true
style: row
columns: 4
Other:
header: true
style: row
columns: 4
providers:
openweathermap: openweathermapapikey
weatherapi: weatherapiapikey
custom.css: ""
custom.js: ""
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
- search:
provider: duckduckgo
target: _blank
docker.yaml: ""

View File

@@ -0,0 +1,84 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: homepage
namespace: homepage-app
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
env:
- name: HOMEPAGE_ALLOWED_HOSTS
value: "homepage.apps.ocp.int.mk-labs.cloud"
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: bookmarks
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: services
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
# - mountPath: /usr/local/etc/ssl/certs/tls.crt
# name: ssl-certs
# subPath: tls.crt
# - mountPath: /usr/local/etc/ssl/certs/tls.key
# name: ssl-certs
# subPath: tls.key
volumes:
- name: homepage-config
configMap:
name: homepage
- name: bookmarks
secret:
secretName: homepage-bookmarks-secret
- name: services
secret:
secretName: homepage-services-secret
# - name: ssl-certs
# secret:
# secretName: letsencrypt-homepage
- name: logs
emptyDir: {}

View File

@@ -0,0 +1,20 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
annotations:
name: letsencrypt-homepage
namespace: homepage-app
spec:
commonName: 'homepage.int.mk-labs.cloud'
dnsNames:
- homepage.int.mk-labs.cloud
duration: 2160h0m0s
issuerRef:
kind: ClusterIssuer
name: letsencrypt-prod
renewBefore: 360h0m0s
secretName: letsencrypt-homepage
usages:
- server auth
- client auth

View File

@@ -0,0 +1,46 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: homepage-ingress
namespace: homepage-app
annotations: {}
# route.openshift.io/termination: "reencrypt"
# route.openshift.io/destination-ca-certificate-secret: letsencrypt-homepage
spec:
ingressClassName:
openshift-default
rules:
- host: homepage.int.mk-labs.cloud
http:
paths:
- path: /
pathType: Exact
backend:
service:
name: homepage
port:
number: 443
# tls:
# - hosts:
# - homepage.int.mk-labs.cloud
# secretName: letsencrypt-homepage
#---
#apiVersion: networking.k8s.io/v1
#kind: Ingress
#metadata:
# name: hello-openshift
#spec:
# rules:
# - host: hello-openshift.yourcluster.example.com
# http:
# paths:
# - backend:
# # Forward to a Service called 'hello-openshift'
# service:
# name: hello-openshift
# port:
# number: 8080
# path: /
# pathType: Exact

View File

@@ -0,0 +1,15 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- secret.yaml
- serviceaccount.yaml
- configmap-eso.yaml
- configmap.yaml
- clusterrole.yaml
- service.yaml
- ingress-certificate.yaml
- deployment.yaml
- route.yaml

View File

@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: homepage-app
name: homepage-app
argocd.argoproj.io/managed-by: openshift-gitops-operator
name: homepage-app
spec:
finalizers:
- kubernetes

View File

@@ -0,0 +1,46 @@
#---
#3apiVersion: route.openshift.io/v1
#kind: Route
#metadata:
# labels:
# app.kubernetes.io/instance: homepage-app
# app.kubernetes.io/name: homepage-app
# name: homepage-app
# namespace: homepage-app
#spec:
# host: homepage.int.mk-labs.cloud
# port:
# targetPort: http
# tls:
# insecureEdgeTerminationPolicy: Redirect
# termination: edge
# externalCertificate:
# name: letsencrypt-homepage
# to:
# kind: Service
# name: homepage
# weight: 100
# wildcardPolicy: None
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app.kubernetes.io/instance: homepage-app
app.kubernetes.io/name: homepage-app
name: homepage-app2
namespace: homepage-app
spec:
host: homepage.apps.ocp.int.mk-labs.cloud
port:
targetPort: http
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: homepage
weight: 100
wildcardPolicy: None

View File

@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
name: homepage
namespace: homepage-app
labels:
app.kubernetes.io/name: homepage
annotations:
kubernetes.io/service-account.name: homepage

View File

@@ -0,0 +1,18 @@
---
apiVersion: v1
kind: Service
metadata:
name: homepage
namespace: homepage-app
labels:
app.kubernetes.io/name: homepage
annotations: {}
spec:
type: ClusterIP
ports:
- port: 3000
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: homepage

View File

@@ -0,0 +1,10 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: homepage
namespace: homepage-app
labels:
app.kubernetes.io/name: homepage
secrets:
- name: homepage

View File

@@ -0,0 +1,20 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
annotations:
name: letsencrypt-homepage2
namespace: homepage-app
spec:
commonName: 'homepage2.int.mk-labs.cloud'
dnsNames:
- homepage2.int.mk-labs.cloud
duration: 2160h0m0s
issuerRef:
kind: ClusterIssuer
name: letsencrypt-prod
renewBefore: 360h0m0s
secretName: letsencrypt-homepage2
usages:
- server auth
- client auth