- cps-charts should support two dmi-stub instances, each uses its own
pod. Since each pod should return its own Servlet URI (dmi-stub
address)
- the services for dmi-stub instances should be defined seperately since
a fixed dmi-stub address is required. (otherwise adress would be
dynamic on each deployment)
- env. variable DMI_STUB_SERVER_PORT is used to override ther server
port for second dmi-stub (ports should be different on pod levels)
- for the latest architecture please visit the solution page:
https://lf-onap.atlassian.net/wiki/spaces/DW/pages/
347537434/CPS-2933+Kubernetes+container+management+system+for+CPS+and+NCMP
- updated Uri address for dmi stub services
Issue-ID: CPS-2934
Change-Id: I1c6bda107ed362278dea7c26fa842a286de76009
Signed-off-by: halil.cakal <halil.cakal@est.tech>
apiVersion: apps/v1
kind: Deployment
metadata:
- name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub
+ name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-1
labels:
app: {{ include "cps-and-ncmp.name" . }}
component: dmi-stub
image: "{{ .Values.dmiStub.image.repository }}:{{ .Values.dmiStub.image.tag }}"
imagePullPolicy: {{ .Values.dmiStub.image.pullPolicy }}
ports:
- - containerPort: {{ .Values.dmiStub.containerPort }}
+ - containerPort: {{ .Values.dmiStub.deployment1.containerPort }}
env:
{{- range $key, $value := .Values.dmiStub.env }}
- name: {{ $key }}
resources:
{{- toYaml .Values.dmiStub.resources | nindent 12 }}
livenessProbe:
- {{- toYaml .Values.dmiStub.livenessProbe | nindent 12 }}
+ {{- toYaml .Values.dmiStub.livenessProbe.deployment1 | nindent 12 }}
--- /dev/null
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-2
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
+spec:
+ replicas: {{ .Values.dmiStub.replicaCount }}
+ selector:
+ matchLabels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
+ template:
+ metadata:
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
+ spec:
+ containers:
+ - name: dmi-stub
+ image: "{{ .Values.dmiStub.image.repository }}:{{ .Values.dmiStub.image.tag }}"
+ imagePullPolicy: {{ .Values.dmiStub.image.pullPolicy }}
+ ports:
+ - containerPort: {{ .Values.dmiStub.deployment2.containerPort }}
+ env:
+ - name: DMI_STUB_SERVER_PORT
+ value: "{{ .Values.dmiStub.deployment2.containerPort }}"
+ {{- range $key, $value := .Values.dmiStub.env }}
+ - name: {{ $key }}
+ value: "{{ $value }}"
+ {{- end }}
+ resources:
+ {{- toYaml .Values.dmiStub.resources | nindent 12 }}
+ livenessProbe:
+ {{- toYaml .Values.dmiStub.livenessProbe.deployment2 | nindent 12 }}
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-1
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
+spec:
+ type: {{ .Values.dmiStub.service1.type }}
+ ports:
+ - port: {{ .Values.dmiStub.service1.port }}
+ targetPort: {{ .Values.dmiStub.deployment1.containerPort }}
+ protocol: TCP
+ name: http
+ {{- if and (eq .Values.dmiStub.service1.type "NodePort") .Values.dmiStub.service1.nodePort }}
+ nodePort: {{ .Values.dmiStub.service1.nodePort }}
+ {{- end }}
+ selector:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub-2
+ labels:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
+spec:
+ type: {{ .Values.dmiStub.service2.type }}
+ ports:
+ - port: {{ .Values.dmiStub.service2.port }}
+ targetPort: {{ .Values.dmiStub.deployment2.containerPort }}
+ protocol: TCP
+ name: http
+ {{- if and (eq .Values.dmiStub.service2.type "NodePort") .Values.dmiStub.service2.nodePort }}
+ nodePort: {{ .Values.dmiStub.service2.nodePort }}
+ {{- end }}
+ selector:
+ app: {{ include "cps-and-ncmp.name" . }}
+ component: dmi-stub
+++ /dev/null
-apiVersion: v1
-kind: Service
-metadata:
- name: {{ include "cps-and-ncmp.fullname" . }}-dmi-stub
- labels:
- app: {{ include "cps-and-ncmp.name" . }}
- component: dmi-stub
-spec:
- type: {{ .Values.dmiStub.service.type }}
- ports:
- - port: {{ .Values.dmiStub.service.port }}
- targetPort: {{ .Values.dmiStub.containerPort }}
- protocol: TCP
- name: http
- {{- if and (eq .Values.dmiStub.service.type "NodePort") .Values.dmiStub.service.nodePort }}
- nodePort: {{ .Values.dmiStub.service.nodePort }}
- {{- end }}
- selector:
- app: {{ include "cps-and-ncmp.name" . }}
- component: dmi-stub
tag: "1.8.0-SNAPSHOT"
pullPolicy: IfNotPresent
replicaCount: 1
- service:
+ deployment1:
+ containerPort: 8092
+ deployment2:
+ containerPort: 8093
+ service1:
type: NodePort
port: 8092
nodePort: 30092
- containerPort: 8092
+ service2:
+ type: NodePort
+ port: 8093
+ nodePort: 31092
env:
KAFKA_BOOTSTRAP_SERVER: "cps-ncmp-kafka.default.svc.cluster.local:9092"
NCMP_CONSUMER_GROUP_ID: "ncmp-group"
cpu: "1000m"
memory: "2Gi"
livenessProbe:
- httpGet:
- path: /actuator/health/readiness
- port: 8092
- initialDelaySeconds: 30
- periodSeconds: 10
- failureThreshold: 3
+ deployment1:
+ httpGet:
+ path: /actuator/health/readiness
+ port: 8092
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ failureThreshold: 3
+ deployment2:
+ httpGet:
+ path: /actuator/health/readiness
+ port: 8093
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ failureThreshold: 3
},
"k8sHosts": {
"ncmpBaseUrl": "http://localhost:30080",
- "dmiStubUrl": "http://cps-ncmp-dmi-stub:8092",
+ "dmiStubUrl": "http://cps-ncmp-dmi-stub-1:8092",
"kafkaBootstrapServer": "localhost:30093"
},
"scenarios": {
},
"k8sHosts": {
"ncmpBaseUrl": "http://localhost:30080",
- "dmiStubUrl": "http://cps-ncmp-dmi-stub:8092",
+ "dmiStubUrl": "http://cps-ncmp-dmi-stub-1:8092",
"kafkaBootstrapServer": "localhost:30093"
},
"scenarios": {