Skip to content

Commit

Permalink
feat(kube-nas): setup echo-server
Browse files Browse the repository at this point in the history
  • Loading branch information
tyriis committed Oct 15, 2023
1 parent 406c5ec commit cccc6b9
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 1 deletion.
1 change: 0 additions & 1 deletion kubernetes/kube-nas/apps/cert-manager/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ metadata:
name: cert-manager
labels:
kustomize.toolkit.fluxcd.io/prune: disabled
goldilocks.fairwinds.com/enabled: "true"
91 changes: 91 additions & 0 deletions kubernetes/kube-nas/apps/default/echo-server/app/helm-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta1.json
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: echo-server
spec:
interval: 15m
chart:
spec:
chart: app-template
version: 2.0.3
sourceRef:
kind: HelmRepository
name: bjw-s-charts
namespace: flux-system
maxHistory: 15
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
# https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template
controllers:
main:
containers:
main:
image:
repository: docker.io/jmalloc/echo-server
tag: 0.3.5
strategy: RollingUpdate
resources:
requests:
cpu: 5m
memory: 10Mi
limits:
memory: 50Mi
probes:
liveness: &probes
enabled: true
custom: true
spec:
httpGet:
path: /health
port: &port 8080
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
readiness: *probes
startup:
enabled: false

service:
main:
ports:
http:
port: *port

ingress:
main:
enabled: true
className: traefik
annotations:
cert-manager.io/cluster-issuer: letsencrypt-production
kubernetes.io/tls-acme: "true"
traefik.ingress.kubernetes.io/router.middlewares: traefik-ingress-sso@kubernetescrd
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/affinity: "true"
traefik.ingress.kubernetes.io/router.tls: "true"
external-dns.alpha.kubernetes.io/target: "${SECRET_CLOUDFLARE_TUNNEL_ID}.cfargotunnel.com"
hajimari.io/icon: video-input-antenna
hajimari.io/enable: "true"
hosts:
- host: &host "{{ .Release.Name }}.${SECRET_DOMAIN}"
paths:
- path: /
pathType: Prefix
service:
name: main
port: http
tls:
- hosts:
- *host
secretName: "{{ .Release.Name }}-tls"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- ./helm-release.yaml
commonLabels:
app.kubernetes.io/name: echo-server
app.kubernetes.io/instance: echo-server
17 changes: 17 additions & 0 deletions kubernetes/kube-nas/apps/default/echo-server/flux-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1beta2.json
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: apps-echo-server
namespace: flux-system
labels:
substitution.flux.home.arpa/enabled: "true"
spec:
interval: 10m
path: ./kubernetes/kube-nas/apps/default/echo-server/app
prune: true
sourceRef:
kind: GitRepository
name: home-ops
wait: true
7 changes: 7 additions & 0 deletions kubernetes/kube-nas/apps/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
- ./echo-server/flux-sync.yaml
7 changes: 7 additions & 0 deletions kubernetes/kube-nas/apps/default/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: default
labels:
kustomize.toolkit.fluxcd.io/prune: disabled

0 comments on commit cccc6b9

Please sign in to comment.