From: wrider Date: Tue, 25 Feb 2020 17:49:20 +0000 (-0500) Subject: Add capability for O1 mediator to list pods in xapp ns X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=67f5a5fe784ad2b2a4a0b9b8e536abba215c3782;p=ric-plt%2Fric-dep.git Add capability for O1 mediator to list pods in xapp ns Based on the new understanding that O1 mediator needs to be able to list pods in xapp namespace, add serviceaccount to support this. Issue-ID: RIC-186 Change-Id: I84bea552917bdb3f3b95194cdbfecd8cb6422240 Signed-off-by: wrider --- diff --git a/helm/o1mediator/templates/deployment.yaml b/helm/o1mediator/templates/deployment.yaml index 3e38828..5aa02c6 100644 --- a/helm/o1mediator/templates/deployment.yaml +++ b/helm/o1mediator/templates/deployment.yaml @@ -47,6 +47,7 @@ spec: hostname: {{ include "common.name.o1mediator" . }} imagePullSecrets: - name: {{ include "common.dockerregistry.credential" $imagectx }} + serviceAccountName: {{ include "common.serviceaccountname.o1mediator" . }} containers: - name: {{ include "common.containername.o1mediator" . }} image: {{ include "common.dockerregistry.url" $imagectx }}/{{ .Values.o1mediator.image.name }}:{{ .Values.o1mediator.image.tag }} diff --git a/helm/o1mediator/templates/env.yaml b/helm/o1mediator/templates/env.yaml index 70f3065..5ae05b2 100644 --- a/helm/o1mediator/templates/env.yaml +++ b/helm/o1mediator/templates/env.yaml @@ -21,5 +21,3 @@ metadata: data: DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" . | quote }} DBAAS_SERVICE_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }} - DBAAS_PORT_6379_TCP_ADDR: {{ include "common.servicename.dbaas.tcp" . | quote }} - DBAAS_PORT_6379_TCP_PORT: {{ include "common.serviceport.dbaas.tcp" . | quote }} diff --git a/helm/o1mediator/templates/serviceaccount.yaml b/helm/o1mediator/templates/serviceaccount.yaml new file mode 100644 index 0000000..7527e46 --- /dev/null +++ b/helm/o1mediator/templates/serviceaccount.yaml @@ -0,0 +1,46 @@ +################################################################################ +# Copyright (c) 2019-2020 AT&T Intellectual Property. # +# # +# 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. # +################################################################################ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "common.serviceaccountname.o1mediator" . }} + namespace: {{ include "common.namespace.platform" . }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "common.serviceaccountname.o1mediator" . }}-{{ include "common.namespace.xapp" . }}-podreader + namespace: {{ include "common.namespace.xapp" . }} +rules: +- apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "watch"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "common.serviceaccountname.o1mediator" . }}-{{ include "common.namespace.xapp" . }}-podreader + namespace: {{ include "common.namespace.xapp" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "common.serviceaccountname.o1mediator" . }}-{{ include "common.namespace.xapp" . }}-podreader +subjects: + - kind: ServiceAccount + name: {{ include "common.serviceaccountname.o1mediator" . }} + namespace: {{ include "common.namespace.platform" . }} + diff --git a/helm/o1mediator/values.yaml b/helm/o1mediator/values.yaml index 94b7b59..55d51ab 100644 --- a/helm/o1mediator/values.yaml +++ b/helm/o1mediator/values.yaml @@ -14,12 +14,6 @@ # See the License for the specific language governing permissions and # # limitations under the License. # ################################################################################ - -################################################################# -# Application configuration defaults. -################################################################# -# application image - o1mediator: replicaCount: 1 imagePullPolicy: IfNotPresent