syncthing working

This commit is contained in:
Waylon Walker 2023-10-29 18:03:20 -05:00
parent f3422bfb4a
commit 12452de0b5
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
4 changed files with 216 additions and 19 deletions

172
syncthing/deployment.yaml Normal file
View file

@ -0,0 +1,172 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n syncthing
kompose.service.expose: syncthing.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: syncthing
name: syncthing
namespace: syncthing
spec:
ports:
- name: "8384"
port: 8384
targetPort: 8384
- name: "22000"
port: 22000
targetPort: 22000
- name: 22000-udp
port: 22000
protocol: UDP
targetPort: 22000
- name: "21027"
port: 21027
protocol: UDP
targetPort: 21027
selector:
io.kompose.service: syncthing
status:
loadBalancer: {}
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: syncthing
namespace: syncthing
spec: {}
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n syncthing
kompose.service.expose: syncthing.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: syncthing
name: syncthing
namespace: syncthing
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: syncthing
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n syncthing
kompose.service.expose: syncthing.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.network/proxy: "true"
io.kompose.service: syncthing
spec:
containers:
- env:
- name: PGID
value: "1000"
- name: PUID
value: "1000"
- name: TZ
value: America/Chicago
image: ghcr.io/linuxserver/syncthing
name: syncthing
ports:
- containerPort: 8384
protocol: TCP
- containerPort: 22000
protocol: TCP
- containerPort: 22000
protocol: UDP
- containerPort: 21027
protocol: UDP
resources: {}
volumeMounts:
- mountPath: /config
name: syncthing-config
- mountPath: /data
name: syncthing
restartPolicy: Always
volumes:
- name: syncthing-config
persistentVolumeClaim:
claimName: syncthing-config
- name: syncthing
persistentVolumeClaim:
claimName: syncthing
status: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n syncthing
kompose.service.expose: syncthing.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: syncthing
name: syncthing
namespace: syncthing
spec:
rules:
- host: syncthing.wayl.one
http:
paths:
- backend:
service:
name: syncthing
port:
number: 8384
path: /
pathType: Prefix
status:
loadBalancer: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: syncthing-config
name: syncthing-config
namespace: syncthing
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: syncthing
name: syncthing
namespace: syncthing
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

View file

@ -4,7 +4,6 @@ services:
syncthing: syncthing:
image: ghcr.io/linuxserver/syncthing image: ghcr.io/linuxserver/syncthing
container_name: syncthing container_name: syncthing
restart: unless-stopped
security_opt: security_opt:
- no-new-privileges:true - no-new-privileges:true
networks: networks:
@ -14,26 +13,21 @@ services:
- PGID=1000 - PGID=1000
- TZ=America/Chicago - TZ=America/Chicago
volumes: volumes:
- /etc/localtime:/etc/localtime:ro - syncthing-config:/config
- /tank/syncthing/config:/config - syncthing:/data
- /tank/syncthing:/data ports:
# ports: - 8384
# - 8384:8384 - 22000/tcp
# - 22000:22000 - 22000/udp
# - 21027:21027/udp - 21027/udp
labels: labels:
- "traefik.enable=true" kompose.service.expose: syncthing.wayl.one
- "traefik.http.routers.syncthing.entrypoints=http" # kompose.image-pull-secret: regcred
- "traefik.http.routers.syncthing.rule=Host(`syncthing.${URL}`)"
- "traefik.http.middlewares.syncthing-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.syncthing.middlewares=syncthing-https-redirect"
- "traefik.http.routers.syncthing-secure.entrypoints=https"
- "traefik.http.routers.syncthing-secure.rule=Host(`syncthing.${URL}`)"
- "traefik.http.routers.syncthing-secure.tls=true"
- "traefik.http.routers.syncthing-secure.service=syncthing"
- "traefik.http.services.syncthing.loadbalancer.server.port=8384"
- "traefik.docker.network=proxy"
networks: networks:
proxy: proxy:
external: true external: true
volumes:
syncthing: {}
syncthing-config: {}

31
syncthing/justfile Normal file
View file

@ -0,0 +1,31 @@
default: cred convert deploy viz
update: convert patch
create-ns:
kubectl create ns syncthing
cred:
kubectl get secret -n default regcred --output=yaml -o yaml | sed 's/namespace: default/namespace: syncthing/' | kubectl apply -n syncthing -f - && echo deployed secret || echo secret exists
convert:
kompose convert -o deployment.yaml -n syncthing
deploy:
kubectl apply -f deployment.yaml
delete:
kubectl delete all --all -n syncthing --timeout=0s
viz:
k8sviz -n syncthing --kubeconfig $KUBECONFIG -t png -o syncthing-k8s.png
restart:
kubectl rollout restart -n syncthing deployment/syncthing
patch:
kubectl patch -f deployment.yaml
describe:
kubectl get deployment -n syncthing
kubectl get rs -n syncthing
kubectl get pod -n syncthing
kubectl get svc -n syncthing
kubectl get ing -n syncthing
describe-pod:
kubectl describe pod -n syncthing
logs:
kubectl logs --all-containers -l io.kompose.service=syncthing-wayl-one -n syncthing -f

BIN
syncthing/syncthing-k8s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB