From 1fd5b3964a142be6c176dcc886d79a614c04ce70 Mon Sep 17 00:00:00 2001 From: Akhila Kishore Date: Wed, 6 Mar 2019 06:34:09 -0800 Subject: Restructuring the repo. The idea is to restructure the existing repo create a deployment independent of Vagrant or other hosting providers. Renamed KRD to KUbernetes Deploy(Kud) including the ansible scripts Added new path to functional tests. Moved samples pdfs to sites. Minor changes to Readme. Updated aio.sh, moved sample config Corrected other nits. Updated and verified test cases. Addressed comments and changes associated with it. Updated Readme and minor change in Vagrantfile. Validated test cases again. Moved aio.sh into vagrant folder. Added new README for each hosting provider and project on the whole. Updated the installer script with relative path. Updated the name to deployment_infra, moved the cFW sripcts to tests. Updated the gitignore file. Issue-ID: MULTICLOUD-301 Change-Id: Ie48c26b12ab58b604493fba58a9c5b9f8ba10942 Signed-off-by: Akhila Kishore --- .../vnfs/testrb/helm/vault-consul-dev/Chart.yaml | 19 +++++ .../helm/vault-consul-dev/charts/common/Chart.yaml | 18 +++++ .../charts/common/templates/_name.tpl | 31 ++++++++ .../charts/common/templates/_namespace.tpl | 26 +++++++ .../charts/common/templates/_repository.tpl | 48 ++++++++++++ .../charts/common/templates/_service.tpl | 31 ++++++++ .../vault-consul-dev/charts/common/values.yaml | 44 +++++++++++ .../vault-consul-dev/templates/deployment.yaml | 62 +++++++++++++++ .../helm/vault-consul-dev/templates/service.yaml | 39 ++++++++++ .../vnfs/testrb/helm/vault-consul-dev/values.yaml | 90 ++++++++++++++++++++++ 10 files changed, 408 insertions(+) create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/Chart.yaml create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/Chart.yaml create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_name.tpl create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_namespace.tpl create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_repository.tpl create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_service.tpl create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/values.yaml create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/deployment.yaml create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/service.yaml create mode 100644 kud/tests/vnfs/testrb/helm/vault-consul-dev/values.yaml (limited to 'kud/tests/vnfs/testrb/helm/vault-consul-dev') diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/Chart.yaml b/kud/tests/vnfs/testrb/helm/vault-consul-dev/Chart.yaml new file mode 100644 index 00000000..86643c9d --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/Chart.yaml @@ -0,0 +1,19 @@ +# Copyright 2018 Intel Corporation, Inc +# +# 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: Chart to launch Vault and consul in dev mode +name: vault-consul-dev +appVersion: 0.9.5 +version: 2.0.0 diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/Chart.yaml b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/Chart.yaml new file mode 100644 index 00000000..7d58e53d --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/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: Common templates for inclusion in other charts +name: common +version: 2.0.0 diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_name.tpl b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_name.tpl new file mode 100644 index 00000000..42999846 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_name.tpl @@ -0,0 +1,31 @@ +{{/* +# 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. +*/}} + +{{/* + Expand the name of a chart. +*/}} +{{- define "common.name" -}} + {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* + Create a default fully qualified application name. + Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "common.fullname" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} \ No newline at end of file diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_namespace.tpl b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_namespace.tpl new file mode 100644 index 00000000..94c9ee72 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_namespace.tpl @@ -0,0 +1,26 @@ +{{/* +# 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. +*/}} + +{{/* + Resolve the namespace to apply to a chart. The default namespace suffix + is the name of the chart. This can be overridden if necessary (eg. for subcharts) + using the following value: + + - .Values.nsPrefix : override namespace prefix +*/}} +{{- define "common.namespace" -}} + {{- default .Release.Namespace .Values.nsPrefix -}} +{{- end -}} diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_repository.tpl b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_repository.tpl new file mode 100644 index 00000000..364ba7dc --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_repository.tpl @@ -0,0 +1,48 @@ +{{/* +# 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. +*/}} + +{{/* + Resolve the name of the common image repository. + The value for .Values.repository is used by default, + unless either override mechanism is used. + + - .Values.global.repository : override default image repository for all images + - .Values.repositoryOverride : override global and default image repository on a per image basis +*/}} +{{- define "common.repository" -}} + {{if .Values.repositoryOverride }} + {{- printf "%s" .Values.repositoryOverride -}} + {{else}} + {{- default .Values.repository .Values.global.repository -}} + {{end}} +{{- end -}} + + +{{/* + Resolve the image repository secret token. + The value for .Values.global.repositoryCred is used: + repositoryCred: + user: user + password: password + mail: email (optional) +*/}} +{{- define "common.repository.secret" -}} + {{- $repo := include "common.repository" . }} + {{- $cred := .Values.global.repositoryCred }} + {{- $mail := default "@" $cred.mail }} + {{- $auth := printf "%s:%s" $cred.user $cred.password | b64enc }} + {{- printf "{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}" $repo $cred.user $cred.password $mail $auth | b64enc -}} +{{- end -}} diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_service.tpl b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_service.tpl new file mode 100644 index 00000000..77b77d05 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/templates/_service.tpl @@ -0,0 +1,31 @@ +{{/* +# 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. +*/}} + +{{/* + Resolve the name of a chart's service. + + The default will be the chart name (or .Values.nameOverride if set). + And the use of .Values.service.name overrides all. + + - .Values.service.name : override default service (ie. chart) name +*/}} +{{/* + Expand the service name for a chart. +*/}} +{{- define "common.servicename" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} \ No newline at end of file diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/values.yaml b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/values.yaml new file mode 100644 index 00000000..f7098ee8 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/charts/common/values.yaml @@ -0,0 +1,44 @@ +# 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 default values that can be inherited by +# all subcharts. +################################################################# +global: + # Change to an unused port prefix range to prevent port conflicts + # with other instances running within the same k8s cluster + nodePortPrefix: 302 + + # image repositories + repository: nexus3.onap.org:10001 + + # readiness check + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + + # logging agent + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + + # image pull policy + pullPolicy: Always + + # default mount path root directory referenced + # by persistent volumes and log files + persistence: + mountPath: /dockerdata-nfs + + # flag to enable debugging - application support required + debugEnabled: true diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/deployment.yaml b/kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/deployment.yaml new file mode 100644 index 00000000..66b2e747 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/deployment.yaml @@ -0,0 +1,62 @@ +# Copyright 2018 Intel Corporation, Inc +# +# 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: apps/v1 +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 }} + selector: + matchLabels: + app: {{ include "common.name" . }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - image: "{{ .Values.image.vault }}" + name: {{ include "common.name" . }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: ["vault","server","-dev"] + ports: + - containerPort: {{ .Values.service.internalPort }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + + - image: "{{ .Values.image.consul }}" + name: {{ include "common.name" . }}-backend + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: ["consul","agent","-dev"] + ports: + - name: http + containerPort: 8500 + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + volumes: + - name: localtime + hostPath: + path: /etc/localtime diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/service.yaml b/kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/service.yaml new file mode 100644 index 00000000..04e9a5a9 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/templates/service.yaml @@ -0,0 +1,39 @@ +# Copyright 2018 Intel Corporation, Inc +# +# 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.servicename" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.fullname" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - name: {{ .Values.service.portName }} + {{if eq .Values.service.type "NodePort" -}} + port: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default "302" }}{{ .Values.service.nodePort }} + {{- else -}} + port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + {{- end}} + protocol: TCP + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kud/tests/vnfs/testrb/helm/vault-consul-dev/values.yaml b/kud/tests/vnfs/testrb/helm/vault-consul-dev/values.yaml new file mode 100644 index 00000000..87c64026 --- /dev/null +++ b/kud/tests/vnfs/testrb/helm/vault-consul-dev/values.yaml @@ -0,0 +1,90 @@ +# Copyright 2018 Intel Corporation, Inc +# +# 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 + persistence: {} + +# application image +image: + consul: consul:1.0.6 + vault: vault:0.10.0 +pullPolicy: Always + +# flag to enable debugging - application support required +debugEnabled: false + +################################################################# +# Application configuration defaults. +################################################################# +config: + consul: + server: true + log_level: INFO + server: true + data_dir: '/consul/data' + ports: + http: 8500 + https: -1 + + vault: + storage: + consul: + address: localhost:8500 + path: vault + listener: + tcp: + address: '[::]:8200' + tls_disable: true + disable_mlock: true + +# 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 + +persistence: + enabled: true + volumeReclaimPolicy: Retain + accessMode: ReadWriteOnce + size: 2Gi + mountPath: /dockerdata-nfs + mountSubPath: sms/consul/data + +service: + type: NodePort + name: vault-consul + portName: vault-consul + internalPort: 8200 + nodePort: 44 + +ingress: + enabled: false -- cgit 1.2.3-korg