summaryrefslogtreecommitdiff
path: root/roles/elevate/media/templates/nextcloud-pod-spec-with-mariadb.yml.j2
blob: 05c1a3209dfdc693a308f51133949625727447a8 (plain) (blame)
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
securityContext:
  allowPrivilegeEscalation: false
containers:
- name: nextcloud
  image: "nextcloud/{{ elevate_media_nextcloud_instance_name }}:{{ elevate_media_nextcloud_instance.version }}"
  securityContext:
    runAsUser: {{ elevate_media_share_uid }}
    runAsGroup: {{ elevate_media_share_gid }}
  resources:
    limits:
      memory: "4Gi"
  env:
{% if elevate_media_nextcloud_max_upload_size is defined %}
  - name: PHP_UPLOAD_LIMIT
    value: "{{ elevate_media_nextcloud_max_upload_size }}"
{% endif %}
{% if elevate_media_nextcloud_memory_limit is defined %}
  - name: PHP_MEMORY_LIMIT
    value: "{{ elevate_media_nextcloud_memory_limit }}"
{% endif %}
  volumeMounts:
  - name: nextcloud
    mountPath: /var/www/html
  - name: config
    mountPath: /etc/apache2/sites-available/000-default.conf
    subPath: apache-site.conf
    readOnly: true
  - name: config
    mountPath: /etc/apache2/ports.conf
    subPath: ports.conf
    readOnly: true
  - name: external-share
    mountPath: /srv/external/share
  ports:
  - containerPort: 8080
    hostPort: {{ elevate_media_nextcloud_instance.port }}
    hostIP: 127.0.0.1
- name: redis
  image: "redis:{{ elevate_media_nextcloud_instance.redis.version }}"
  args:
  - --bind 127.0.0.1
  securityContext:
    runAsUser: {{ elevate_media_nextcloud_redis_uid }}
    runAsGroup: {{ elevate_media_nextcloud_redis_gid }}
  resources:
    limits:
      memory: "512Mi"
  volumeMounts:
  - name: redis
    mountPath: /data
- name: database
  image: "mariadb:{{ elevate_media_nextcloud_instance.database.version }}"
  args:
  - --transaction-isolation=READ-COMMITTED
  - --log-bin=binlog
  - --binlog-format=ROW
  securityContext:
    runAsUser: {{ elevate_media_nextcloud_db_uid }}
    runAsGroup: {{ elevate_media_nextcloud_db_gid }}
  resources:
    limits:
      memory: "2Gi"
  env:
  - name: MYSQL_RANDOM_ROOT_PASSWORD
    value: "true"
  - name: MYSQL_DATABASE
    value: nextcloud
  - name: MYSQL_USER
    value: nextcloud
  - name: MYSQL_PASSWORD
    value: "{{ elevate_media_nextcloud_instance.database.password }}"
  volumeMounts:
  - name: database
    mountPath: /var/lib/mysql
volumes:
- name: config
  hostPath:
    path: "{{ elevate_media_nextcloud_base_path }}/{{ elevate_media_nextcloud_instance_name }}/config/"
    type: Directory
- name: nextcloud
  hostPath:
    path: "{{ elevate_media_nextcloud_base_path }}/{{ elevate_media_nextcloud_instance_name }}/nextcloud"
    type: Directory
- name: redis
  hostPath:
    path: "{{ elevate_media_nextcloud_base_path }}/{{ elevate_media_nextcloud_instance_name }}/redis"
    type: Directory
- name: database
  hostPath:
    path: "{{ elevate_media_nextcloud_base_path }}/{{ elevate_media_nextcloud_instance_name }}/{{ elevate_media_nextcloud_instance.database.type }}"
    type: Directory
- name: external-share
  hostPath:
    path: /srv/_samba_/share
    type: Directory