From f0b69ac0a1a43deabbc56e7fbcbace995e03f31c Mon Sep 17 00:00:00 2001 From: Balint Uveges Date: Mon, 7 Oct 2019 15:27:27 +0000 Subject: [PATCH] Configmap support Changes to Dockerfile and K8s YAMLs to support config map Change-Id: I6217bf1ee5b49e95f45435ba5a1029fca638c857 Signed-off-by: Balint Uveges --- Dockerfile | 3 --- RELNOTES | 3 +++ config/submgr.yaml | 27 ------------------------- container-tag.yaml | 2 +- manifests/submgr/submgr-cfg.yaml | 43 ++++++++++++++++++++++++++++++++++++++++ manifests/submgr/submgr-dep.yaml | 28 +++++++++++++++++++------- run_submgr.sh | 2 +- 7 files changed, 69 insertions(+), 39 deletions(-) delete mode 100644 config/submgr.yaml create mode 100644 manifests/submgr/submgr-cfg.yaml diff --git a/Dockerfile b/Dockerfile index e38c343..4676ec2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/RELNOTES b/RELNOTES index 65553c9..2798b64 100644 --- 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 index c1dda48..0000000 --- a/config/submgr.yaml +++ /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" diff --git a/container-tag.yaml b/container-tag.yaml index 4cc4c24..b37bae2 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -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 index 0000000..1092411 --- /dev/null +++ b/manifests/submgr/submgr-cfg.yaml @@ -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" + diff --git a/manifests/submgr/submgr-dep.yaml b/manifests/submgr/submgr-dep.yaml index f710261..c71a0c1 100644 --- a/manifests/submgr/submgr-dep.yaml +++ b/manifests/submgr/submgr-dep.yaml @@ -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 diff --git a/run_submgr.sh b/run_submgr.sh index 71f9304..90c2891 100755 --- a/run_submgr.sh +++ b/run_submgr.sh @@ -22,4 +22,4 @@ # Abstract: Starts the submgr service # Date: 28 May 2019 # -exec ./submgr -f /submgr.yaml +exec ./submgr -f $CFGFILE -- 2.16.6