diff options
Diffstat (limited to 'kubernetes/dcaegen2/charts')
44 files changed, 2057 insertions, 0 deletions
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/.helmignore b/kubernetes/dcaegen2/charts/dcae-bootstrap/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/.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/dcaegen2/charts/dcae-bootstrap/Chart.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/Chart.yaml new file mode 100644 index 0000000000..61cb14cebc --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/Chart.yaml @@ -0,0 +1,22 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +apiVersion: v1 +description: ONAP DCAE Bootstrap +name: dcae-bootstrap +version: 2.0.0 diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml new file mode 100644 index 0000000000..9f53d90c06 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml @@ -0,0 +1,25 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' + - name: postgres + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/config/k8s-plugin.json b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/config/k8s-plugin.json new file mode 100644 index 0000000000..5d83ff8f44 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/config/k8s-plugin.json @@ -0,0 +1,32 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{ + "namespace" : "{{ if .Values.dcae_ns }}{{ .Values.dcae_ns}}{{ else }}{{include "common.namespace" . }}{{ end}}", + "consul_dns_name" : "{{ .Values.config.address.consul.host }}.{{ include "common.namespace" . }}", + "image_pull_secrets" : ["{{ include "common.namespace" . }}-docker-registry-key"], + "filebeat": + { + "log_path": "/var/log/onap", + "data_path": "/usr/share/filebeat/data", + "config_path": "/usr/share/filebeat/filebeat.yml", + "config_subpath": "filebeat.yml", + "image" : "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}", + "config_map" : "dcae-filebeat-configmap" + } +} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-config_binding_service-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-config_binding_service-inputs.yaml new file mode 100644 index 0000000000..72a3441d31 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-config_binding_service-inputs.yaml @@ -0,0 +1,23 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +#TODO would like to make this conditional, as with the other input templates +# but having template expansion issues trying to do that +{{ if .Values.componentImages.config_binding_service }} +cbs_image: {{ include "common.repository" . }}/{{ .Values.componentImages.config_binding_service }} +{{ end }} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-deployment_handler-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-deployment_handler-inputs.yaml new file mode 100644 index 0000000000..4f7c67003b --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-deployment_handler-inputs.yaml @@ -0,0 +1,27 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +{{ if .Values.componentImages.deployment_handler }} +deployment_handler_image: {{ include "common.repository" . }}/{{ .Values.componentImages.deployment_handler }} +{{ end }} +application_config: + cloudify: + protocol: "http" + inventory: + protocol: "http" diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml new file mode 100644 index 0000000000..b831602130 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml @@ -0,0 +1,28 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{ +{{ if .Values.componentImages.holmes_engine }} + "he_image" : '{{ include "common.repository" . }}/{{ .Values.componentImages.holmes_engine }}', +{{ end }} + "msb_hostname": "{{ .Values.config.address.msb_discovery }}.{{include "common.namespace" . }}", + "dcae_CL_publish_url": "http://{{ .Values.config.address.message_router }}.{{include "common.namespace" . }}:3904/events/unauthenticated.DCAE_CL_OUTPUT", + "ves_fault_publish_url": "http://{{ .Values.config.address.message_router }}.{{include "common.namespace" . }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT", + "pgaas_cluster_name" : "{{ .Values.postgres.service.name2 }}.{{include "common.namespace" . }}", + "database_name":"holmes" +} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-inputs.yaml new file mode 100644 index 0000000000..d1413fcdbd --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-inputs.yaml @@ -0,0 +1,27 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{ +{{ if .Values.componentImages.holmes_rules }} + "hr_image" : '{{ include "common.repository" . }}/{{ .Values.componentImages.holmes_rules }}', +{{ end }} + + "msb_hostname": "{{ .Values.config.address.msb_discovery }}.{{include "common.namespace" . }}", + "pgaas_cluster_name" : "{{ .Values.postgres.service.name2 }}.{{include "common.namespace" . }}", + "database_name":"holmes" +} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-inventory-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-inventory-inputs.yaml new file mode 100644 index 0000000000..a4fdfbb197 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-inventory-inputs.yaml @@ -0,0 +1,32 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +sdc_address: '{{ .Values.config.address.sdc }}.{{include "common.namespace" . }}:8443' +sdc_uri: 'https://{{ .Values.config.address.sdc }}.{{include "common.namespace" . }}:8443' +sdc_user: "dcae" +sdc_password: !!str Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +sdc_environment_name: "AUTO" +sdc_msg_bus_address: '{{ .Values.config.address.message_router }}.{{include "common.namespace" . }}' +postgres_user_inventory: "postgres" +postgres_password_inventory: "onap123" +{{ if .Values.componentImages.service_change_handler }} +service_change_handler_image: '{{ include "common.repository" . }}/{{ .Values.componentImages.service_change_handler }}' +{{ end }} +{{ if .Values.componentImages.inventory }} +inventory_image: '{{ include "common.repository" . }}/{{ .Values.componentImages.inventory }}' +{{ end }} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-pgaas-initdb-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-pgaas-initdb-inputs.yaml new file mode 100644 index 0000000000..b201247136 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-pgaas-initdb-inputs.yaml @@ -0,0 +1,19 @@ +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +k8s_pgaas_instance_fqdn: {{ .Values.postgres.service.name2 }}.{{include "common.namespace" . }} +k8s_initial_password: {{ .Values.postgres.config.pgRootPassword }} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-policy_handler-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-policy_handler-inputs.yaml new file mode 100644 index 0000000000..846bc43290 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-policy_handler-inputs.yaml @@ -0,0 +1,54 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{{ if .Values.componentImages.policy_handler }} +policy_handler_image: {{ include "common.repository" . }}/{{ .Values.componentImages.policy_handler }} +{{ end }} +application_config: + policy_handler : + # parallelize the getConfig queries to policy-engine on each policy-update notification + thread_pool_size : 4 + + # parallelize requests to policy-engine and keep them alive + pool_connections : 20 + + # list of policyName prefixes (filters) that DCAE-Controller handles (=ignores any other policyName values) + scope_prefixes : ["DCAE.Config_"] + + # retry to getConfig from policy-engine on policy-update notification + policy_retry_count : 5 + policy_retry_sleep : 5 + + # policy-engine config + # These are the url of and the auth for the external system, namely the policy-engine (PDP). + # We obtain that info manually from PDP folks at the moment. + # In long run we should figure out a way of bringing that info into consul record + # related to policy-engine itself. + policy_engine : + url : "http://{{ .Values.config.address.policy_pdp }}.{{include "common.namespace" . }}:8081" + path_pdp : "/pdp/" + path_api : "/pdp/api/" + headers : + Accept : "application/json" + "Content-Type" : "application/json" + ClientAuth : "cHl0aG9uOnRlc3Q=" + Authorization : "Basic dGVzdHBkcDphbHBoYTEyMw==" + Environment : "TEST" + target_entity : "policy_engine" + # name of deployment-handler service in consul for policy-handler to direct the policy-updates to + deploy_handler : "deployment_handler" diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml new file mode 100644 index 0000000000..d998dfa418 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml @@ -0,0 +1,28 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{{ if .Values.componentImages.tca }} +tag_version: {{ include "common.repository" . }}/{{ .Values.componentImages.tca }} +{{ end }} +dmaap_host: {{ .Values.config.address.message_router }}.{{include "common.namespace" . }} +consul_host: {{ .Values.config.address.consul.host }}.{{include "common.namespace" . }} +cbs_host: config-binding-service +enableRedisCaching: {{ .Values.config.redisCaching }} +{{ if .Values.config.redisHosts }} +redisHosts: {{ .Values.config.redisHosts }} +{{ end }} diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml new file mode 100644 index 0000000000..276de2a358 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml @@ -0,0 +1,26 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{{ if .Values.componentImages.ves }} +tag_version: {{ include "common.repository" . }}/{{ .Values.componentImages.ves }} +{{ end }} +external_port : "30235" +ves_other_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.SEC_OTHER_OUTPUT/" +ves_heartbeat_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/" +ves_fault_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT/" +ves_measurement_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT/" diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/configmap.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/configmap.yaml new file mode 100644 index 0000000000..2c01206518 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/configmap.yaml @@ -0,0 +1,34 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dcae-config + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-dcae-inputs + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/inputs/*").AsConfig . | indent 2 }} + diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/job.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/job.yaml new file mode 100644 index 0000000000..a89ad7d710 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/job.yaml @@ -0,0 +1,99 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +apiVersion: batch/v1 +kind: Job +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: + completions: 1 +{{/* backoffLimit: 0*/}} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + restartPolicy: Never + initContainers: + - name: {{ include "common.name" . }}-readiness + image: {{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: + - /root/ready.py + args: + - --container-name + - dcae-cloudify-manager + - --container-name + - consul-server + - --container-name + - msb-discovery + - --container-name + - kube2msb + - "-t" + - "15" + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + volumeMounts: + - mountPath: /inputs + name: {{ include "common.fullname" . }}-dcae-inputs + - mountPath: /dcae-configs + name: {{ include "common.fullname" . }}-dcae-config + - mountPath: /etc/localtime + name: localtime + readOnly: true + env: + - name: CMADDR + value: {{ .Values.config.address.cm }} + - name: CMPASS + valueFrom: + secretKeyRef: + name: {{ include "common.name" . }}-cmpass + key: password + - name: CONSUL + value: {{ .Values.config.address.consul.host }}:{{ .Values.config.address.consul.port }} + - name: DCAE_NAMESPACE + value: {{ .Values.dcae_ns | default "" }} + - name: ONAP_NAMESPACE + value: {{ include "common.namespace" . }} + volumes: + - name: {{ include "common.fullname" . }}-dcae-inputs + configMap: + name: {{ include "common.fullname" . }}-dcae-inputs + - name: {{ include "common.fullname" . }}-dcae-config + configMap: + name: {{ include "common.fullname" . }}-dcae-config + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/secret.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/secret.yaml new file mode 100644 index 0000000000..a328ab278c --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/templates/secret.yaml @@ -0,0 +1,31 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.name" . }}-cmpass + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +type: Opaque +data: + password: YWRtaW4= diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml new file mode 100644 index 0000000000..85f429c23d --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml @@ -0,0 +1,84 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + +config: + logstashServiceName: log-ls + logstashPort: 5044 + # Addresses of ONAP components + address: + consul: + host: consul-server + port: 8500 + cm: dcae-cloudify-manager + message_router: message-router + msb_discovery: msb-discovery + policy_pdp: pdp + sdc: sdc-be + # redisCaching is a string not a boolean! + redisCaching: "false" + +# postgres values--overriding defaults in the postgres subchart +postgres: + nameOverride: dcae-db + service: + name: dcae-postgres + name2: dcae-pg-primary + name3: dcae-pg-replica + container: + name: + primary: dcae-pg-primary + replica: dcae-pg-replica + config: + pgPrimaryPassword: onapdemodb + pgRootPassword: onapdemodb + persistence: + mountSubPath: dcae/data + mountInitPath: dcae + +# application image +repository: nexus3.onap.org:10001 +image: onap/org.onap.dcaegen2.deployments.k8s-bootstrap-container:1.1.10 + +# DCAE component images to be deployed via Cloudify Manager +# Use to override default setting in blueprints +componentImages: + #TODO for further investigation: input template expansion issues if we comment this out + config_binding_service: onap/org.onap.dcaegen2.platform.configbinding:latest + deployment_handler: onap/org.onap.dcaegen2.platform.deployment-handler:latest + holmes_engine: onap/holmes/engine-management:latest + holmes_rules: onap/holmes/rule-management:latest + inventory: onap/org.onap.dcaegen2.platform.inventory-api:latest + policy_handler: onap/org.onap.dcaegen2.platform.policy-handler:latest + service_change_handler: onap/org.onap.dcaegen2.platform.servicechange-handler:latest + tca: onap/org.onap.dcaegen2.deployments.tca-cdap-container:latest + ves: onap/org.onap.dcaegen2.collectors.ves.vescollector:latest + +# Kubernetes namespace for components deployed via Cloudify manager +# If empty, use the common namespace +# dcae_ns: "onap" + diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/.helmignore b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/.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/dcaegen2/charts/dcae-cloudify-manager/Chart.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/Chart.yaml new file mode 100644 index 0000000000..ff9cf89092 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/Chart.yaml @@ -0,0 +1,22 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +apiVersion: v1 +description: ONAP DCAE Cloudify Manager +name: dcae-cloudify-manager +version: 2.0.0 diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/README.md b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/README.md new file mode 100644 index 0000000000..9194ef8332 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/README.md @@ -0,0 +1,49 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +# DCAE Cloudify Manager Chart + +This chart is used to deploy a containerized version of +[Cloudify Manager](http://docs.getcloudify.org/4.3.0/intro/cloudify-manager/), +the orchestration tool used by DCAE. DCAE uses Cloudify Manager ("CM") to +deploy the rest of the DCAE platform as well to deploy DCAE monitoring and +analytics services dynamically, in response to network events such as VNF startups. + +Deployment of CM is the first of two steps in deploying DCAE into ONAP. After this chart +brings up CM, a second chart (the "bootstrap" chart) installs some plugin extensions onto CM +and uses CM to deploy some DCAE components. + +## Prerequisites +The chart requires one Kubernetes secret to be available in the namespace where it is +being deployed: + - `<namespace_name>-docker-registry-key`, the docker registry secret needed to pull images + from the Docker repository. This is the same secret used by other OOM charts. + +## DCAE Namespace +DCAE will use CM deploy a number of containers into the ONAP Kubernetes cluster. In a production +environment, DCAE's dynamic deployment of monitoring and analytics services could result in dozens +of containers being launched. This chart allows the configuration, through the `dcae_ns` property +in the `values.yaml` of a separate namespace used by CM when it needs to deploy containers into +Kubernetes. If `dcae_ns` is set, this chart will: + - create the namespace. + - create the Docker registry key secret in the namespace. + - create some Kubernetes `Services` (of the `ExternalName` type) to map some addresses from the common namespace into the DCAE namespace. + +## Use of Consul +DCAE uses [Consul](http://consul.io) to store configuration data for DCAE components. In R1, DCAE +deployed its own Consul cluster. In R2, DCAE will use the Consul server deployed by OOM. diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/requirements.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/requirements.yaml new file mode 100644 index 0000000000..1e8f788318 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/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/dcaegen2/charts/dcae-cloudify-manager/resources/config/config.txt b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/resources/config/config.txt new file mode 100644 index 0000000000..c33022d1a2 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/resources/config/config.txt @@ -0,0 +1,19 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= +[consul] +address={{ .Values.config.address.consul.host }}:{{ .Values.config.address.consul.port }} diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/resources/config/log/filebeat.yml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/resources/config/log/filebeat.yml new file mode 100644 index 0000000000..43de4a25b9 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/resources/config/log/filebeat.yml @@ -0,0 +1,72 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= +filebeat.prospectors: +#it is mandatory, in our case it's log +- input_type: log + #This is the canolical path as mentioned in logback.xml, *.* means it will monitor all files in the directory. + paths: + - /var/log/onap/*/*/*/*.log + - /var/log/onap/*/*/*.log + - /var/log/onap/*/*.log + #Files older than this should be ignored.In our case it will be 48 hours i.e. 2 days. It is a helping flag for clean_inactive + ignore_older: 48h + # Remove the registry entry for a file that is more than the specified time. In our case it will be 96 hours, i.e. 4 days. It will help to keep registry records with in limit + clean_inactive: 96h + + +# Name of the registry file. If a relative path is used, it is considered relative to the +# data path. Else full qualified file name. +#filebeat.registry_file: ${path.data}/registry + + +output.logstash: + #List of logstash server ip addresses with port number. + #But, in our case, this will be the loadbalancer IP address. + #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately. + hosts: ["{{.Values.config.logstashServiceName}}.{{.Release.Namespace}}:{{.Values.config.logstashPort}}"] + #If enable will do load balancing among availabe Logstash, automatically. + loadbalance: true + + #The list of root certificates for server verifications. + #If certificate_authorities is empty or not set, the trusted + #certificate authorities of the host system are used. + #ssl.certificate_authorities: $ssl.certificate_authorities + + #The path to the certificate for SSL client authentication. If the certificate is not specified, + #client authentication is not available. + #ssl.certificate: $ssl.certificate + + #The client certificate key used for client authentication. + #ssl.key: $ssl.key + + #The passphrase used to decrypt an encrypted key stored in the configured key file + #ssl.key_passphrase: $ssl.key_passphrase + +logging: + level: debug + + # enable file rotation with default configuration + to_files: true + + # do not log to syslog + to_syslog: false + + files: + path: /usr/share/filebeat/logs + name: mybeat.log + keepfiles: 7 diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/configmap.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/configmap.yaml new file mode 100644 index 0000000000..6bb02dbf44 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/configmap.yaml @@ -0,0 +1,44 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: dcae-filebeat-configmap + namespace: {{include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} +{{ if .Values.dcae_ns }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: dcae-filebeat-configmap + namespace: {{ .Values.dcae_ns }} +data: +{{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} +{{ end }} + diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml new file mode 100644 index 0000000000..acda520192 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml @@ -0,0 +1,97 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +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: 1 + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.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 }} + volumeMounts: + - mountPath: /opt/onap/config.txt + subPath: config.txt + name: {{ include "common.fullname" .}}-config + readOnly: true + - mountPath: /secret + name: dcae-token + readOnly: true + - mountPath: /sys/fs/cgroup + name: {{ include "common.fullname" . }}-cgroup + readOnly: true + - mountPath: /etc/localtime + name: localtime + readOnly: true + securityContext: + privileged: True + lifecycle: + postStart: + exec: + command: + - bash + - "-c" + - | + set -ex + mkdir -p /var/run/secrets/kubernetes.io/ + ln -s /secret /var/run/secrets/kubernetes.io/serviceaccount + volumes: + - name: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }}-configmap + - name: dcae-token + secret: + secretName: dcae-token + - name: {{ include "common.fullname" . }}-cgroup + hostPath: + path: /sys/fs/cgroup + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/namespace.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/namespace.yaml new file mode 100644 index 0000000000..fd89aabbed --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/namespace.yaml @@ -0,0 +1,28 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{{ if .Values.dcae_ns}} +# Create the namespace +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.dcae_ns }} +spec: + finalizers: + - kubernetes +{{ end }} diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/secret.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/secret.yaml new file mode 100644 index 0000000000..ff0b8312b3 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/secret.yaml @@ -0,0 +1,43 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +{{ if .Values.dcae_ns}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "common.namespace" . }}-docker-registry-key + namespace: {{ .Values.dcae_ns }} + 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 +--- +{{ end }} +# Copy of the API token secret, needed to work around /var/run/secrets mount problem +apiVersion: v1 +kind: Secret +metadata: + name: dcae-token + namespace: {{ include "common.namespace" . }} + annotations: + kubernetes.io/service-account.name: default +type: kubernetes.io/service-account-token diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml new file mode 100644 index 0000000000..56b2c619c7 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml @@ -0,0 +1,76 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +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" -}} + - 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 }} +{{ if .Values.dcae_ns}} +--- +# Make consul visible inside DCAE component namespace under a well-known name +apiVersion: v1 +kind: Service +metadata: + name: consul + namespace: {{ .Values.dcae_ns }} +spec: + type: ExternalName + externalName: {{ .Values.config.address.consul.host }}.{{ include "common.namespace" . }}.svc.cluster.local +--- +# Make Cloudify Manager visible inside DCAE component namespace under a well-known name +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.servicename" . }} + namespace: {{ .Values.dcae_ns }} +spec: + type: ExternalName + externalName: {{ .Values.service.name }}.{{ include "common.namespace" . }}.svc.cluster.local +{{ end }} +--- +# Provide alternate name for consul in common namespace to support CM plugin discovery +apiVersion: v1 +kind: Service +metadata: + name: consul + namespace: {{ include "common.namespace" . }} +spec: + type: ExternalName + externalName: {{ .Values.config.address.consul.host }}.{{ include "common.namespace" . }}.svc.cluster.local +--- diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/values.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/values.yaml new file mode 100644 index 0000000000..6d87be3441 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/values.yaml @@ -0,0 +1,69 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + repositoryCred: + user: docker + password: docker + +config: + logstashServiceName: log-ls + logstashPort: 5044 + # Addresses of other ONAP entities + address: + consul: + host: consul-server + port: 8500 + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/org.onap.dcaegen2.deployments.cm-container:latest +pullPolicy: Always + +# 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: ClusterIP + name: dcae-cloudify-manager + externalPort: 80 + internalPort: 80 + +# Kubernetes namespace for components deployed via Cloudify manager +# If empty, use the common namespace +# dcae_ns: "dcae" diff --git a/kubernetes/dcaegen2/charts/dcae-healthcheck/Chart.yaml b/kubernetes/dcaegen2/charts/dcae-healthcheck/Chart.yaml new file mode 100644 index 0000000000..4c01d4eca2 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-healthcheck/Chart.yaml @@ -0,0 +1,21 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= + +apiVersion: v1 +description: ONAP DCAE Health Check +name: dcae-healthcheck +version: 2.0.0 diff --git a/kubernetes/dcaegen2/charts/dcae-healthcheck/requirements.yaml b/kubernetes/dcaegen2/charts/dcae-healthcheck/requirements.yaml new file mode 100644 index 0000000000..d031e2e890 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-healthcheck/requirements.yaml @@ -0,0 +1,22 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +dependencies: + - name: common + version: ~2.0.0 + repository: '@local' diff --git a/kubernetes/dcaegen2/charts/dcae-healthcheck/templates/deployment.yaml b/kubernetes/dcaegen2/charts/dcae-healthcheck/templates/deployment.yaml new file mode 100644 index 0000000000..463504cf40 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-healthcheck/templates/deployment.yaml @@ -0,0 +1,65 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +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: 1 + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.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: DCAE_NAMESPACE + value: {{ .Values.dcae_ns }} + - name: ONAP_NAMESPACE + value: {{ include "common.namespace" . }} + - name: HELM_RELEASE + value: {{ .Release.Name }} + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/dcaegen2/charts/dcae-healthcheck/templates/service.yaml b/kubernetes/dcaegen2/charts/dcae-healthcheck/templates/service.yaml new file mode 100644 index 0000000000..05405340e3 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-healthcheck/templates/service.yaml @@ -0,0 +1,45 @@ +#============LICENSE_START======================================================== +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +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" -}} + - port: {{ .Values.service.externalPort }} + #Example internal target port if required + #targetPort: {{ .Values.service.internalPort }} + 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 }} diff --git a/kubernetes/dcaegen2/charts/dcae-healthcheck/values.yaml b/kubernetes/dcaegen2/charts/dcae-healthcheck/values.yaml new file mode 100644 index 0000000000..7e9835457d --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-healthcheck/values.yaml @@ -0,0 +1,53 @@ +#============LICENSE_START======================================================== +#================================================================================= +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# Copyright © 2018 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. +# ============LICENSE_END========================================================= + +################################################################# +# Global configuration defaults. +################################################################# +global: + nodePortPrefix: 302 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + +service: + name: dcae-healthcheck + internalPort: 80 + externalPort: 80 + type: ClusterIP + +# 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 +# application image +repository: nexus3.onap.org:10001 +image: onap/org.onap.dcaegen2.deployments.healthcheck-container:1.1.0 + +# Kubernetes namespace for components deployed via Cloudify manager +# If empty, use the common namespace +# dcae_ns: "onap" + diff --git a/kubernetes/dcaegen2/charts/dcae-redis/.helmignore b/kubernetes/dcaegen2/charts/dcae-redis/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/.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/dcaegen2/charts/dcae-redis/Chart.yaml b/kubernetes/dcaegen2/charts/dcae-redis/Chart.yaml new file mode 100644 index 0000000000..271458c8df --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/Chart.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, AT&T, 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: ONAP DCAE Redis +name: dcae-redis +version: 2.0.0 diff --git a/kubernetes/dcaegen2/charts/dcae-redis/requirements.yaml b/kubernetes/dcaegen2/charts/dcae-redis/requirements.yaml new file mode 100644 index 0000000000..7244af3970 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright © 2017 Amdocs, AT&T, 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' diff --git a/kubernetes/dcaegen2/charts/dcae-redis/resources/redis/scripts/redis-cluster-config.sh b/kubernetes/dcaegen2/charts/dcae-redis/resources/redis/scripts/redis-cluster-config.sh new file mode 100755 index 0000000000..f4547525c9 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/resources/redis/scripts/redis-cluster-config.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= + +(if [[ "$HOSTNAME" == *{{.Chart.Name}}-0 ]]; then + echo "delay by 10 seconds for redis server starting" + sleep 10 + + NODES="" + echo "====> wait for all {{.Values.replicaCount}} redis pods up" + while [ "$(echo $NODES | wc -w)" -lt {{.Values.replicaCount}} ] + do + echo "======> $(echo $NODES |wc -w) / {{.Values.replicaCount}} pods up" + sleep 5 + RESP=$(wget -vO- --ca-certificate /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --header "Authorization +: Bearer $(</var/run/secrets/kubernetes.io/serviceaccount/token)" https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT +_443_TCP_PORT/api/v1/namespaces/{{.Release.Namespace}}/pods?labelSelector=app={{.Chart.Name}}) + + IPS=$(echo $RESP | jq -r '.items[].status.podIP') + IPS2=$(echo $IPS | sed -e 's/[a-zA-Z]*//g') + echo "======> IPs: ["$IPS2"]" + NODES="" + for I in $IPS2; do NODES="$NODES $I:{{.Values.service.externalPort}}"; done + echo "======> nodes: ["$NODES"]" + done + echo "====> all {{.Values.replicaCount}} redis cluster pods are up. wait 10 seconds before the next step"; echo + sleep 10 + + echo "====> Configure the cluster" + + # $NODES w/o quotes + echo "======> nodes: [$(echo $NODES |paste -s)]" + redis-trib create --replicas 1 $(echo $NODES |paste -s) +fi ) & + +redis-server /conf/redis.conf + diff --git a/kubernetes/dcaegen2/charts/dcae-redis/templates/NOTES.txt b/kubernetes/dcaegen2/charts/dcae-redis/templates/NOTES.txt new file mode 100644 index 0000000000..d333bfc159 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/templates/NOTES.txt @@ -0,0 +1,34 @@ +{{/* +# Copyright © 2017 Amdocs, AT&T, 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. +*/}} +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http://{{ . }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ include "common.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "common.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ include "common.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ include "common.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.namespace" . }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.externalPort }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ include "common.namespace" . }} -l "app={{ template "so.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }} +{{- end }} diff --git a/kubernetes/dcaegen2/charts/dcae-redis/templates/configmap.yaml b/kubernetes/dcaegen2/charts/dcae-redis/templates/configmap.yaml new file mode 100644 index 0000000000..85ebee672b --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/templates/configmap.yaml @@ -0,0 +1,36 @@ +# Copyright © 2017 Amdocs, AT&T, 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: {{ include "common.fullname" . }} + namespace: {{ include "common.namespace" . }} +data: + redis.conf: |+ + cluster-enabled yes + cluster-require-full-coverage no + cluster-node-timeout 15000 + cluster-config-file /data/nodes.conf + cluster-migration-barrier 1 + appendonly yes + protected-mode no +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-scripts + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/redis/scripts/*").AsConfig . | indent 2 }} diff --git a/kubernetes/dcaegen2/charts/dcae-redis/templates/pv.yaml b/kubernetes/dcaegen2/charts/dcae-redis/templates/pv.yaml new file mode 100644 index 0000000000..5573179d87 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/templates/pv.yaml @@ -0,0 +1,227 @@ +{{/* +# Copyright © 2017 Amdocs, AT&T, 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. +*/}} +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}0 + 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" . }} +spec: + storageClassName: manual + 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 }}0 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}1 + 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" . }} +spec: + storageClassName: manual + 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 }}1 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}2 + 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" . }} +spec: + storageClassName: manual + 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 }}2 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}3 + 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" . }} +spec: + storageClassName: manual + 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 }}3 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}4 + 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" . }} +spec: + storageClassName: manual + 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 }}4 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}5 + 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" . }} +spec: + storageClassName: manual + 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 }}5 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}6 + 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" . }} +spec: + storageClassName: manual + 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 }}6 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}7 + 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" . }} +spec: + storageClassName: manual + 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 }}7 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}8 + 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" . }} +spec: + storageClassName: manual + 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 }}8 +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: {{ include "common.fullname" . }}9 + 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" . }} +spec: + storageClassName: manual + 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 }}9 + +{{- end -}} diff --git a/kubernetes/dcaegen2/charts/dcae-redis/templates/service.yaml b/kubernetes/dcaegen2/charts/dcae-redis/templates/service.yaml new file mode 100644 index 0000000000..636f512a53 --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/templates/service.yaml @@ -0,0 +1,48 @@ +# Copyright © 2017 Amdocs, AT&T, 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.servicename" . }} + namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + annotations: +spec: + type: {{ .Values.service.type }} + ports: + {{if eq .Values.service.type "NodePort" -}} + - port: {{ .Values.service.externalPort }} + #Example internal target port if required + #targetPort: {{ .Values.service.internalPort }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} + name: {{ .Values.service.portName }} + - port: {{ .Values.service.externalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + name: {{ .Values.service.portName2 }} + {{- else -}} + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.portName }} + - port: {{ .Values.service.externalPort2 }} + targetPort: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.portName2 }} + {{- end}} + selector: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} diff --git a/kubernetes/dcaegen2/charts/dcae-redis/templates/statefulset.yaml b/kubernetes/dcaegen2/charts/dcae-redis/templates/statefulset.yaml new file mode 100644 index 0000000000..f72e540f1e --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/templates/statefulset.yaml @@ -0,0 +1,115 @@ +{{/* +# Copyright © 2017 Amdocs, AT&T, 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: apps/v1beta1 +kind: StatefulSet +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: + serviceName: {{ .Values.service.name }} + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ include "common.name" . }} + release: {{ .Release.Name }} + spec: + initContainers: + containers: + - name: {{ include "common.name" . }} + image: "{{ include "common.repository" . }}/{{ .Values.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: + - /bin/sh + - -c + - | + /opt/scripts/redis-cluster-config.sh + ports: + - containerPort: {{ .Values.service.internalPort }} + name: {{ .Values.service.name }} + - containerPort: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.name2 }} + # disable liveness probe when breakpoints set in debugger + # so K8s doesn't restart unresponsive container + {{- if eq .Values.liveness.enabled true }} + livenessProbe: + exec: + command: + - sh + - -c + - "redis-cli -h $(hostname) ping" + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} + {{end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + env: + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /conf + name: {{ include "common.fullname" . }}-config + - mountPath: /data + name: {{ include "common.fullname" . }}-data + - mountPath: /opt/scripts + name: {{ include "common.fullname" . }}-scripts + 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: {{ include "common.fullname" . }}-config + configMap: + name: {{ include "common.fullname" . }} + items: + - key: redis.conf + path: redis.conf + - name: {{ include "common.fullname" . }}-scripts + configMap: + name: {{ include "common.fullname" . }}-scripts + defaultMode: 0755 + - name: localtime + hostPath: + path: /etc/localtime + imagePullSecrets: + - name: "{{ include "common.namespace" . }}-docker-registry-key" + volumeClaimTemplates: + - metadata: + name: {{ include "common.fullname" . }}-data + labels: + name: {{ include "common.fullname" . }} + spec: + accessModes: [ {{ .Values.persistence.accessMode }} ] + storageClassName: manual + resources: + requests: + storage: {{ .Values.persistence.size }} diff --git a/kubernetes/dcaegen2/charts/dcae-redis/values.yaml b/kubernetes/dcaegen2/charts/dcae-redis/values.yaml new file mode 100644 index 0000000000..8550da074b --- /dev/null +++ b/kubernetes/dcaegen2/charts/dcae-redis/values.yaml @@ -0,0 +1,114 @@ +# Copyright © 2017 Amdocs, AT&T, 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 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 + loggingRepository: docker.elastic.co + loggingImage: beats/filebeat:5.5.0 + persistence: {} + +################################################################# +# Application configuration defaults. +################################################################# +# application image +repository: nexus3.onap.org:10001 +image: onap/org.onap.dcaegen2.deployments.redis-cluster-container:latest +pullPolicy: Always + +# application configuration +# Example: +config: {} + +# default number of instances +replicaCount: 6 + +nodeSelector: {} + +affinity: {} + +# probe configuration parameters +liveness: + initialDelaySeconds: 60 + periodSeconds: 10 + timeoutSeconds: 10 + # necessary to disable liveness probe when setting breakpoints + # in debugger so K8s doesn't restart unresponsive container + enabled: true + +readiness: + initialDelaySeconds: 15 + periodSeconds: 10 + +service: + #Example service definition with external, internal and node ports. + #Services may use any combination of ports depending on the 'type' of + #service being defined. + type: NodePort + name: dcae-redis + portName: client + externalPort: 6379 + internalPort: 6379 + nodePort: 86 + portName2: gossip + externalPort2: 16379 + internalPort2: 16379 + nodePort2: 87 + +## Persist data to a persitent volume +persistence: + enabled: true + + ## 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) + accessMode: ReadWriteOnce + size: 10Mi + mountPath: /dockerdata-nfs + mountSubPath: redis/data + +ingress: + enabled: false + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # + # Example: + # Configure resource requests and limits + # ref: http://kubernetes.io/docs/user-guide/compute-resources/ + # Minimum memory for development is 2 CPU cores and 4GB memory + # Minimum memory for production is 4 CPU cores and 8GB memory +#resources: +# limits: +# cpu: 2 +# memory: 4Gi +# requests: +# cpu: 2 +# memory: 4Gi |