7 Commits
1.0.0 ... 1.1.2

Author SHA1 Message Date
ducoterra
745e0734be new deploy strat 2020-05-16 11:08:36 -04:00
ducoterra
3af23e0061 fix kubectl stuff 2020-05-16 10:01:26 -04:00
ducoterra
d79697bc56 add helm stuff 2020-05-16 09:54:45 -04:00
ducoterra
c9330366d1 Merge branch 'master' of gitlab.ducoterra.net:services/homer 2020-05-14 16:13:05 -04:00
ducoterra
7d8e3363e7 add zipkin 2020-05-14 16:11:51 -04:00
Reese
312547b103 Update config.yml 2020-05-13 00:17:52 +00:00
ducoterra
2278dc03fb capitalize gitlab 2020-05-12 13:21:34 -04:00
10 changed files with 154 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
variables:
CI_PROJECT_NAME: "homer"
CI_PROJECT_DIR: "."
CI_REGISTRY_IMAGE: hub.ducoterra.net/ducoterra/homer
@@ -30,10 +31,8 @@ deploy_to_prod:
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
- apt -qq update >> /dev/null && apt -qq install -y curl >> /dev/null
- curl -L -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
- chmod +x /usr/local/bin/kubectl
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- helm template homer --set tag=1.1.1 ./helm | kubectl apply -f -

BIN
assets/tools/zipkin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -34,7 +34,7 @@ services:
icon: "fas fa-code-branch"
items:
- name: "Gitlab"
logo: "assets/tools/gitlab.svg"
logo: "assets/tools/Gitlab.svg"
tag: "CI"
url: "https://gitlab.ducoterra.net/"
target: '_blank'
@@ -58,6 +58,7 @@ services:
logo: "assets/tools/jellyfin.png"
url: "https://jellyfin.ducoterra.net"
tag: "Entertainment"
target: '_blank'
- name: "Monitoring"
icon: "fas fa-heartbeat"
items:
@@ -65,10 +66,17 @@ services:
logo: "assets/tools/grafana.png"
url: "https://grafana.ducoterra.net/"
tag: "Monitoring"
target: '_blank'
- name: "Graphite"
logo: "assets/tools/graphite.png"
url: "https://graphite.ducoterra.net/"
tag: "Monitoring"
target: '_blank'
- name: "Zipkin"
logo: "assets/tools/zipkin.png"
url: "https://zipkin.ducoterra.net/"
tag: "Monitoring"
target: '_blank'
- name: "Network"
icon: "fas fa-server"
items:

23
helm/.helmignore Normal file
View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

23
helm/Chart.yaml Normal file
View File

@@ -0,0 +1,23 @@
apiVersion: v2
name: helm
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0

View File

@@ -1,19 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dashboard
name: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: dashboard
app: {{ .Release.Name }}
template:
metadata:
labels:
app: dashboard
app: {{ .Release.Name }}
spec:
containers:
- name: dashboard
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
- name: {{ .Release.Name }}
image: {{ .Values.image }}:{{ .Values.tag }}
resources:
limits:
memory: "128Mi"

View File

@@ -1,7 +1,7 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard-internal-tls
name: {{ .Release.Name }}-internal-tls
annotations:
kubernetes.io/ingress.class: traefik-internal
spec:
@@ -12,10 +12,10 @@ spec:
domains:
- main: "*.ducoterra.net"
routes:
- match: Host(`dashboard.ducoterra.net`)
- match: Host(`{{ .Release.Name }}.ducoterra.net`)
kind: Rule
services:
- name: dashboard
- name: {{ .Release.Name }}
port: 8080
---
@@ -23,17 +23,17 @@ spec:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard-internal-web
name: {{ .Release.Name }}-internal-web
annotations:
kubernetes.io/ingress.class: traefik-internal
spec:
entryPoints:
- web
routes:
- match: Host(`dashboard.ducoterra.net`)
- match: Host(`{{ .Release.Name }}.ducoterra.net`)
kind: Rule
services:
- name: dashboard
- name: {{ .Release.Name }}
port: 8080
middlewares:
- name: httpsredirect

View File

@@ -1,10 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: dashboard
name: {{ .Release.Name }}
spec:
selector:
app: dashboard
app: {{ .Release.Name }}
ports:
- port: 8080
targetPort: 8080

1
helm/values.yaml Normal file
View File

@@ -0,0 +1 @@
image: hub.ducoterra.net/ducoterra/homer

79
kubectl Normal file
View File

@@ -0,0 +1,79 @@
---
# Source: helm/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: homer
spec:
selector:
app: homer
ports:
- port: 8080
targetPort: 8080
---
# Source: helm/templates/deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: homer
spec:
selector:
matchLabels:
app: homer
template:
metadata:
labels:
app: homer
spec:
containers:
- name: homer
image: hub.ducoterra.net/ducoterra/homer:1.1.1
resources:
limits:
memory: "128Mi"
cpu: "250m"
requests:
memory: "64Mi"
cpu: "1m"
ports:
- containerPort: 8080
---
# Source: helm/templates/ingress.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: homer-internal-tls
annotations:
kubernetes.io/ingress.class: traefik-internal
spec:
entryPoints:
- websecure
tls:
certResolver: myresolver
domains:
- main: "*.ducoterra.net"
routes:
- match: Host(`homer.ducoterra.net`)
kind: Rule
services:
- name: homer
port: 8080
---
# Source: helm/templates/ingress.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: homer-internal-web
annotations:
kubernetes.io/ingress.class: traefik-internal
spec:
entryPoints:
- web
routes:
- match: Host(`homer.ducoterra.net`)
kind: Rule
services:
- name: homer
port: 8080
middlewares:
- name: httpsredirect