BjornMagnussonXA | b998ed6 | 2022-09-21 09:26:21 +0200 | [diff] [blame^] | 1 | |
2 | |||||
3 | apiVersion: v1 | ||||
4 | kind: Service | ||||
5 | metadata: | ||||
6 | name: rapp | ||||
7 | namespace: rapps | ||||
8 | labels: | ||||
9 | run: kpm | ||||
10 | prodtest: rapp | ||||
11 | spec: | ||||
12 | clusterIP: None # Headless service | ||||
13 | selector: | ||||
14 | run: rapp | ||||
15 | |||||
16 | --- | ||||
17 | |||||
18 | apiVersion: apps/v1 | ||||
19 | kind: StatefulSet | ||||
20 | metadata: | ||||
21 | name: rapp | ||||
22 | namespace: rapps | ||||
23 | labels: | ||||
24 | run: rapp | ||||
25 | prodtest: rapp | ||||
26 | spec: | ||||
27 | replicas: $NUM_RAPP | ||||
28 | serviceName: rapp | ||||
29 | selector: | ||||
30 | matchLabels: | ||||
31 | run: rapp | ||||
32 | template: | ||||
33 | metadata: | ||||
34 | labels: | ||||
35 | run: rapp | ||||
36 | prodtest: rapp | ||||
37 | spec: | ||||
38 | initContainers: | ||||
39 | - name: init | ||||
40 | image: alpine:latest | ||||
41 | imagePullPolicy: IfNotPresent | ||||
42 | command: ["ash","-c"] | ||||
43 | args: ["echo $HOSTNAME"] | ||||
44 | containers: | ||||
45 | - name: rapp | ||||
46 | image: $RAPP_IMAGE | ||||
47 | imagePullPolicy: $LOCAL_IMAGE_PULL_POLICY | ||||
48 | ports: | ||||
49 | - name: http | ||||
50 | containerPort: 80 | ||||
51 | env: | ||||
52 | - name: E1 | ||||
53 | valueFrom: | ||||
54 | fieldRef: | ||||
55 | fieldPath: metadata.name | ||||
56 | - name: KP | ||||
57 | valueFrom: | ||||
58 | fieldRef: | ||||
59 | fieldPath: metadata.name | ||||
60 | - name: KAFKA_SERVER | ||||
61 | value: kafka-1.onap:9092 | ||||
62 | - name: ICS | ||||
63 | value: informationservice.nonrtric:8083 | ||||
64 | - name: SELF | ||||
65 | value: "$(E1).rapp.rapps:80" | ||||
66 |