552303ca1b486e2db28609222d4b17d23fdd2af0
[aaf/authz.git] / auth / helm / aaf / templates / aaf-cass.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 kind: Service
22 apiVersion: v1
23 metadata:
24   name: aaf-cass
25   labels:
26     app: aaf-cass
27 spec:
28   selector:
29     app: aaf-cass
30   ports:
31     - name: storage
32       protocol: TCP
33       port: {{.Values.services.cass.storage_port}}
34       containerPort: {{.Values.services.cass.storage_port}}
35     - name: ssl-storage
36       protocol: TCP
37       port: {{.Values.services.cass.ssl_storage_port}}
38       containerPort: {{.Values.services.cass.ssl_storage_port}}
39     - name: native-trans
40       protocol: TCP
41       port: {{.Values.services.cass.native_trans_port}}
42       containerPort: {{.Values.services.cass.native_trans_port}}
43 ---
44 apiVersion: apps/v1
45 kind: Deployment
46 metadata:
47   name: aaf-cass
48   labels:
49     app: aaf-cass
50 spec:
51   replicas: {{ .Values.services.cass.replicas }}
52   selector:
53     matchLabels:
54       app: aaf-cass
55   template:
56     metadata:
57       labels:
58         app: aaf-cass
59     spec:
60       volumes:
61       - name: aaf-cass-vol
62         persistentVolumeClaim:
63           claimName: aaf-cass-pvc
64       - name: aaf-status-vol
65         persistentVolumeClaim:
66           claimName: aaf-status-pvc
67       containers:
68 ###
69 ### AAF-CASS
70 ###
71       - name: aaf-cass
72         image: {{ .Values.image.repository }}onap/aaf/aaf_cass:{{ .Values.image.version }}
73         imagePullPolicy: IfNotPresent
74         # installing with cmd "onap" will not only initialize the DB, but add ONAP bootstrap data as well
75         command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"]
76         lifecycle:
77           preStop:
78             exec:
79               command: ["/bin/sh","-c","rm /opt/app/aaf/status/aaf-cass"]
80         volumeMounts:
81         - mountPath: "/var/lib/cassandra"
82           name: aaf-cass-vol
83         - mountPath: "/opt/app/aaf/status"
84           name: aaf-status-vol
85         ports:
86         - name: storage
87           containerPort: {{.Values.services.cass.storage_port}}
88         - name: ssl-storage
89           containerPort: {{.Values.services.cass.storage_port}}
90         - name: native-trans
91           containerPort: {{.Values.services.cass.native_trans_port}}
92         - name: rpc
93           containerPort: {{.Values.services.cass.rpc_port}}
94         env:
95         - name: CASSANDRA_CLUSTER_NAME
96           value: {{.Values.services.cass.cluster_name}}
97         - name: CASSANDRA_DC
98           value: {{.Values.services.cass.dc}}
99         - name: HEAP_NEWSIZE
100           value: {{.Values.services.cass.heap_new_size}}
101         - name: MAX_HEAP_SIZE
102           value: {{.Values.services.cass.max_heap_size}}
103         - name: MY_POD_NAME
104           valueFrom:
105             fieldRef:
106               fieldPath: metadata.name
107         - name: MY_POD_NAMESPACE
108           valueFrom:
109             fieldRef:
110               fieldPath: metadata.namespace
111         - name: MY_POD_IP
112           valueFrom:
113             fieldRef:
114               fieldPath: status.podIP