Merge "Implement public private locator"
[aaf/authz.git] / auth / helm / aaf / templates / aaf-service.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-SERVICE
22 ###
23 kind: Service
24 apiVersion: v1
25 metadata:
26   name: aaf-service
27 spec:
28   type: NodePort
29   selector:
30     app: aaf-service
31   ports:
32     - name: aaf-service
33       protocol: TCP
34       nodePort: 30080
35       port: 8100
36       targetPort: 8100
37 ---
38 apiVersion: apps/v1
39 kind: Deployment
40 metadata:
41   name: aaf-service
42   labels:
43     app: aaf-service
44 spec:
45   replicas: 1
46   selector:
47     matchLabels:
48       app: aaf-service
49   template:
50     metadata:
51       labels:
52         app: aaf-service
53     spec:
54       volumes:
55       - name: {{ .Chart.Name }}-config-vol
56         persistentVolumeClaim:
57           claimName: {{ .Chart.Name }}-config-pvc
58       - name: {{ .Chart.Name }}-status-vol
59         persistentVolumeClaim:
60           claimName: {{ .Chart.Name }}-status-pvc
61       initContainers:
62         - name: {{ .Chart.Name }}-config-container
63           image: {{ .Values.image.repository }}onap/aaf/aaf_config:{{ .Values.image.version }}
64           imagePullPolicy: IfNotPresent
65           command: ["bash","/opt/app/aaf_config/bin/agent.sh"]
66           volumeMounts:
67             - mountPath: "/opt/app/osaaf"
68               name: {{ .Chart.Name }}-config-vol
69           env:
70             - name: AAF_ENV
71               value: "{{ .Values.cadi.aaf_env }}"
72             - name: LATITUDE
73               value: "{{ .Values.cadi.cadi_latitude }}"
74             - name: LONGITUDE
75               value: "{{ .Values.cadi.cadi_longitude }}"
76             - name: aaf_locator_container
77               value: "helm"
78             - name: aaf_locator_container_ns
79               valueFrom:
80                 fieldRef:
81                   fieldPath: metadata.namespace
82             - name: aaf_locate_url
83               value: "https://aaf-locate.onap:8095"
84             - name: aaf_locator_public_hostname
85               value: "aaf.osaaf.org"
86             - name: CASSANDRA_CLUSTER
87               value: "aaf-cass"
88 #            - name: CASSANDRA_USER
89 #              value: ""
90 #            - name: CASSANDRA_PASSWORD
91 #              value: ""
92 #           - name: CASSANDRA_PORT
93 #              value: ""
94       containers:
95 ###
96 ### AAF-SERVICE
97 ###
98       - name: {{ .Chart.Name }}-service
99         image: {{ .Values.image.repository }}onap/aaf/aaf_service:{{ .Values.image.version }}
100         imagePullPolicy: IfNotPresent
101         command: ["/bin/bash","-c","cd /opt/app/aaf && /bin/bash bin/pod_wait.sh aaf-service aaf-cass && exec bin/service"]
102         volumeMounts:
103         -  mountPath: "/opt/app/osaaf"
104            name: {{ .Chart.Name }}-config-vol
105         -  mountPath: "/opt/app/aaf/status"
106            name: {{ .Chart.Name }}-status-vol
107         ports:
108         - name: service
109           protocol: TCP
110           containerPort: 8100
111