-
Notifications
You must be signed in to change notification settings - Fork 70
/
timemachine-k3s.yaml
144 lines (144 loc) · 3.1 KB
/
timemachine-k3s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
apiVersion: v1
kind: Namespace
metadata:
name: timemachine
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-path-retain
provisioner: rancher.io/local-path
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
---
apiVersion: v1
kind: Service
metadata:
name: timemachine-udp
namespace: timemachine
labels:
app: timemachine
spec:
ports:
- port: 137
name: udp137
protocol: UDP
- port: 138
name: udp138
protocol: UDP
type: ClusterIP
selector:
app: timemachine
---
apiVersion: v1
kind: Service
metadata:
name: timemachine-tcp
namespace: timemachine
labels:
app: timemachine
spec:
ports:
- port: 139
name: tcp139
- port: 445
name: tcp445
type: ClusterIP
selector:
app: timemachine
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: timemachine
namespace: timemachine
spec:
serviceName: timemachine-udp
replicas: 1 # Never go > 1!
selector:
matchLabels:
app: timemachine
template:
metadata:
labels:
app: timemachine
spec:
hostNetwork: true # otherwise the auto-discovery does not work
containers:
- name: timemachine
image: mbentley/timemachine:smb
ports:
- containerPort: 137
name: udp137
protocol: UDP
- containerPort: 138
name: udp138
protocol: UDP
- containerPort: 139
name: tcp139
- containerPort: 445
name: tcp445
volumeMounts:
- name: tm
mountPath: /opt/timemachine
- name: run-samba
mountPath: /run/samba
env:
- name: ADVERTISED_HOSTNAME
value: ""
- name: CUSTOM_SMB_CONF
value: "false"
- name: CUSTOM_USER
value: "false"
- name: DEBUG_LEVEL
value: "1"
- name: MIMIC_MODEL
value: "TimeCapsule8,119"
- name: EXTERNAL_CONF
value: ""
- name: HIDE_SHARES
value: "no"
- name: TM_USERNAME
value: "timemachine"
- name: TM_GROUPNAME
value: "timemachine"
- name: TM_UID
value: "1000"
- name: TM_GID
value: "1000"
- name: PASSWORD
value: "timemachine"
- name: SET_PERMISSIONS
value: "false"
- name: SHARE_NAME
value: "TimeMachine"
- name: SMB_INHERIT_PERMISSIONS
value: "no"
- name: SMB_NFS_ACES
value: "no"
- name: SMB_METADATA
value: "stream"
- name: SMB_PORT
value: "445"
- name: SMB_VFS_OBJECTS
value: "fruit streams_xattr"
- name: VOLUME_SIZE_LIMIT
value: "0"
- name: WORKGROUP
value: "WORKGROUP"
volumes:
- name: var-lib-samba
emptyDir: {}
- name: var-cache-samba
emptyDir: {}
- name: run-samba
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: tm
spec:
storageClassName: local-path-retain
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 500Gi