a98a5b92d54d63c3c38722184e752e6b003f20ff
[ta/caas-registry.git] / ansible / roles / swift / templates / update / swift_update.yml
1 {#
2 Copyright 2019 Nokia
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 #}
16 ---
17 apiVersion: apps/v1beta2
18 kind: DaemonSet
19 metadata:
20   name: swift-update
21   namespace: kube-system
22 spec:
23   selector:
24     matchLabels:
25       name: swift-update
26   template:
27     metadata:
28       labels:
29         name: swift-update
30     spec:
31       priorityClassName: "system-cluster-critical"
32       hostNetwork: true
33       dnsPolicy: ClusterFirstWithHostNet
34       nodeSelector:
35         nodename: caas_master1
36       securityContext:
37         runAsUser: {{ caas.uid.swift }}
38       containers:
39         - name: swift-update
40           image: {{ container_image_names | select('search', '/swift') | list | last }}
41           securityContext:
42             capabilities:
43               add: ["NET_BIND_SERVICE", "SETGID", "SETUID"]
44           args:
45             - BACKEND
46           resources:
47             limits:
48               memory: "4Gi"
49             requests:
50               cpu: "200m"
51               memory: "1Gi"
52           env:
53             - name: "SWIFT_PART_POWER"
54               value: "7"
55             - name: "SWIFT_PART_HOUR"
56               value: "0"
57             - name: "SWIFT_DISK"
58               value: "swift"
59             - name: "SWIFT_REPLICAS"
60               value: "1"
61             - name: "SWIFT_OAM1_IP"
62               value: "{{ hostvars[groups.caas_master[0]]['networking']['infra_internal']['ip'] }}"
63             - name: "SWIFT_URL"
64               value: "{{ caas.swift }}"
65           volumeMounts:
66             - name: config
67               mountPath: /etc/swift/
68             - name: store
69               mountPath: /srv/node/swift
70       volumes:
71         - name: config
72           hostPath:
73             path: /etc/swift/update/
74         - name: store
75           hostPath:
76             path: /srv/node/swift-update