Unifi--;Refactor DroneCI

This commit is contained in:
Danny Bessems 2023-12-29 10:31:19 +11:00
parent 52bbd42046
commit 75cd0f2704
6 changed files with 22 additions and 146 deletions

View File

@ -2,6 +2,7 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: drone name: drone
namespace: drone
spec: spec:
ports: ports:
- protocol: TCP - protocol: TCP
@ -14,6 +15,7 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: drone name: drone
namespace: drone
labels: labels:
app: drone app: drone
spec: spec:
@ -83,6 +85,7 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: drone name: drone
namespace: drone
labels: labels:
app: drone app: drone
--- ---
@ -90,6 +93,7 @@ apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute kind: IngressRoute
metadata: metadata:
name: drone name: drone
namespace: drone
spec: spec:
entryPoints: entryPoints:
- websecure - websecure
@ -116,17 +120,17 @@ spec:
flexVolume: flexVolume:
driver: mount/smb driver: mount/smb
secretRef: secretRef:
name: smb-secret name: flexvolsmb-credentials
options: options:
opts: domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8,nobrl opts: file_mode=0777,dir_mode=0777,iocharset=utf8,nobrl
server: 192.168.11.225 server: 192.168.154.225
share: /K3s.Volumes/drone/data share: /K3s.Volumes/drone/data
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: flexvolsmb-drone-data name: flexvolsmb-drone-data
namespace: default namespace: drone
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
@ -148,17 +152,17 @@ spec:
flexVolume: flexVolume:
driver: mount/smb driver: mount/smb
secretRef: secretRef:
name: smb-secret name: flexvolsmb-credentials
options: options:
opts: domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8 opts: file_mode=0777,dir_mode=0777,iocharset=utf8
server: 192.168.11.225 server: 192.168.154.225
share: /K3s.Volumes/traefikcertsdumper/export share: /K3s.Volumes/traefikcertsdumper/export
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: flexvolsmb-drone-certs name: flexvolsmb-drone-certs
namespace: default namespace: drone
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
@ -180,17 +184,17 @@ spec:
flexVolume: flexVolume:
driver: mount/smb driver: mount/smb
secretRef: secretRef:
name: smb-secret name: flexvolsmb-credentials
options: options:
opts: domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8 opts: file_mode=0777,dir_mode=0777,iocharset=utf8
server: 192.168.11.225 server: 192.168.154.225
share: /K3s.Volumes/lighttpd/websites/sn.itch.fyi/Repository/rel share: /K3s.Volumes/lighttpd/websites/sn.itch.fyi/Repository/rel
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: flexvolsmb-drone-output name: flexvolsmb-drone-output
namespace: default namespace: drone
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
@ -212,17 +216,17 @@ spec:
flexVolume: flexVolume:
driver: mount/smb driver: mount/smb
secretRef: secretRef:
name: smb-secret name: flexvolsmb-credentials
options: options:
opts: domain=bessems.eu,file_mode=0777,dir_mode=0777,iocharset=utf8 opts: file_mode=0777,dir_mode=0777,iocharset=utf8
server: 192.168.11.225 server: 192.168.154.225
share: /K3s.Volumes/drone/scratch share: /K3s.Volumes/drone/scratch
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: flexvolsmb-drone-scratch name: flexvolsmb-drone-scratch
namespace: default namespace: drone
spec: spec:
accessModes: accessModes:
- ReadWriteMany - ReadWriteMany
@ -234,8 +238,8 @@ spec:
kind: Role kind: Role
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
namespace: default
name: drone name: drone
namespace: drone
rules: rules:
- apiGroups: - apiGroups:
- "" - ""
@ -261,7 +265,7 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
name: drone name: drone
namespace: default namespace: drone
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: drone name: drone

View File

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: unifi

View File

@ -1,44 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: unifi
namespace: unifi
labels:
app: unifi
spec:
replicas: 1
selector:
matchLabels:
app: unifi
strategy:
type: Recreate
template:
metadata:
labels:
app: unifi
spec:
containers:
- name: unifi
image: bv11-cr01.bessems.eu/proxy/linuxserver/unifi-controller
ports:
- name: web
containerPort: 8443
- name: comm
containerPort: 8080
- name: bandwidth
containerPort: 6789
- name: syslog
containerPort: 5514
- name: stun
containerPort: 3479
protocol: UDP
- name: discovery
containerPort: 10001
protocol: UDP
volumeMounts:
- mountPath: /config
name: longhorn-unifi-config
volumes:
- name: longhorn-unifi-config
persistentVolumeClaim:
claimName: longhorn-unifi-config

View File

@ -1,19 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: unifi
namespace: unifi
spec:
entryPoints:
- websecure
routes:
- match: Host(`wifi.spamasaurus.com`)
kind: Rule
services:
- name: unifi
namespace: unifi
port: 8443
scheme: https
# middlewares:
# - name: security-headers@file
# - name: compression@file

View File

@ -1,12 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: longhorn-unifi-config
namespace: unifi
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 2Gi

View File

@ -1,49 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: unifi
namespace: unifi
spec:
ports:
- protocol: TCP
name: web
port: 8443
selector:
app: unifi
---
apiVersion: v1
kind: Service
metadata:
name: unifi-tcp
namespace: unifi
spec:
type: LoadBalancer
ports:
- protocol: TCP
name: comm
port: 8080
- protocol: TCP
name: bandwidth
port: 6789
- protocol: TCP
name: syslog
port: 5514
selector:
app: unifi
---
apiVersion: v1
kind: Service
metadata:
name: unifi-udp
namespace: unifi
spec:
type: LoadBalancer
ports:
- protocol: UDP
name: stun
port: 3479
- protocol: UDP
name: discovery
port: 10001
selector:
app: unifi