Add maintenance toleration for caas-registry
[ta/caas-registry.git] / ansible / roles / registry / templates / update / docker-registry-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/v1
18 kind: DaemonSet
19 metadata:
20   name: registry-update
21   namespace: kube-system
22 spec:
23   selector:
24     matchLabels:
25       name: registry-update
26   template:
27     metadata:
28       labels:
29         name: registry-update
30     spec:
31       priorityClassName: "system-cluster-critical"
32       dnsPolicy: ClusterFirst
33       nodeSelector:
34         nodetype: caas_master
35       tolerations:
36       - key: "node-maintenancemode"
37         value: "enabled"
38         operator: "Equal"
39         effect: "NoExecute"
40       securityContext:
41         runAsUser: {{ caas.uid.dockerreg }}
42       containers:
43         - name: registry-update
44           image: {{ container_image_names | select('search', '/registry:') | list | last }}
45           env:
46             - name: INTERFACE_NAME
47               value: "{{ caas.internal_flannel_interface }}"
48             - name: REGISTRY_PORT
49               value: "{{ caas.update_registry_port }}"
50             - name: REGISTRY_CONFIG
51               value: /etc/docker-registry/docker-registry-update-config.yml
52           resources:
53             requests:
54               cpu: "10m"
55           volumeMounts:
56             - name: time-mount
57               mountPath: /etc/localtime
58               readOnly: true
59             - name: config
60               mountPath: /etc/docker-registry/
61               readOnly: true
62             - name: store
63               mountPath: {{ caas.registry_directory }}
64             - name: ca
65               mountPath: /etc/ssl/certs/
66               readOnly: true
67       volumes:
68         - name: time-mount
69           hostPath:
70             path: /etc/localtime
71         - name: config
72           hostPath:
73             path: /etc/docker-update-registry/
74         - name: store
75           hostPath:
76             path: {{ caas.registry_directory }}
77         - name: ca
78           hostPath:
79             path: /etc/openssl/