Configmap support 81/1081/3
authorBalint Uveges <balint.uveges@nokia.com>
Mon, 7 Oct 2019 15:27:27 +0000 (15:27 +0000)
committerBalint Uveges <balint.uveges@nokia.com>
Tue, 8 Oct 2019 07:40:31 +0000 (07:40 +0000)
Changes to Dockerfile and K8s YAMLs to support config map

Change-Id: I6217bf1ee5b49e95f45435ba5a1029fca638c857
Signed-off-by: Balint Uveges <balint.uveges@nokia.com>
Dockerfile
RELNOTES
config/submgr.yaml [deleted file]
container-tag.yaml
manifests/submgr/submgr-cfg.yaml [new file with mode: 0644]
manifests/submgr/submgr-dep.yaml
run_submgr.sh

index e38c343..4676ec2 100644 (file)
@@ -81,13 +81,10 @@ RUN mkdir -p /opt/bin && \
   /usr/local/go/bin/go build -o /opt/bin/submgr cmd/submgr.go && \
      mkdir -p /opt/build/container/usr/local
 
-COPY config config
-
 FROM ubuntu:18.04
 
 RUN apt update && apt install -y iputils-ping net-tools curl tcpdump
 
-COPY --from=submgrbuild /opt/bin/submgr /opt/submgr/config/submgr.yaml /
 COPY run_submgr.sh /
 COPY --from=submgrbuild /usr/local/include /usr/local/include
 COPY --from=submgrbuild /usr/local/lib /usr/local/lib
index 65553c9..2798b64 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,3 +1,6 @@
+### v0.10.4
+* Configmap usage introduced for K8s based deployments
+
 ### v0.10.3
 * The following tools made available in the final docker image: iputils-ping, net-tools, curl and tcpdump
 
diff --git a/config/submgr.yaml b/config/submgr.yaml
deleted file mode 100644 (file)
index c1dda48..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#   Copyright (c) 2019 AT&T Intellectual Property.
-#   Copyright (c) 2019 Nokia.
-#
-#   Licensed under the Apache License, Version 2.0 (the "License");
-#   you may not use this file except in compliance with the License.
-#   You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the License is distributed on an "AS IS" BASIS,
-#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#   See the License for the specific language governing permissions and
-#   limitations under the License.
-
-"local":
-  "host": ":8080"
-"logger":
-  "level": 3
-"rmr":
-  "protPort": "tcp:4560"
-  "maxSize": 2072
-  "numWorkers": 1
-"rtmgr":
-  "hostAddr": "rtmgr"
-  "port"    : 8888
-  "baseUrl" : "/ric/v1"
index 4cc4c24..b37bae2 100644 (file)
@@ -2,4 +2,4 @@
 # By default this file is in the docker build directory,
 # but the location can configured in the JJB template.
 ---
-tag: 0.10.3
+tag: 0.10.4
diff --git a/manifests/submgr/submgr-cfg.yaml b/manifests/submgr/submgr-cfg.yaml
new file mode 100644 (file)
index 0000000..1092411
--- /dev/null
@@ -0,0 +1,43 @@
+#
+#==================================================================================
+#   Copyright (c) 2019 AT&T Intellectual Property.
+#   Copyright (c) 2019 Nokia
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#==================================================================================
+#
+#
+#   Abstract:           Configuration values for the Subscription Manager
+#   Date:               4 Oct 2019
+#
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: submgrcfg
+  namespace: ricplt
+data:
+  # FQDN and port info of rtmgr
+  submgrcfg: |
+    "local":
+      "host": ":8080"
+    "logger":
+      "level": 3
+      "rmr":
+        "protPort": "tcp:4560"
+        "maxSize": 2072
+        "numWorkers": 1
+        "rtmgr":
+        "hostAddr": "rtmgr"
+        "port"    : 8888
+        "baseUrl" : "/ric/v1"
+
index f710261..c71a0c1 100644 (file)
@@ -40,11 +40,25 @@ spec:
         image: jenkins:5000/submgr:test
         command: ["/run_submgr.sh"]
         env:
-        - name: DBAAS_SERVICE_HOST
-          value: service-ricplt-dbaas-tcp
-        - name: SUBMGR_SEED_SN
-          value: "1"
+          - name: DBAAS_SERVICE_HOST
+            value: service-ricplt-dbaas-tcp
+          - name: SUBMGR_SEED_SN
+            value: "1"
+          - name: CFGFILE
+            value: /cfg/submgr-config.yaml
         ports:
-        - containerPort: 8080
-        - containerPort: 4560
-        - containerPort: 4561
+          - containerPort: 8080
+          - containerPort: 4560
+          - containerPort: 4561
+        volumeMounts:
+          - mountPath: /cfg
+            name: submgrcfg
+            readOnly: true
+      volumes:
+        - name: submgrcfg
+          configMap:
+            name: submgrcfg
+            items:
+              - key: submgrcfg
+                path: submgr-config.yaml
+                mode: 0644
index 71f9304..90c2891 100755 (executable)
@@ -22,4 +22,4 @@
 #      Abstract:       Starts the submgr service
 #      Date:           28 May 2019
 #
-exec ./submgr -f /submgr.yaml
+exec ./submgr -f $CFGFILE