PM flow demo - docker/kube

Change-Id: I9114f1c21fe12e931a14f995a49195aafda6baea
diff --git a/pm-file-flow-demo/kube-proj/kube-plt.yaml b/pm-file-flow-demo/kube-proj/kube-plt.yaml
new file mode 100644
index 0000000..d34facf
--- /dev/null
+++ b/pm-file-flow-demo/kube-proj/kube-plt.yaml
@@ -0,0 +1,587 @@
+## Status callback server
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: callback
+  namespace: nonrtric
+  labels:
+    run: callback
+    prodtest: callback
+spec:
+  selector:
+    run: callback
+  ports:
+  - port: 80
+    name: http
+
+---
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: callback
+  namespace: nonrtric
+  labels:
+    prodtest: callback
+spec:
+  containers:
+  - name: callback
+    image: kennethreitz/httpbin
+    imagePullPolicy: IfNotPresent
+  ports:
+  - port: 80
+    name: http
+  restartPolicy: Always
+
+
+## Kafka client
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: client
+  namespace: nonrtric
+  labels:
+    run: client
+    prodtest: client
+spec:
+  clusterIP: None
+  selector:
+    run: client
+
+---
+
+apiVersion: v1
+kind: Pod
+metadata:
+  name: client
+  namespace: nonrtric
+  labels:
+    prodtest: client
+spec:
+  containers:
+  - name: client
+    image: confluentinc/cp-kafka:6.2.1
+    command: ['sh', '-c', 'while [ true ];do sleep 60;done']
+    imagePullPolicy: IfNotPresent
+  restartPolicy: Always
+
+---
+
+## https server sts
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: pm-https-server
+  namespace: ran
+  labels:
+    run: pm-https-server
+    prodtest: pm-https-server
+spec:
+  clusterIP: None
+  selector:
+    run: pm-https-server
+
+---
+
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+  name: pm-https-server
+  namespace: ran
+  labels:
+    run: pm-https-server
+    prodtest: pm-https-server
+spec:
+  replicas: $NUM_HTTP
+  serviceName: pm-https-server
+  selector:
+    matchLabels:
+      run: pm-https-server
+  template:
+    metadata:
+      labels:
+        run: pm-https-server
+        prodtest: pm-https-server
+    spec:
+      volumes:
+        - name: tmp-vol
+          configMap:
+            name: pm-https-server-cm
+        - name: cert-vol
+          emptyDir: {}
+        - name: ne-files-vol
+          configMap:
+            name: ne-files
+      initContainers:
+      - name: init
+        image: alpine:latest
+        imagePullPolicy: IfNotPresent
+        command: ["ash","-c"]
+        args: ["cp /tmp/certs/copy-certs.sh /tmp && cd /tmp && chmod u+x copy-certs.sh && ./copy-certs.sh"]
+        volumeMounts:
+        - name: tmp-vol
+          mountPath: /tmp/certs
+        - name: cert-vol
+          mountPath: /certs
+        securityContext:
+          runAsUser: 0
+      containers:
+      - name: pm-https-server
+        image: $PM_HTTPSSERVER_IMAGE
+        imagePullPolicy: $LOCAL_IMAGE_PULL_POLICY
+        ports:
+        - name: http
+          containerPort: 80
+        - name: https
+          containerPort: 443
+        env:
+        - name: ALWAYS_RETURN
+          value: /ne-files/pm.xml.gz
+        volumeMounts:
+        - name: cert-vol
+          mountPath: /certs
+        - name: tmp-vol
+          mountPath: /tmp/certs
+        - name: ne-files-vol
+          mountPath: /ne-files
+
+---
+
+# VES collector
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: ves-collector
+  namespace: onap
+  labels:
+    run: ves-collector
+    prodtest: ves-collector
+spec:
+  type: NodePort
+  ports:
+  - port: 8080
+    targetPort: 8080
+    name: http
+    nodePort: 31760
+  - port: 8443
+    name: https
+    nodePort: 31761
+  selector:
+    run: ves-collector
+
+---
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: ves-collector
+  namespace: onap
+  labels:
+    run: ves-collector
+    prodtest: ves-collector
+spec:
+  selector:
+    matchLabels:
+      run: ves-collector
+  template:
+    metadata:
+      labels:
+        run: ves-collector
+        prodtest: ves-collector
+    spec:
+      volumes:
+        - name: conf-vol1
+          configMap:
+            name: ves-collector-collector.properties
+        - name: conf-vol2
+          configMap:
+            name: ves-collector-ves-dmaap-config.json
+      containers:
+      - name: ves-collector
+        image: $VES_COLLECTOR_IMAGE
+        imagePullPolicy: IfNotPresent
+        env:
+        - name: DMAAPHOST
+          value: message-router.onap
+        ports:
+        - name: http
+          containerPort: 8080
+        - name: https
+          containerPort: 8443
+        volumeMounts:
+        - name: conf-vol1
+          mountPath: /opt/app/VESCollector/etc/collector.properties
+          subPath: collector.properties
+        - name: conf-vol2
+          mountPath: /opt/app/VESCollector/etc/ves-dmaap-config.json
+          subPath: ves-dmaap-config.json
+
+
+---
+
+## ICS
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: informationservice
+  namespace: nonrtric
+  labels:
+    run: informationservice
+    prodtest: informationservice
+spec:
+  type: NodePort
+  ports:
+  - port: 8083
+    targetPort: 8083
+    protocol: TCP
+    name: http
+    nodePort: 31764
+  - port: 8434
+    targetPort: 8434
+    protocol: TCP
+    name: https
+    nodePort: 31765
+  selector:
+    run: informationservice
+
+---
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: informationservice
+  namespace: nonrtric
+  labels:
+    run: informationservice
+    prodtest: informationservice
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: informationservice
+  template:
+    metadata:
+      labels:
+        run: informationservice
+        prodtest: informationservice
+    spec:
+      containers:
+      - name: informationservice
+        image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-plt-informationcoordinatorservice:1.4.0
+        imagePullPolicy: $LOCAL_IMAGE_PULL_POLICY
+        ports:
+        - name: http
+          containerPort: 8083
+        - name: https
+          containerPort: 8434
+        volumeMounts:
+        - mountPath: /opt/app/information-coordinator-service/config/application.yaml
+          subPath: application.yaml
+          name: ics-conf-name
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: informationservice-cm
+        name: ics-conf-name
+
+---
+
+## KAFKA and DMAAP MR
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: zookeeper
+  namespace: onap
+  labels:
+    run: zookeeper
+    prodtest: zookeeper
+spec:
+  type: ClusterIP
+  ports:
+  - port: 32181
+    targetPort: 32181
+    protocol: TCP
+    name: http
+  selector:
+    run: zookeeper
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: kafka-1
+  namespace: onap
+  labels:
+    run: kafka-1
+    prodtest: kafka
+spec:
+  type: NodePort
+  ports:
+  - port: 9092
+    targetPort: 9092
+    protocol: TCP
+    name: http
+    nodePort: 31795
+  - port: 29092
+    targetPort: 29092
+    protocol: TCP
+    name: http2
+    nodePort: 31796
+  # - port: 30099
+  #   targetPort: 30099
+  #   protocol: TCP
+  #   name: http-external
+  #   nodePort:
+  selector:
+    run: kafka-1
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: message-router
+  namespace: onap
+  labels:
+    run: message-router
+    prodtest: message-router
+spec:
+  type: NodePort
+  ports:
+  - port: 3904
+    targetPort: 3904
+    protocol: TCP
+    name: http
+    nodePort: 31766
+  - port: 3905
+    targetPort: 3905
+    protocol: TCP
+    name: https
+    nodePort: 31785
+  selector:
+    run: message-router
+
+---
+
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: zookeeper
+  namespace: onap
+  labels:
+    run: zookeeper
+    prodtest: zookeeper
+spec:
+  selector:
+    matchLabels:
+      run: zookeeper
+  template:
+    metadata:
+      labels:
+        run: zookeeper
+        prodtest: zookeeper
+    spec:
+      containers:
+      - name: zookeeper
+        image: confluentinc/cp-zookeeper:6.2.1
+        imagePullPolicy: IfNotPresent
+        ports:
+        - name: http
+          containerPort: 32181
+        env:
+        - name: ZOOKEEPER_TICK_TIME
+          value: '2000'
+        - name: ZOOKEEPER_CLIENT_PORT
+          value: '32181'
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: kafka-1
+  namespace: onap
+  labels:
+    run: kafka-1
+    prodtest: kafka
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: kafka-1
+  template:
+    metadata:
+      labels:
+        run: kafka-1
+        prodtest: kafka
+    spec:
+      containers:
+      - name: kafka-1
+        image: confluentinc/cp-kafka:6.2.1
+        imagePullPolicy: IfNotPresent
+        ports:
+        - name: http
+          containerPort: 9092
+        ports:
+        - name: http2
+          containerPort: 29092
+        env:
+        - name: KAFKA_BROKER_ID
+          value: '1'
+        - name: KAFKA_ZOOKEEPER_CONNECT
+          value: 'zookeeper:32181'
+        - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
+          value: 'INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
+        - name: KAFKA_ADVERTISED_LISTENERS
+          value: 'INTERNAL_PLAINTEXT://kafka-1.onap:9092,PLAINTEXT_HOST://localhost:29092'
+        - name: KAFKA_LISTENERS
+          value: 'INTERNAL_PLAINTEXT://0.0.0.0:9092,PLAINTEXT_HOST://0.0.0.0:29092'
+        - name: KAFKA_INTER_BROKER_LISTENER_NAME
+          value: INTERNAL_PLAINTEXT
+
+        - name: KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR
+          value: '1'
+        - name: KAFKA_TRANSACTION_STATE_LOG_MIN_ISR
+          value: '1'
+        - name: KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR
+          value: '1'
+        - name: KAFKA_NUM_PARTITIONS
+          value: '${KAFKA_NUM_PARTITIONS}'
+
+
+
+        # volumeMounts:
+        # - mountPath: /etc/kafka/secrets/jaas/zk_client_jaas.conf
+        #   subPath: zk_client_jaas.conf
+        #   name: dmaapmr-zk-client-jaas
+      initContainers:
+      - name: init
+        image: alpine
+        imagePullPolicy: IfNotPresent
+        command: ['sh', '-c', 'until nslookup zookeeper.onap.svc.cluster.local; do echo waiting for zookeeper; sleep 2; done;']
+      # volumes:
+      # - configMap:
+      #     defaultMode: 420
+      #     name: dmaapmr-zk-client-jaas.conf
+      #   name: dmaapmr-zk-client-jaas
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: message-router
+  namespace: onap
+  labels:
+    run: message-router
+    prodtest: message-router
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      run: message-router
+  template:
+    metadata:
+      labels:
+        run: message-router
+        prodtest: message-router
+    spec:
+      containers:
+      - name: message-router
+        image: nexus3.onap.org:10002/onap/dmaap/dmaap-mr:1.3.0
+        imagePullPolicy: IfNotPresent
+        ports:
+        - name: http
+          containerPort: 3904
+        - name: https
+          containerPort: 3905
+        env:
+        - name: enableCadi
+          value: 'false'
+        volumeMounts:
+        - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
+          subPath: MsgRtrApi.properties
+          name: dmaapmr-msg-rtr-api
+        - mountPath: /appl/dmaapMR1/etc/cadi.properties
+          subPath: cadi.properties
+          name: dmaapmr-cadi
+      initContainers:
+      - name: init
+        image: alpine:latest
+        imagePullPolicy: IfNotPresent
+        command: ['sh', '-c', 'until nslookup kafka-1.onap.svc.cluster.local; do echo waiting for kafka-1; sleep 2; done;']
+      volumes:
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-msgrtrapi.properties
+        name: dmaapmr-msg-rtr-api
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-cadi.properties
+        name: dmaapmr-cadi
+
+---
+
+## Kowl - kafka obs
+
+apiVersion: v1
+kind: Service
+metadata:
+  name: kowl
+  namespace: onap
+  labels:
+    run: kowl
+    prodtest: kowl
+spec:
+  type: NodePort
+  selector:
+    run: kowl
+  ports:
+  - port: 8080
+    targetPort: 8080
+    protocol: TCP
+    name: http
+    nodePort: 31767
+
+---
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: kowl
+  namespace: onap
+  labels:
+    prodtest: kowl
+spec:
+  selector:
+    matchLabels:
+      run: kowl
+  template:
+    metadata:
+      labels:
+        run: kowl
+        prodtest: kowl
+    spec:
+      volumes:
+      - name: config-vol
+        configMap:
+          name: kowl-config-cm
+      containers:
+      - name: kowl
+        image: quay.io/cloudhut/kowl
+        imagePullPolicy: IfNotPresent
+        command: ["./kowl", "--config.filepath=/etc/kowl/config.yaml"]
+        volumeMounts:
+        - name: config-vol
+          mountPath: /etc/kowl/config.yaml
+          subPath: config.yaml
+        ports:
+        - name: http
+          containerPort: 8080
+      restartPolicy: Always
+
+---
+
+
+
+