AAF non-root
[aaf/authz.git] / auth / helm / aaf-hello / templates / aaf-hello.yaml
1 #########
2 ##  ============LICENSE_START====================================================
3 ##  org.onap.aaf
4 ##  ===========================================================================
5 ##  Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
6 ##  ===========================================================================
7 ##  Licensed under the Apache License, Version 2.0 (the "License");
8 ##  you may not use this file except in compliance with the License.
9 ##  You may obtain a copy of the License at
10 ##
11 ##       http://www.apache.org/licenses/LICENSE-2.0
12 ##
13 ##  Unless required by applicable law or agreed to in writing, software
14 ##  distributed under the License is distributed on an "AS IS" BASIS,
15 ##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 ##  See the License for the specific language governing permissions and
17 ##  limitations under the License.
18 ##  ============LICENSE_END====================================================
19 ##
20 ###
21 ### AAF-HELLO
22 ###
23 kind: Service
24 apiVersion: v1
25 metadata:
26   name: aaf-hello
27 spec:
28   selector:
29     app: aaf-hello
30   type: NodePort
31   ports:
32     - name: aaf-hello
33       protocol: TCP
34       port: {{ .Values.service.port }}
35       nodePort: {{ .Values.service.public_port }}
36 ---
37 apiVersion: apps/v1
38 kind: Deployment
39 metadata:
40   name: aaf-hello
41   labels:
42     app: aaf-hello
43 spec:
44   replicas: {{ .Values.replicas.hello }}
45   selector:
46     matchLabels:
47       app: aaf-hello
48   template:
49     metadata:
50       labels:
51         app: aaf-hello
52     spec:
53       volumes:
54         # Use this Pod Sharing dir to declare various States of starting
55         - name: aaf-hello-vol
56           persistentVolumeClaim:
57             claimName: aaf-hello-pvc
58       initContainers:
59         - command:
60             - /bin/sh
61             - -c
62             - |
63               chmod -R 775 /opt/app/osaaf
64               chown -R 1000:1000 /opt/app/osaaf
65           image: busybox:1.28
66           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67           name: init-sysctl
68           volumeMounts:
69             - mountPath: /opt/app/osaaf
70               name: aaf-hello-vol
71         - name: aaf-hello-config
72           image: "{{ .Values.image.repository }}{{ .Values.service.agentImage }}"
73           imagePullPolicy: IfNotPresent
74           volumeMounts:
75             - mountPath: "/opt/app/osaaf"
76               name: aaf-hello-vol
77           command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
78           env:
79             - name: APP_FQI
80               value: "{{ .Values.service.fqi }}"
81             - name: aaf_locate_url
82               value: "https://aaf-locate.{{.Release.Namespace }}:8095"
83             - name: aaf_locator_container
84               value: "helm"
85             - name: aaf_locator_container_ns
86               value: "{{ .Release.Namespace }}"
87             - name: aaf_locator_fqdn
88               value: "{{.Values.service.fqdn}}"
89             - name: aaf_locator_public_fqdn
90               value: "{{.Values.service.public_fqdn}}"
91             - name: cadi_latitude
92               value: "{{ .Values.service.cadi_latitude }}"
93             - name: cadi_longitude
94               value: "{{ .Values.service.cadi_longitude }}"
95             - name: "DEPLOY_FQI"
96               value: "deployer@people.osaaf.org"
97             - name: "DEPLOY_PASSWORD"
98               value: "demo123456!"
99
100 ###
101 ### AAF-HELLO
102 ###
103       containers:
104       - name: aaf-hello
105         image: {{ .Values.image.repository }}{{ .Values.service.image }}
106         imagePullPolicy: IfNotPresent
107         command: ["bash","-c","cd /opt/app/aaf && if [ ! -d /opt/app/osaaf/etc ]; then cp -Rf etc logs /opt/app/osaaf; fi && exec bin/hello"]
108         volumeMounts:
109         -  mountPath: "/opt/app/osaaf"
110            name: aaf-hello-vol
111         ports:
112         -  name: aaf-hello
113            protocol: TCP
114            containerPort: {{ .Values.service.port }}