diff options
author | avicha <Avich@amdocs.com> | 2019-03-14 18:45:12 +0200 |
---|---|---|
committer | avicha <Avich@amdocs.com> | 2019-03-14 19:39:55 +0200 |
commit | 1748956d353d17c4864ae012fc9612cccbdd391e (patch) | |
tree | c2cc66ca91caf534e34795aa4d863b913956d881 | |
parent | 27804b7b710cde9f57209e0a32019112c621a037 (diff) |
Initial commit
Change-Id: I770e0a1d036e01e3230310ace6f27d3f2aec5c58
Issue-ID: OOM-1359
Signed-off-by: avicha <Avich@amdocs.com>
-rw-r--r-- | kubernetes/selfservice/Chart.yaml | 4 | ||||
-rw-r--r-- | kubernetes/selfservice/requirements.yaml | 18 | ||||
-rw-r--r-- | kubernetes/selfservice/resources/config/catalog.yaml | 19 | ||||
-rw-r--r-- | kubernetes/selfservice/resources/config/globalValues.yaml | 32 | ||||
-rw-r--r-- | kubernetes/selfservice/resources/config/repositories.yaml | 7 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/configmap.yaml | 7 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/deployment.yaml | 66 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/pv.yaml | 55 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/pvc.yaml | 55 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/secrets.yaml | 34 | ||||
-rw-r--r-- | kubernetes/selfservice/templates/service.yaml | 38 | ||||
-rw-r--r-- | kubernetes/selfservice/values.yaml | 135 |
12 files changed, 470 insertions, 0 deletions
diff --git a/kubernetes/selfservice/Chart.yaml b/kubernetes/selfservice/Chart.yaml new file mode 100644 index 0000000000..fe2839232b --- /dev/null +++ b/kubernetes/selfservice/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: Selfservice for ONAP deployment +name: selfservice +version: 3.0.0 diff --git a/kubernetes/selfservice/requirements.yaml b/kubernetes/selfservice/requirements.yaml new file mode 100644 index 0000000000..9f23fac6f8 --- /dev/null +++ b/kubernetes/selfservice/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: ~3.0.0 + repository: '@local' diff --git a/kubernetes/selfservice/resources/config/catalog.yaml b/kubernetes/selfservice/resources/config/catalog.yaml new file mode 100644 index 0000000000..18cf6af212 --- /dev/null +++ b/kubernetes/selfservice/resources/config/catalog.yaml @@ -0,0 +1,19 @@ +- name: 'ONAP Casablanca Basic' + components: + - {name: aai, repoName: local, version: '3.0.0'} + - {name: appc, repoName: local, version: '3.0.0'} + - {name: clamp, repoName: local, version: '3.0.0'} + - {name: consul, repoName: local, version: '3.0.0'} + - {name: dcaegen2, repoName: local, version: '3.0.0'} + - {name: dmaap, repoName: local, version: '3.0.0'} + - {name: onap, repoName: local, version: '3.0.0'} + - {name: log, repoName: local, version: '3.0.0'} + - {name: msb, repoName: local, version: '3.0.0'} + - {name: policy, repoName: local, version: '3.0.0'} + - {name: portal, repoName: local, version: '3.0.0'} + - {name: robot, repoName: local, version: '3.0.0'} + - {name: sdc, repoName: local, version: '3.0.0'} + - {name: sdnc, repoName: local, version: '3.0.0'} + - {name: so, repoName: local, version: '3.0.0'} + - {name: vid, repoName: local, version: '3.0.0'} + diff --git a/kubernetes/selfservice/resources/config/globalValues.yaml b/kubernetes/selfservice/resources/config/globalValues.yaml new file mode 100644 index 0000000000..0d1b96ce81 --- /dev/null +++ b/kubernetes/selfservice/resources/config/globalValues.yaml @@ -0,0 +1,32 @@ +config: + openStackType: "{{ .Values.config.openStackType }}" + openStackName: "{{ .Values.config.openStackName }}" + openStackEncryptedPassword: "{{ .Values.config.openStackEncryptedPasswordHere }}" + openStackDomain: "{{ .Values.config.openStackDomain }}" + openStackKeyStoneUrl: "{{ .Values.config.openStackKeyStoneUrl }}/v2.0" + openStackServiceTenantName: "{{ .Values.config.openStackServiceTenantName }}" + openStackUserName: "{{ .Values.config.openStackUserName }}" + openStackRegion: "{{ .Values.config.openStackRegion }}" + openStackVNFTenantId: "{{ .Values.config.openStackVNFTenantId }}" + openStackEncryptedPasswordHere: "{{ .Values.config.openStackEncryptedPasswordHere }}" + +################## +# Robot Values # +################## +demoArtifactsVersion: "{{ .Values.demoArtifactsVersion }}" +openStackFlavourMedium: "{{ .Values.openStackFlavourMedium }}" +openStackKeyStoneUrl: "{{ .Values.openStackKeyStoneUrl }}" +openStackPublicNetId: "{{ .Values.openStackPublicNetId }}" +openStackPassword: "{{ .Values.openStackPassword }}" +openStackRegion: "{{ .Values.openStackRegion }}" +openStackTenantId: "{{ .Values.openStackTenantId }}" +openStackUserName: "{{ .Values.openStackUserName }}" +ubuntu14Image: "{{ .Values.ubuntu14Image }}" +ubuntu16Image: "{{ .Values.ubuntu16Image }}" +scriptVersion: "{{ .Values.scriptVersion }}" +openStackPrivateNetId: "{{ .Values.openStackPrivateNetId }}" +openStackPrivateSubnetId: "{{ .Values.openStackPrivateSubnetId }}" +openStackPrivateNetCidr: "{{ .Values.openStackPrivateNetCidr }}" +openStackOamNetworkCidrPrefix: "{{ .Values.openStackOamNetworkCidrPrefix }}" +vnfPubKey: "{{ .Values.vnfPubKey }}" +dcaeCollectorIp: "{{ .Values.dcaeCollectorIp }}"
\ No newline at end of file diff --git a/kubernetes/selfservice/resources/config/repositories.yaml b/kubernetes/selfservice/resources/config/repositories.yaml new file mode 100644 index 0000000000..b0271e73e7 --- /dev/null +++ b/kubernetes/selfservice/resources/config/repositories.yaml @@ -0,0 +1,7 @@ +- repoName: local + url: http://{{ .Values.helmrepo.local }}:8879/local + refreshRateSec: 1000 +- repoName: stable + url: https://kubernetes-charts.storage.googleapis.com + refreshRateSec: 500 + diff --git a/kubernetes/selfservice/templates/configmap.yaml b/kubernetes/selfservice/templates/configmap.yaml new file mode 100644 index 0000000000..af1d51e19c --- /dev/null +++ b/kubernetes/selfservice/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} diff --git a/kubernetes/selfservice/templates/deployment.yaml b/kubernetes/selfservice/templates/deployment.yaml new file mode 100644 index 0000000000..e9588e4c0f --- /dev/null +++ b/kubernetes/selfservice/templates/deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + name: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + annotations: + checksum.helm.kubernetes.io/configmap: {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }} + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image:"{{ .Values.global.selfserviceRepository }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: {{ .Values.deployerVolumePath }}/resources + name: initial-resources + - mountPath: {{ .Values.deployerVolumePath }}/k8s + name: k8s-api-secret + readOnly: true + - mountPath: /var/log/aee/portal + name: {{ include "common.fullname" . }}-pvc-log + - mountPath: /var/AEE/hde + name: {{ include "common.fullname" . }}-pvc + ports: + - containerPort: {{ .Values.service.httpInternalPort }} + - containerPort: {{ .Values.service.debugInternalPort }} + - containerPort: {{ .Values.service.dbInternalPort }} + {{ if .Values.liveness.enabled }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.httpInternalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end }} + readinessProbe: + tcpSocket: + port: {{ .Values.service.httpInternalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + volumes: + - name: k8s-api-secret + secret: + secretName: k8s-api-secret + - name: initial-resources + configMap: + name: {{ include "common.fullname" . }}-configmap + - name: {{ include "common.fullname" . }}-pvc-log + persistentVolumeClaim: + claimName: {{ include "common.fullname" . }}-log + - name: {{ include "common.fullname" . }}-pvc + persistentVolumeClaim: + claimName: {{ .Values.persistence.volumeMountName }} + restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-ss-docker-registry-key" diff --git a/kubernetes/selfservice/templates/pv.yaml b/kubernetes/selfservice/templates/pv.yaml new file mode 100644 index 0000000000..6af58d6105 --- /dev/null +++ b/kubernetes/selfservice/templates/pv.yaml @@ -0,0 +1,55 @@ +{{/* +# 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. +*/}} + +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ .Values.persistence.volumeName}} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ .Values.persistence.volumeName}} +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}-log + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + name: {{ include "common.fullname" . }}-log +spec: + capacity: + storage: {{ .Values.persistence.size}} + accessModes: + - {{ .Values.persistence.accessMode }} + persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} + hostPath: + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPathLog }} diff --git a/kubernetes/selfservice/templates/pvc.yaml b/kubernetes/selfservice/templates/pvc.yaml new file mode 100644 index 0000000000..1301f485f5 --- /dev/null +++ b/kubernetes/selfservice/templates/pvc.yaml @@ -0,0 +1,55 @@ +{{/* +# 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. +*/}} + +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ .Values.persistence.volumeMountName }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + name: {{ .Values.persistence.volumeName}} + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size}} +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}-log + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + name: {{ include "common.fullname" . }}-log + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size}} diff --git a/kubernetes/selfservice/templates/secrets.yaml b/kubernetes/selfservice/templates/secrets.yaml new file mode 100644 index 0000000000..fe2198d126 --- /dev/null +++ b/kubernetes/selfservice/templates/secrets.yaml @@ -0,0 +1,34 @@ +# An optional propery file for accessing the k8s by self service, for deployment, tiller etc. +# It is assumed to be prepared during boot strapping +# By default this is NOT required +# The content of the file should be a java properties format and should include the following keys +# username - the k8s username to use, for example kubernetes-admin +# token - the k8s token to use, for example as returned by: +# $ kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t' +# api_url - the k8s api url, for example https://10.247.88.15:6443 +# Once you have this file, you may pass its base64 value, for example, if you placed the file at /root/k8s/access.props: +# helm install --set k8sAccessProps=`cat /root/k8s/access.props |base64 --wrap 0` -n aee-selfservice selfservice +apiVersion: v1 +kind: Secret +metadata: + name: k8s-api-secret + namespace: {{ include "common.namespace" . }} +type: Opaque +data: + access.props: {{ .Values.k8sAccessProps }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.namespace" . }}-ss-docker-registry-key + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + .dockercfg: {{ include "common.repository.secret" . }} +type: kubernetes.io/dockercfg + + diff --git a/kubernetes/selfservice/templates/service.yaml b/kubernetes/selfservice/templates/service.yaml new file mode 100644 index 0000000000..44442551e9 --- /dev/null +++ b/kubernetes/selfservice/templates/service.yaml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - name: {{ .Values.service.httpPortName }} + port: {{ .Values.service.httpExternalPort }} + nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.httpNodePort }} + - name: {{ .Values.service.debugPortName }} + port: {{ .Values.service.debugExternalPort }} + nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.debugNodePort }} + - name: {{ .Values.service.dbPortName }} + port: {{ .Values.service.dbExternalPort }} + nodePort: {{ .Values.global.nodePortPrefixExt | default .Values.nodePortPrefixExt }}{{ .Values.service.dbNodePort }} + {{- else -}} + - name: {{ .Values.service.httpPortName }} + port: {{ .Values.service.httpExternalPort }} + targetPort: {{ .Values.service.httpInternalPort }} + - name: {{ .Values.service.debugPortName }} + port: {{ .Values.service.debugExternalPort }} + targetPort: {{ .Values.service.debugInternalPort }} + - name: {{ .Values.service.dbPortName }} + port: {{ .Values.service.dbExternalPort }} + targetPort: {{ .Values.service.dbInternalPort }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + diff --git a/kubernetes/selfservice/values.yaml b/kubernetes/selfservice/values.yaml new file mode 100644 index 0000000000..d20e36c96b --- /dev/null +++ b/kubernetes/selfservice/values.yaml @@ -0,0 +1,135 @@ +# 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: + nodePortPrefixExt: 30 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + selfserviceRepository: oomk8s + restartPolicy: Always + persistence: + mountPath: /dockerdata-nfs + + # ONAP Repository + # Uncomment the following to enable the use of a single docker + # repository but ONLY if your repository mirrors all ONAP + # docker images. This includes all images from dockerhub and + # any other repository that hosts images for ONAP components. + repository: nexus3:10001 + repositoryCred: + user: docker + password: docker + +################################################################# +# Application configuration defaults. +################################################################# + +deployerVolumePath: /etc/ONAP/deployer +k8sAccessProps: Cg== +repository: nexus3:10001 +image: oomk8/selfservice-docker:1.2.0 +pullPolicy: Always + +# default number of instances +replicaCount: 1 + +# 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 + httpPortName: sshttp + httpInternalPort: 8080 + httpExternalPort: 8080 + httpNodePort: 31 + dbPortName: ssdb + dbInternalPort: 1527 + dbExternalPort: 1527 + dbNodePort: 32 + debugPortName: ssdebug + debugInternalPort: 9999 + debugExternalPort: 9999 + debugNodePort: 33 + +helmrepo: + local: 127.0.0.1 + + +persistence: + ## A manually managed Persistent Volume and Claim + ## Requires persistence.enabled: true + ## If defined, PVC must be created manually before volume will be bound + # existingClaim: + volumeReclaimPolicy: Retain + + ## database data Persistent Volume Storage Class + ## If defined, storageClassName: <storageClass> + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteMany + size: 2Gi + mountPath: /dockerdata-nfs + mountSubPath: selfservice + mountSubPathLog: logs + volumeName: selfservice-pv + volumeMountName: selfservice-pvc + +config: + openStackType: "{{ .Values.config.openStackType }}" + openStackName: "{{ .Values.config.openStackName }}" + openStackEncryptedPassword: "{{ .Values.config.openStackEncryptedPasswordHere }}" + openStackDomain: "{{ .Values.config.openStackDomain }}" + openStackKeyStoneUrl: "{{ .Values.config.openStackKeyStoneUrl }}/v2.0" + openStackServiceTenantName: "{{ .Values.config.openStackServiceTenantName }}" + openStackUserName: "{{ .Values.config.openStackUserName }}" + openStackRegion: "{{ .Values.config.openStackRegion }}" + openStackVNFTenantId: "{{ .Values.config.openStackVNFTenantId }}" + openStackEncryptedPasswordHere: "{{ .Values.config.openStackEncryptedPasswordHere }}" + +################## +# Robot Values # +################## +demoArtifactsVersion: "{{ .Values.demoArtifactsVersion }}" +openStackFlavourMedium: "{{ .Values.openStackFlavourMedium }}" +openStackKeyStoneUrl: "{{ .Values.openStackKeyStoneUrl }}" +openStackPublicNetId: "{{ .Values.openStackPublicNetId }}" +openStackPassword: "{{ .Values.openStackPassword }}" +openStackRegion: "{{ .Values.openStackRegion }}" +openStackTenantId: "{{ .Values.openStackTenantId }}" +openStackUserName: "{{ .Values.openStackUserName }}" +ubuntu14Image: "{{ .Values.ubuntu14Image }}" +ubuntu16Image: "{{ .Values.ubuntu16Image }}" +scriptVersion: "{{ .Values.scriptVersion }}" +openStackPrivateNetId: "{{ .Values.openStackPrivateNetId }}" +openStackPrivateSubnetId: "{{ .Values.openStackPrivateSubnetId }}" +openStackPrivateNetCidr: "{{ .Values.openStackPrivateNetCidr }}" +openStackOamNetworkCidrPrefix: "{{ .Values.openStackOamNetworkCidrPrefix }}" +vnfPubKey: "{{ .Values.vnfPubKey }}" +dcaeCollectorIp: "{{ .Values.dcaeCollectorIp }}" |