8f6f9403820fd2e7e49186b79436f8ae4c8174f1
[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       hostNetwork: true
32       dnsPolicy: ClusterFirstWithHostNet
33       nodeSelector:
34         nodename: caas_master1
35       securityContext:
36         runAsUser: {{ caas.uid.swift }}
37       containers:
38         - name: swift-update
39           image: {{ container_image_names | select('search', '/swift') | list | last }}
40           securityContext:
41             capabilities:
42               add: ["NET_BIND_SERVICE"]
43           args:
44             - BACKEND
45           resources:
46             limits:
47               memory: "4Gi"
48             requests:
49               memory: "1Gi"
50           env:
51             - name: "SWIFT_PART_POWER"
52               value: "7"
53             - name: "SWIFT_PART_HOUR"
54               value: "0"
55             - name: "SWIFT_DISK"
56               value: "swift"
57             - name: "SWIFT_REPLICAS"
58               value: "1"
59             - name: "SWIFT_OAM1_IP"
60               value: "{{ hostvars[groups.caas_master[0]]['networking']['infra_internal']['ip'] }}"
61           volumeMounts:
62             - name: config
63               mountPath: /etc/swift/
64             - name: store
65               mountPath: /srv/node/swift
66       volumes:
67         - name: config
68           hostPath:
69             path: /etc/swift/update/
70         - name: store
71           hostPath:
72             path: /srv/node/swift-update