commit 6d79f58388ad0b0d9f07906ffca55c2eea537ea5 Author: ducoterra Date: Tue May 12 13:19:10 2020 -0400 init diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..ba6f609 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,39 @@ +variables: + CI_PROJECT_DIR: "." + CI_REGISTRY_IMAGE: hub.ducoterra.net/ducoterra/homer + +stages: + - build + - test + - deploy + +build: + only: + variables: + - $CI_COMMIT_TAG + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - echo $DEPLOY + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG + +deploy_to_prod: + variables: + DEPLOY: prod + stage: deploy + only: + variables: + - $CI_COMMIT_TAG + image: + name: debian:10 + entrypoint: [""] + script: + - apt -qq update >> /dev/null && apt -qq install -y curl gettext >> /dev/null + - curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl + - chmod +x ./kubectl + - mkdir /deploy + - for f in $(find k8s -regex '.*\.ya*ml'); do envsubst < $f > "/deploy/$(basename $f)"; done + - for f in $(find k8s/prod -regex '.*\.ya*ml'); do envsubst < $f > "/deploy/$(basename $f)"; done + - ./kubectl apply -f /deploy \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..be8d41e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM b4bz/homer:latest + +COPY config.yml /www/config.yml +COPY assets /www/assets \ No newline at end of file diff --git a/assets/favicon.png b/assets/favicon.png new file mode 100644 index 0000000..6fa8ee8 Binary files /dev/null and b/assets/favicon.png differ diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..6fa8ee8 Binary files /dev/null and b/assets/logo.png differ diff --git a/assets/tools/Gitlab.svg b/assets/tools/Gitlab.svg new file mode 100644 index 0000000..ea334d6 --- /dev/null +++ b/assets/tools/Gitlab.svg @@ -0,0 +1,28 @@ + + + + press-kit-icon + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/tools/elastic.png b/assets/tools/elastic.png new file mode 100644 index 0000000..11d655f Binary files /dev/null and b/assets/tools/elastic.png differ diff --git a/assets/tools/freenas.jpeg b/assets/tools/freenas.jpeg new file mode 100644 index 0000000..feb179a Binary files /dev/null and b/assets/tools/freenas.jpeg differ diff --git a/assets/tools/grafana.png b/assets/tools/grafana.png new file mode 100644 index 0000000..65de946 Binary files /dev/null and b/assets/tools/grafana.png differ diff --git a/assets/tools/graphite.png b/assets/tools/graphite.png new file mode 100644 index 0000000..43098e3 Binary files /dev/null and b/assets/tools/graphite.png differ diff --git a/assets/tools/jellyfin.png b/assets/tools/jellyfin.png new file mode 100644 index 0000000..1135355 Binary files /dev/null and b/assets/tools/jellyfin.png differ diff --git a/assets/tools/jellyfin.svg b/assets/tools/jellyfin.svg new file mode 100644 index 0000000..7dd2150 --- /dev/null +++ b/assets/tools/jellyfin.svg @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/assets/tools/jenkins.png b/assets/tools/jenkins.png new file mode 100644 index 0000000..6afeb65 Binary files /dev/null and b/assets/tools/jenkins.png differ diff --git a/assets/tools/kibana.png b/assets/tools/kibana.png new file mode 100644 index 0000000..c38b32b Binary files /dev/null and b/assets/tools/kibana.png differ diff --git a/assets/tools/monit.png b/assets/tools/monit.png new file mode 100644 index 0000000..1aa8c95 Binary files /dev/null and b/assets/tools/monit.png differ diff --git a/assets/tools/nextcloud.png b/assets/tools/nextcloud.png new file mode 100644 index 0000000..1cbc438 Binary files /dev/null and b/assets/tools/nextcloud.png differ diff --git a/assets/tools/pihole.jpeg b/assets/tools/pihole.jpeg new file mode 100644 index 0000000..9a4f145 Binary files /dev/null and b/assets/tools/pihole.jpeg differ diff --git a/assets/tools/pihole.png b/assets/tools/pihole.png new file mode 100644 index 0000000..9758df4 Binary files /dev/null and b/assets/tools/pihole.png differ diff --git a/assets/tools/pingdom.png b/assets/tools/pingdom.png new file mode 100644 index 0000000..ec290ed Binary files /dev/null and b/assets/tools/pingdom.png differ diff --git a/assets/tools/protect.png b/assets/tools/protect.png new file mode 100644 index 0000000..a812de5 Binary files /dev/null and b/assets/tools/protect.png differ diff --git a/assets/tools/rabbitmq.png b/assets/tools/rabbitmq.png new file mode 100644 index 0000000..90e2178 Binary files /dev/null and b/assets/tools/rabbitmq.png differ diff --git a/assets/tools/traefik.png b/assets/tools/traefik.png new file mode 100644 index 0000000..7cce508 Binary files /dev/null and b/assets/tools/traefik.png differ diff --git a/assets/tools/unifi.png b/assets/tools/unifi.png new file mode 100644 index 0000000..d4bda42 Binary files /dev/null and b/assets/tools/unifi.png differ diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..7865b10 --- /dev/null +++ b/config.yml @@ -0,0 +1,104 @@ +--- +# Homepage configuration +# See https://fontawesome.com/icons for icons options + +title: "Reese's Homelab" +subtitle: "Duconet" +# logo: "assets/logo.png" +icon: "fas fa-database" # Optional icon +footer: false + +# Optional message +# message: + # url: https://.... + # style: "is-dark" # See https://bulma.io/documentation/components/message/#colors for styling options. + # title: "Demo !" + # content: "This is a dummy homepage demo. Find more information on github.com/bastienwirtz/homer" + +# Optional navbar +# links: [] # Allows for navbar (dark mode, layout, and search) without any links +# links: +# - name: "ansible" +# icon: "fab fa-github" +# url: "https://github.com/bastienwirtz/homer" +# target: '_blank' # optionnal html a tag target attribute +# - name: "Wiki" +# icon: "fas fa-book" +# url: "https://www.wikipedia.org/" + +# Services +# First level array represent a group. +# Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed). +services: + - name: "DevOps" + icon: "fas fa-code-branch" + items: + - name: "Gitlab" + logo: "assets/tools/gitlab.svg" + tag: "CI" + url: "https://gitlab.ducoterra.net/" + target: '_blank' + - name: "Storage" + icon: "fas fa-save" + items: + - name: "Nextcloud" + logo: "assets/tools/nextcloud.png" + tag: "Storage" + url: "https://nextcloud.ducoterra.net/" + target: '_blank' + - name: "Freenas" + logo: "assets/tools/freenas.jpeg" + tag: "Storage" + url: "https://freenas.ducoterra.net/" + target: '_blank' + - name: "Entertainment" + icon: "fas fa-photo-video" + items: + - name: "Jellyfin" + logo: "assets/tools/jellyfin.png" + url: "https://jellyfin.ducoterra.net" + tag: "Entertainment" + - name: "Monitoring" + icon: "fas fa-heartbeat" + items: + - name: "Grafana" + logo: "assets/tools/grafana.png" + url: "https://grafana.ducoterra.net/" + tag: "Monitoring" + - name: "Graphite" + logo: "assets/tools/graphite.png" + url: "https://graphite.ducoterra.net/" + tag: "Monitoring" + - name: "Network" + icon: "fas fa-server" + items: + - name: "Unifi" + logo: assets/tools/unifi.png + tag: "Network" + url: "https://unifi.ui.com" + target: '_blank' + - name: "Protect" + logo: assets/tools/protect.png + tag: "Network" + url: "https://protect.ui.com/" + target: '_blank' + - name: "Traefik Internal" + logo: assets/tools/traefik.png + tag: "Network" + url: "https://traefik-internal.ducoterra.net/" + target: '_blank' + - name: "Traefik External" + logo: assets/tools/traefik.png + tag: "Network" + url: "https://traefik-external.ducoterra.net/" + target: '_blank' + - name: "Pihole1" + logo: assets/tools/pihole.jpeg + tag: "Network" + url: "https://pihole1.ducoterra.net/" + target: '_blank' + - name: "Pihole2" + logo: assets/tools/pihole.jpeg + tag: "Network" + url: "https://pihole2.ducoterra.net/" + target: '_blank' \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..43b5d30 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3' + +services: + homer: + build: . + image: hub.ducoterra.net/ducoterra/homer:1.0.0 + ports: + - 8080:8080 + volumes: + - ./config.yml:/www/config.yml + - ./assets:/www/assets \ No newline at end of file diff --git a/k8s/deploy.yaml b/k8s/deploy.yaml new file mode 100644 index 0000000..f302c66 --- /dev/null +++ b/k8s/deploy.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: dashboard +spec: + selector: + matchLabels: + app: dashboard + template: + metadata: + labels: + app: dashboard + spec: + containers: + - name: dashboard + image: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG + resources: + limits: + memory: "128Mi" + cpu: "250m" + requests: + memory: "64Mi" + cpu: "1m" + ports: + - containerPort: 8080 \ No newline at end of file diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml new file mode 100644 index 0000000..b186e64 --- /dev/null +++ b/k8s/ingress.yaml @@ -0,0 +1,39 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: dashboard-internal-tls + annotations: + kubernetes.io/ingress.class: traefik-internal +spec: + entryPoints: + - websecure + tls: + certResolver: myresolver + domains: + - main: "*.ducoterra.net" + routes: + - match: Host(`dashboard.ducoterra.net`) + kind: Rule + services: + - name: dashboard + port: 8080 + +--- + +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: dashboard-internal-web + annotations: + kubernetes.io/ingress.class: traefik-internal +spec: + entryPoints: + - web + routes: + - match: Host(`dashboard.ducoterra.net`) + kind: Rule + services: + - name: dashboard + port: 8080 + middlewares: + - name: httpsredirect \ No newline at end of file diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..dac0db5 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: dashboard +spec: + selector: + app: dashboard + ports: + - port: 8080 + targetPort: 8080 \ No newline at end of file