653b938e8bfeb2e5f8f674c4672ac9e87023d1a0
[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         nodename: caas_master1
35       securityContext:
36         runAsUser: {{ caas.uid.dockerreg }}
37       containers:
38         - name: registry-update
39           image: {{ container_image_names | select('search', '/registry:') | list | last }}
40           env:
41             - name: INTERFACE_NAME
42               value: "{{ caas.internal_flannel_interface }}"
43             - name: REGISTRY_PORT
44               value: "{{ caas.update_registry_port }}"
45             - name: REGISTRY_CONFIG
46               value: /etc/docker-registry/docker-registry-update-config.yml
47           resources:
48             requests:
49               cpu: "10m"
50           volumeMounts:
51             - name: time-mount
52               mountPath: /etc/localtime
53               readOnly: true
54             - name: config
55               mountPath: /etc/docker-registry/
56               readOnly: true
57             - name: store
58               mountPath: {{ caas.registry_directory }}
59             - name: ca
60               mountPath: /etc/ssl/certs/
61               readOnly: true
62       volumes:
63         - name: time-mount
64           hostPath:
65             path: /etc/localtime
66         - name: config
67           hostPath:
68             path: /etc/docker-update-registry/
69         - name: store
70           hostPath:
71             path: {{ caas.registry_directory }}
72         - name: ca
73           hostPath:
74             path: /etc/openssl/