first commit

This commit is contained in:
Julien Cabillot 2021-07-23 15:33:36 -04:00
parent 84e404c5f5
commit 50ce61df86
8 changed files with 153 additions and 0 deletions

48
base/depl.yml Normal file
View File

@ -0,0 +1,48 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "syncthing-app"
labels:
app: "syncthing"
spec:
template:
metadata:
name: "syncthing-app"
labels:
owner: "jcabillot"
app: "syncthing"
spec:
automountServiceAccountToken: false
containers:
- name: "syncthing"
image: "syncthing/syncthing"
env:
- name: "PUID"
value: "1000"
- name: "PGID"
value: "1000"
- name: "STGUIADDRESS"
value: "0.0.0.0:8384"
ports:
- name: "http"
containerPort: 8384
protocol: "TCP"
- name: "syncthing"
containerPort: 22000
protocol: "UDP"
volumeMounts:
- mountPath: "/data"
name: "data"
- mountPath: "/var/syncthing"
name: "config"
volumes:
- name: "data"
persistentVolumeClaim:
claimName: "data"
- name: "config"
persistentVolumeClaim:
claimName: "config"
replicas: 1
selector:
matchLabels:
app: "syncthing"

25
base/ingress.yml Normal file
View File

@ -0,0 +1,25 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "syncthing-deployment"
annotations:
kubernetes.io/ingress.class: "traefik"
traefik.ingress.kubernetes.io/router.entrypoints: "web,websecure"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- "sync.opti.cabillot.eu"
secretName: "syncthing-tls"
rules:
- host: "sync.opti.cabillot.eu"
http:
paths:
- path: "/"
pathType: "Prefix"
backend:
service:
name: "sync-svc"
port:
name: "http"

10
base/kustomization.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- depl.yml
- ingress.yml
- pv-config.yml
- pv-data.yml
- pvc-config.yml
- pvc-data.yml
- svc.yml

14
base/pv-config.yml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: sync-config
labels:
type: local
spec:
storageClassName: sync-config
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/extradata/sync-config"

14
base/pv-data.yml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: sync-data
labels:
type: local
spec:
storageClassName: sync-data
capacity:
storage: 100Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/extradata/sync-data"

15
base/pvc-config.yml Normal file
View File

@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: sync-svc
name: config
spec:
storageClassName: sync-config
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}

14
base/pvc-data.yml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: sync-svc
name: data
spec:
storageClassName: sync-data
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi

13
base/svc.yml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: 'sync-svc'
spec:
type: "ClusterIP"
ports:
- name: "http"
port: 8384
protocol: "TCP"
targetPort: 8384
selector:
app: "syncthing"