| giolekva | ef76a3e | 2022-01-10 12:22:28 +0400 | [diff] [blame] | 1 | kind: Service |
| 2 | apiVersion: v1 |
| 3 | metadata: |
| 4 | name: samba |
| 5 | labels: |
| 6 | app: samba |
| 7 | spec: |
| 8 | type: LoadBalancer # ClusterIP |
| 9 | selector: |
| 10 | app: samba |
| 11 | ports: |
| 12 | - port: 445 |
| 13 | --- |
| 14 | apiVersion: apps/v1 |
| 15 | kind: Deployment |
| 16 | metadata: |
| 17 | name: samba |
| 18 | namespace: {{ .Release.Namespace }} |
| 19 | spec: |
| 20 | selector: |
| 21 | matchLabels: |
| 22 | app: samba |
| 23 | replicas: 1 |
| 24 | template: |
| 25 | metadata: |
| 26 | labels: |
| 27 | app: samba |
| 28 | spec: |
| 29 | affinity: |
| 30 | podAffinity: |
| 31 | requiredDuringSchedulingIgnoredDuringExecution: |
| 32 | - labelSelector: |
| 33 | matchExpressions: |
| 34 | - key: app |
| 35 | operator: In |
| 36 | values: |
| 37 | - torrent |
| 38 | topologyKey: "kubernetes.io/hostname" |
| 39 | volumes: |
| 40 | - name: data |
| 41 | persistentVolumeClaim: |
| 42 | claimName: data |
| 43 | containers: |
| 44 | - name: samba |
| 45 | image: {{ .Values.samba.image.repository }}:{{ .Values.samba.image.tag }} |
| 46 | imagePullPolicy: {{ .Values.samba.image.pullPolicy }} |
| 47 | env: |
| 48 | - name: PERMISSIONS |
| 49 | value: "0777" |
| 50 | - name: USERNAME |
| 51 | valueFrom: |
| 52 | secretKeyRef: |
| 53 | name: qbittorrent-samba-creds |
| 54 | key: username |
| 55 | - name: PASSWORD |
| 56 | valueFrom: |
| 57 | secretKeyRef: |
| 58 | name: qbittorrent-samba-creds |
| 59 | key: password |
| 60 | ports: |
| 61 | - containerPort: 139 |
| 62 | - containerPort: 445 |
| 63 | volumeMounts: |
| 64 | - name: data |
| 65 | mountPath: /data |
| 66 | readOnly: false |
| 67 | args: |
| 68 | - -u |
| 69 | - $(USERNAME);$(PASSWORD) |
| 70 | - -s |
| 71 | - share;/data/;yes;no;no;all;none |
| 72 | - -p |
| 73 | # resources: |
| 74 | # requests: |
| 75 | # memory: "10Mi" |
| 76 | # cpu: "10m" |
| 77 | # limits: |
| 78 | # memory: "20Mi" |
| 79 | # cpu: "100m" |