af4f5e8a775440725b9e241e269dfb0b3d729ffb
[ta/caas-helm.git] / ansible / roles / chart_repo / templates / chart-repo.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: Deployment
19 metadata:
20   name: chart-repo
21   namespace: kube-system
22 spec:
23   replicas: 1
24   selector:
25     matchLabels:
26       {{ caas.kubernetes_component_label }}: chart-repo
27   template:
28     metadata:
29       annotations:
30         danm.k8s.io/interfaces: |
31           [
32             {
33               "network":"flannel"
34             }
35           ]
36       labels:
37         {{ caas.kubernetes_component_label }}: chart-repo
38     spec:
39       dnsPolicy: ClusterFirst
40       nodeSelector:
41         nodename: caas_master1
42       securityContext:
43         runAsUser: {{ caas.uid.chartrepo }}
44       containers:
45         - name: chart-repo-handler
46           image: {{ container_image_names | select('search', '/chartrepo') | list | last }}
47           imagePullPolicy: IfNotPresent
48           ## Limits equals requets to put the container into qualified QoS category
49           resources:
50             limits:
51               cpu: "0.2"
52               memory: "128Mi"
53             requests:
54               cpu: "0.2"
55               memory: "128Mi"
56           command:
57             - "/usr/bin/mainstart.sh"
58           env:
59             - name: CHARTREPOHANDLER_AUTHURL
60               value: {{ caas.swift }}/auth/v1.0
61             - name: CHARTREPOHANDLER_AUTHUSER
62               value: admin:admin
63             - name: CHARTREPOHANDLER_LISTENONPORT
64               value: "{{ caas.chart_repo_port }}"
65             - name: CHARTREPOHANDLER_LISTENONINTERFACE
66               value: "{{ caas.internal_flannel_interface }}"
67             - name: CHARTREPOHANDLER_AUTHKEY
68               value: "{{ swift_pass.stdout }}"
69             - name: CHARTREPOHANDLER_CONTAINER
70               value: packages
71             - name: CHARTREPOHANDLER_REPOURL
72               value: https://{{ caas.chart_repo_url }}
73             - name: CHARTREPOHANDLER_INDEXPATH
74               value: charts
75             - name: CHARTREPOHANDLER_TLSCERTPATH
76               value: /etc/chart-repo/ssl/chart-repo{{ nodeindex }}.pem
77             - name: CHARTREPOHANDLER_TLSKEYPATH
78               value: /etc/chart-repo/ssl/chart-repo{{ nodeindex }}-key.pem
79             - name: CHARTREPOHANDLER_TLSCAPATH
80               value: /etc/chart-repo/ssl/ca.pem
81           volumeMounts:
82             - name: time-mount
83               mountPath: /etc/localtime
84               readOnly: true
85             - name: chart-repo-cert
86               mountPath: /etc/chart-repo/ssl
87               readOnly: true
88       volumes:
89         - name: time-mount
90           hostPath:
91             path: /etc/localtime
92         - name: chart-repo-cert
93           hostPath:
94             path: /etc/chart-repo/ssl