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