Kubernetes 1.16.0 api reference update
[ta/caas-registry.git] / ansible / roles / swift / templates / main / swift_main.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/v1
18 kind: DaemonSet
19 metadata:
20   name: swift
21   namespace: kube-system
22 spec:
23   selector:
24     matchLabels:
25       name: swift
26   template:
27     metadata:
28       labels:
29         name: swift
30     spec:
31       priorityClassName: "system-cluster-critical"
32       hostNetwork: true
33       dnsPolicy: ClusterFirstWithHostNet
34       nodeSelector:
35         nodetype: caas_master
36       securityContext:
37         runAsUser: {{ caas.uid.swift }}
38       containers:
39         - name: swift
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               cpu: "1"
49               memory: "4Gi"
50             requests:
51               cpu: "200m"
52               memory: "1Gi"
53           env:
54             - name: "SWIFT_USER"
55               value: "{{ caas.swift_credential.user }}"
56             - name: "SWIFT_TENANT"
57               value: "{{ caas.swift_credential.tenant }}"
58             - name: "SWIFT_PASS"
59               value: "{{ caas.swift_credential.password }}"
60             - name: "SWIFT_PART_POWER"
61               value: "7"
62             - name: "SWIFT_PART_HOUR"
63               value: "0"
64             - name: "SWIFT_DISK"
65               value: "swift"
66             - name: "SWIFT_REPLICAS"
67               value: "{{groups['caas_master']|length|int}}"
68 {% for host in groups['caas_master']%}
69             - name: "SWIFT_OAM{{loop.index}}_IP"
70               value: "{{ hostvars[host]['networking']['infra_internal']['ip'] }}"
71 {% endfor %}
72             - name: "SWIFT_URL"
73               value: "{{ caas.swift }}"
74           volumeMounts:
75             - name: config
76               mountPath: /etc/swift/
77             - name: store
78               mountPath: /srv/node/swift
79           livenessProbe:
80             exec:
81               command:
82                 - /bin/bash
83                 - /usr/bin/healthchecker.sh
84             initialDelaySeconds: 60
85             periodSeconds: 10
86             failureThreshold: 5
87             timeoutSeconds: 3
88       volumes:
89         - name: config
90           hostPath:
91             path: /etc/swift/main/
92         - name: store
93           hostPath:
94             path: /srv/node/swift