be6e1c8b95cde8b72e9b55c03a6be6729533df93
[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: {{.Values.services.service.fqdn}}
33       protocol: TCP
34       nodePort: {{.Values.services.service.public_port}}
35       port: {{.Values.services.service.internal_port}}
36 ---
37 apiVersion: apps/v1
38 kind: Deployment
39 metadata:
40   name: aaf-service
41   labels:
42     app: aaf-service
43 spec:
44   replicas: {{ .Values.services.service.replicas }}
45   selector:
46     matchLabels:
47       app: aaf-service
48   template:
49     metadata:
50       labels:
51         app: aaf-service
52     spec:
53       volumes:
54       - name: aaf-config-vol
55         persistentVolumeClaim:
56           claimName: aaf-config-pvc
57       - name: aaf-status-vol
58         persistentVolumeClaim:
59           claimName: aaf-status-pvc
60       initContainers:
61         - name: aaf-config-container
62           image: {{ .Values.image.repository }}onap/aaf/aaf_config:{{ .Values.image.version }}
63           imagePullPolicy: IfNotPresent
64           command: ["bash","/opt/app/aaf_config/bin/agent.sh"]
65           volumeMounts:
66             - mountPath: "/opt/app/osaaf"
67               name: aaf-config-vol
68           env:
69             - name: aaf_env
70               value: "{{ .Values.services.aaf_env }}"
71             - name: cadi_latitude
72               value: "{{ .Values.services.cadi_latitude }}"
73             - name: cadi_longitude
74               value: "{{ .Values.services.cadi_longitude }}"
75             - name: aaf_locator_container
76               value: "helm"
77             - name: aaf_locator_container_ns
78               value: "{{ .Release.Namespace }}"
79             - name: aaf_locate_url
80               value: "https://{{.Values.services.locate.fqdn}}.{{.Values.services.ns}}:{{.Values.services.locate.internal_port}}"
81             - name: aaf_locator_public_fqdn
82               value: "{{.Values.services.public_fqdn}}"
83             - name: aaf_locator_name
84               value: "{{.Values.services.aaf_locator_name}}"
85             - name: aaf_locator_name_helm
86               value: "{{.Values.services.aaf_locator_name_helm}}"
87             - name: CASSANDRA_CLUSTER
88               value: "{{.Values.services.cass.fqdn}}.{{.Values.services.ns}}"
89 #            - name: CASSANDRA_USER
90 #              value: ""
91 #            - name: CASSANDRA_PASSWORD
92 #              value: ""
93 #           - name: CASSANDRA_PORT
94 #              value: ""
95       containers:
96 ###
97 ### AAF-SERVICE
98 ###
99       - name: aaf-service
100         image: {{ .Values.image.repository }}onap/aaf/aaf_service:{{ .Values.image.version }}
101         imagePullPolicy: IfNotPresent
102         command: ["/bin/bash","-c","cd /opt/app/aaf && /bin/bash bin/pod_wait.sh aaf-service aaf-cass && exec bin/service"]
103         volumeMounts:
104         -  mountPath: "/opt/app/osaaf"
105            name: aaf-config-vol
106         -  mountPath: "/opt/app/aaf/status"
107            name: aaf-status-vol
108         ports:
109         - name: service
110           protocol: TCP
111           containerPort: {{.Values.services.service.internal_port}}
112