diff options
author | jmac <james.macnider@amdocs.com> | 2018-03-29 01:18:02 +0000 |
---|---|---|
committer | jmac <james.macnider@amdocs.com> | 2018-04-02 12:01:58 +0000 |
commit | 065e2ce2d14ddc3a698a8ad4dfb77ade8e3f95f4 (patch) | |
tree | cc4cdf3dfeac2c01597cb8170dcce647ab0be1a0 /kubernetes/sdnc/charts/sdnc-portal | |
parent | ced8514d3c19dc5ba4ae8e42797fc731ef25d200 (diff) |
Add Standardized Configuration to SDN-C Chart
Change-Id: I9f4d43c2a3f0766b9c8477a180f5a0bd45fde243
Signed-off-by: jmac <james.macnider@amdocs.com>
Issue-ID: OOM-748
Diffstat (limited to 'kubernetes/sdnc/charts/sdnc-portal')
9 files changed, 393 insertions, 0 deletions
diff --git a/kubernetes/sdnc/charts/sdnc-portal/.helmignore b/kubernetes/sdnc/charts/sdnc-portal/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/kubernetes/sdnc/charts/sdnc-portal/Chart.yaml b/kubernetes/sdnc/charts/sdnc-portal/Chart.yaml new file mode 100644 index 0000000000..193c38ffce --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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 +description: SDN-C Admin Portal +name: sdnc-portal +version: 2.0.0
\ No newline at end of file diff --git a/kubernetes/sdnc/charts/sdnc-portal/requirements.yaml b/kubernetes/sdnc/charts/sdnc-portal/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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. + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local'
\ No newline at end of file diff --git a/kubernetes/sdnc/charts/sdnc-portal/resources/config/admportal.json b/kubernetes/sdnc/charts/sdnc-portal/resources/config/admportal.json new file mode 100644 index 0000000000..4c0754b691 --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/resources/config/admportal.json @@ -0,0 +1,68 @@ +{ + "MainMenu": "gamma", + "dbConnLimit": "100", + "home": "/opt/admportal", + "sslEnabled": "false", + "nonSslPort": "8843", + "ConexusNetworkPort": "8443", + "AppNetworkPort": "8543", + "clusterPort": "8443", + "serviceHomingServiceType": "SDN-ETHERNET-INTERNET", + "passwordKey": "QtfJMKggVk", + "preloadImportDirectory": "C:/data/csv", + "clusterPrefixURL": "/jolokia/read/org.opendaylight.controller:Category=Shards,name=member-", + "clusterMidURL": "-shard-", + "clusterSuffixURL": "-config,type=DistributedConfigDatastore", + "shards": [ + "default", + "inventory", + "topology" + ], + "dbFabric": "false", + "ip-addresses": { + "lo": "127.0.0.1", + "eth0": "127.0.0.1", + "docker0": "172.17.0.1", + "virbr0": "192.168.122.1" + }, + "svclogicPropertiesDb01": "/opt/onap/sdnc/data/properties/svclogic.properties.sdnctldb01", + "databases": [ + "dbhost|sdnctldb01" + ], + "dbFabricServer": "localhost", + "dbFabricPort": "32275", + "dbFabricGroupId": "hagroup1", + "dbFabricUser": "admin", + "dbFabricPassword": "admin", + "dbFabricDB": "mysql", + "dbUser": "sdnctl", + "dbPassword": "gamma", + "dbName": "sdnctl", + "odlProtocol": "http", + "odlHost": "sdnhost.{{.Release.Namespace}}", + "odlConexusHost": "sdnhost.{{.Release.Namespace}}", + "odlPort": "8181", + "odlConexusPort": "8181", + "odlUser": "admin", + "odlPasswd": "admin", + "ConexusNetwork_sslCert": "", + "ConexusNetwork_sslKey": "", + "AppNetwork_sslCert": "", + "AppNetwork_sslKey": "", + "hostnameList": [ + { + "hname": "localhost" + } + ], + "shard_list": [ + { + "shard_name": "default" + }, + { + "shard_name": "inventory" + }, + { + "shard_name": "topology" + } + ] +} diff --git a/kubernetes/sdnc/charts/sdnc-portal/templates/configmap.yaml b/kubernetes/sdnc/charts/sdnc-portal/templates/configmap.yaml new file mode 100644 index 0000000000..f2f2524dfd --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/templates/configmap.yaml @@ -0,0 +1,21 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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: ConfigMap +metadata: + name: sdnc-portal-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/sdnc/charts/sdnc-portal/templates/deployment.yaml b/kubernetes/sdnc/charts/sdnc-portal/templates/deployment.yaml new file mode 100644 index 0000000000..5e1293c37f --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/templates/deployment.yaml @@ -0,0 +1,104 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - {{ .Values.config.mysqlChartName }} + - --container-name + - {{ .Values.config.sdncChartName }} + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness + containers: + - name: {{ include "common.name" . }} + command: ["/bin/bash"] + args: ["-c", "cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh"] + image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "common.fullname" . }} + key: db-root-password + - name: SDNC_CONFIG_DIR + value: "{{ .Values.config.configDir }}" + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: {{ .Values.config.configDir }} + name: sdnc-conf + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} + {{- end -}} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} + {{- end }} + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: sdnc-conf + configMap: + name: sdnc-portal-configmap + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key"
\ No newline at end of file diff --git a/kubernetes/sdnc/charts/sdnc-portal/templates/secrets.yaml b/kubernetes/sdnc/charts/sdnc-portal/templates/secrets.yaml new file mode 100644 index 0000000000..345c194d96 --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.fullname" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + db-root-password: {{ .Values.config.dbRootPassword | b64enc | quote }} diff --git a/kubernetes/sdnc/charts/sdnc-portal/templates/service.yaml b/kubernetes/sdnc/charts/sdnc-portal/templates/service.yaml new file mode 100644 index 0000000000..2d67c1f26e --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/templates/service.yaml @@ -0,0 +1,50 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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: Service +metadata: + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: + msb.onap.org/service-info: '[ + { + "serviceName": "sdnc-portal", + "version": "v1", + "url": "/", + "protocol": "UI", + "port": "{{ .Values.service.externalPort }}", + "visualRange":"0|1" + } + ]' +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.name }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }}
\ No newline at end of file diff --git a/kubernetes/sdnc/charts/sdnc-portal/values.yaml b/kubernetes/sdnc/charts/sdnc-portal/values.yaml new file mode 100644 index 0000000000..b5be3a61c6 --- /dev/null +++ b/kubernetes/sdnc/charts/sdnc-portal/values.yaml @@ -0,0 +1,80 @@ +# Copyright © 2017 Amdocs, Bell Canada +# +# 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. + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + repositorySecret: eyJuZXh1czMub25hcC5vcmc6MTAwMDEiOnsidXNlcm5hbWUiOiJkb2NrZXIiLCJwYXNzd29yZCI6ImRvY2tlciIsImVtYWlsIjoiQCIsImF1dGgiOiJaRzlqYTJWeU9tUnZZMnRsY2c9PSJ9fQ== + readinessRepository: oomk8s + readinessImage: readiness-check:1.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/admportal-sdnc-image:1.3-STAGING-latest +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +# application configuration +config: + mysqlChartName: sdnc-dbhost + dbRootPassword: openECOMP1.0 + sdncChartName: sdnc + configDir: /opt/onap/sdnc/data/properties + +# default number of instances +replicaCount: 1 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 10 + periodSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 10 + periodSeconds: 10 + +service: + type: NodePort + name: sdnc-portal + internalPort: 8443 + externalPort: 8443 + nodePort: "01" + +ingress: + enabled: false + +resources: {} +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi |