Make CaaS DNS domains configurable
[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/v1beta2
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       hostNetwork: true
32       dnsPolicy: ClusterFirstWithHostNet
33       nodeSelector:
34         nodetype: caas_master
35       securityContext:
36         runAsUser: {{ caas.uid.swift }}
37       containers:
38         - name: swift
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_USER"
52               value: "{{ swift_user_for_template.stdout }}"
53             - name: "SWIFT_TENANT"
54               value: "{{ swift_tenant_for_template.stdout }}"
55             - name: "SWIFT_PASS"
56               value: "{{ swift_password_for_template.stdout }}"
57             - name: "SWIFT_PART_POWER"
58               value: "7"
59             - name: "SWIFT_PART_HOUR"
60               value: "0"
61             - name: "SWIFT_DISK"
62               value: "swift"
63             - name: "SWIFT_REPLICAS"
64               value: "{{groups['caas_master']|length|int}}"
65 {% for host in groups['caas_master']%}
66             - name: "SWIFT_OAM{{loop.index}}_IP"
67               value: "{{ hostvars[host]['networking']['infra_internal']['ip'] }}"
68 {% endfor %}
69             - name: "SWIFT_URL"
70               value: "{{ caas.swift }}"
71           volumeMounts:
72             - name: config
73               mountPath: /etc/swift/
74             - name: store
75               mountPath: /srv/node/swift
76           livenessProbe:
77             exec:
78               command:
79                 - /bin/bash
80                 - /usr/bin/healthchecker.sh
81             initialDelaySeconds: 60
82             periodSeconds: 10
83             failureThreshold: 5
84             timeoutSeconds: 3
85       volumes:
86         - name: config
87           hostPath:
88             path: /etc/swift/main/
89         - name: store
90           hostPath:
91             path: /srv/node/swift