diff --git a/k8s/configmap.yaml b/k8s/configmap.yaml index efd15ad..8794d80 100644 --- a/k8s/configmap.yaml +++ b/k8s/configmap.yaml @@ -1,28 +1,18 @@ apiVersion: v1 kind: ConfigMap metadata: - name: homepage-config - namespace: homepage + name: homepage + namespace: default labels: app.kubernetes.io/name: homepage data: kubernetes.yaml: | mode: cluster - settings.yaml: | - providers: - openweathermap: openweathermapapikey - weatherapi: weatherapiapikey - title: Dashboard - favicon: https://github.com/walkxcode/dashboard-icons/blob/main/png/homepage.png - theme: dark - color: slate - headerStyle: clean - layout: - My First Group: - style: row - columns: 3 - My Second Group: - style: column + settings.yaml: "" + #settings.yaml: | + # providers: + # longhorn: + # url: https://longhorn.my.network custom.css: "" custom.js: "" bookmarks.yaml: | @@ -30,45 +20,21 @@ data: - Github: - abbr: GH href: https://github.com/ - - Docker Hub: - - abbr: DH - href: https://hub.docker.com/ - - Social: - - Reddit: - - abbr: RE - href: https://www.reddit.com/ services.yaml: | - - Infrastructure: - - Traefik: - href: http://traefik.local - description: Reverse Proxy & Load Balancer - icon: traefik.png - server: my-k3s - container: traefik - - Longhorn: - href: http://longhorn.local - description: Distributed Storage - icon: longhorn.png + - My First Group: + - My First Service: + href: http://localhost/ + description: Homepage is awesome - - Monitoring: - - Grafana: - href: http://grafana.local - description: Analytics & Monitoring - icon: grafana.png - - Prometheus: - href: http://prometheus.local - description: Metrics Collection - icon: prometheus.png + - My Second Group: + - My Second Service: + href: http://localhost/ + description: Homepage is the best - - Applications: - - Nextcloud: - href: http://nextcloud.local - description: File Sharing & Collaboration - icon: nextcloud.png - - Jellyfin: - href: http://jellyfin.local - description: Media Server - icon: jellyfin.png + - My Third Group: + - My Third Service: + href: http://localhost/ + description: Homepage is 😎 widgets.yaml: | - kubernetes: cluster: @@ -76,25 +42,19 @@ data: cpu: true memory: true showLabel: true - label: "K3s Cluster" + label: "cluster" nodes: show: true cpu: true memory: true showLabel: true - resources: - backend: resources + backend: resources expanded: true cpu: true memory: true - - datetime: - text_size: xl - format: - timeStyle: short - dateStyle: short - hourCycle: h23 + network: default - search: provider: duckduckgo target: _blank - showSearchSuggestions: true docker.yaml: "" \ No newline at end of file diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index bf73a0a..dbca561 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: homepage - namespace: homepage + namespace: default labels: app.kubernetes.io/name: homepage spec: @@ -10,9 +10,6 @@ spec: replicas: 1 strategy: type: RollingUpdate - rollingUpdate: - maxUnavailable: 0 - maxSurge: 1 selector: matchLabels: app.kubernetes.io/name: homepage @@ -25,75 +22,47 @@ spec: automountServiceAccountToken: true dnsPolicy: ClusterFirst enableServiceLinks: true - securityContext: - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 1000 containers: - name: homepage image: "ghcr.io/gethomepage/homepage:latest" imagePullPolicy: Always - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: false - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - drop: - - ALL env: - name: HOMEPAGE_ALLOWED_HOSTS - value: "sortifal.fr,localhost" + value: sortifal.fr # required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts ports: - name: http containerPort: 3000 protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - initialDelaySeconds: 30 - periodSeconds: 10 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 3 - readinessProbe: - httpGet: - path: / - port: http - initialDelaySeconds: 5 - periodSeconds: 5 - timeoutSeconds: 5 - successThreshold: 1 - failureThreshold: 3 - resources: - limits: - cpu: 500m - memory: 512Mi - requests: - cpu: 100m - memory: 256Mi volumeMounts: - - mountPath: /app/config - name: config-writable - initContainers: - - name: config-setup - image: "busybox:1.36" - command: ['sh', '-c', 'cp -r /app/config-ro/* /app/config/ || true; chmod -R 755 /app/config; chown -R 1000:1000 /app/config'] - securityContext: - runAsUser: 0 - volumeMounts: - - mountPath: /app/config-ro + - mountPath: /app/config/custom.js name: homepage-config - - mountPath: /app/config - name: config-writable + 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-config + name: homepage - name: logs - emptyDir: {} - - name: config-writable emptyDir: {} \ No newline at end of file diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index 254013a..d1330b7 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -10,7 +10,8 @@ resources: - service.yaml - deployment.yaml - ingress.yaml - + - secrets.yaml + - serviceaccount.yaml commonLabels: app: homepage version: v1.0.0 diff --git a/k8s/rbac.yaml b/k8s/rbac.yaml index d1a4638..fc2b34f 100644 --- a/k8s/rbac.yaml +++ b/k8s/rbac.yaml @@ -23,7 +23,6 @@ rules: - get - list - apiGroups: - - traefik.containo.us - traefik.io resources: - ingressroutes @@ -46,15 +45,6 @@ rules: verbs: - get - list - - apiGroups: - - apps - resources: - - deployments - - replicasets - - statefulsets - verbs: - - get - - list --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -69,4 +59,4 @@ roleRef: subjects: - kind: ServiceAccount name: homepage - namespace: homepage \ No newline at end of file + namespace: default \ No newline at end of file diff --git a/k8s/secret.yaml b/k8s/secret.yaml new file mode 100644 index 0000000..08a49b1 --- /dev/null +++ b/k8s/secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +type: kubernetes.io/service-account-token +metadata: + name: homepage + namespace: default + labels: + app.kubernetes.io/name: homepage + annotations: + kubernetes.io/service-account.name: homepage \ No newline at end of file diff --git a/k8s/service.yaml b/k8s/service.yaml index 8927e1f..2e08ba7 100644 --- a/k8s/service.yaml +++ b/k8s/service.yaml @@ -2,9 +2,10 @@ apiVersion: v1 kind: Service metadata: name: homepage - namespace: homepage + namespace: default labels: app.kubernetes.io/name: homepage + annotations: spec: type: ClusterIP ports: diff --git a/k8s/serviceaccount.yaml b/k8s/serviceaccount.yaml new file mode 100644 index 0000000..6d4319a --- /dev/null +++ b/k8s/serviceaccount.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: homepage + namespace: default + labels: + app.kubernetes.io/name: homepage +secrets: + - name: homepage \ No newline at end of file